From: Alexey Tourbin <at@altlinux.ru> To: Sisyphus <sisyphus@altlinux.ru> Subject: [sisyphus] Re: Q: perl security, CPAN security Date: Mon, 27 Jun 2005 13:53:46 +0400 Message-ID: <20050627095346.GK31585@solemn.turbinal.org> (raw) In-Reply-To: <200506271303.25973.serpiph@nikiet.ru> [-- Attachment #1: Type: text/plain, Size: 1834 bytes --] On Mon, Jun 27, 2005 at 01:03:25PM +0400, Epiphanov Sergei wrote: > В сообщении от 27 Июнь 2005 11:57 Alexey Tourbin написал: > > > Сейчас правило для имплицитного включения tain mode выглядит так: > > > perl.c: PL_tainting |= (PL_uid && (PL_euid != PL_uid || PL_egid != > > > PL_gid)); > > > > > > Предлагается добавить в условие PL_euid==0 || ... > > > > Забыл сказать, что будет такой же workaround, какой сейчас существует. > Хм, сейчас я могу выбрать, включать или нет этот режим. В Вашем случае > волей-неволей придётся ломать голову над каждой инструкцией. Можно запустить с опцией -t (enable tainting warnings), она "перебивает" опцию -T (enable tainting checks). Об этом лучше никому не говорить. :) > Например, рабочий скрипт вида: > > #!/usr/bin/perl > foreach $l(@ARGV){ > system("/usr/bin/команда '$l'"); > } Рабочий? То есть он берёт произвольные аргументы с командной строки и передаёт их shell'у для выполнения? Вот смотрите: $ cat test.pl #!/usr/bin/perl foreach $l(@ARGV){ print "/usr/bin/команда '$l'\n"; } $ perl test.pl arg /usr/bin/команда 'arg' $ perl test.pl arg\'\;rm\ -rf\ \'/ /usr/bin/команда 'arg';rm -rf '/' $ Квотирование -- это вообще некое неприятное место как в шелле, так и в перле (отчасти вследствие шелла). > и притом, что я знаю, что это за 'команда' и что получу в результате, всё > равно скрипт придётся обвешивать бог знает чем. Для скриптов, которые я хоть > как-то задействую в управлении сервером, я обязательно пишу параметр -T. Вы, > когда пишите '/bin/cat "file"', не проверяете file на "вшивость". Хотя > знаете, что нетекстовый файл может привести к сбою шрифтов консоли. Так же и > я пишу на Perl. Ох, я не использую /bin/cat, я использую $ perl -MConfig -le 'print $Config{pager}' /usr/bin/less -isR $ [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2005-06-27 9:53 UTC|newest] Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top 2005-06-26 9:06 [sisyphus] " Alexey Tourbin 2005-06-27 7:30 ` Epiphanov Sergei 2005-06-27 7:48 ` [sisyphus] " Alexey Tourbin 2005-06-27 7:57 ` Alexey Tourbin 2005-06-27 9:03 ` Epiphanov Sergei 2005-06-27 9:53 ` Alexey Tourbin [this message] 2005-06-27 10:55 ` Epiphanov Sergei 2005-06-27 11:29 ` Alexey Tourbin 2005-06-27 12:04 ` Epiphanov Sergei 2005-06-27 12:11 ` Epiphanov Sergei 2005-06-27 12:13 ` Epiphanov Sergei 2005-06-27 12:58 ` Alexey Tourbin 2005-06-27 13:11 ` [sisyphus] [JT] " Michael Shigorin 2005-06-28 5:39 ` Ivan Adzhubey 2005-06-28 5:55 ` [sisyphus] " Alexey Tourbin 2005-06-28 22:25 ` [sisyphus] " Ivan Adzhubey 2005-06-27 13:14 ` [sisyphus] " Epiphanov Sergei 2005-06-27 13:28 ` Alexey Tourbin 2005-06-28 4:57 ` Andrey Rahmatullin 2005-06-28 14:47 ` Вячеслав Диконов 2005-06-28 18:53 ` Andrey Rahmatullin 2005-06-28 17:46 ` Вячеслав Диконов 2005-06-28 7:51 ` Epiphanov Sergei 2005-06-28 9:56 ` Andrey Rahmatullin 2005-06-28 11:51 ` Epiphanov Sergei 2005-06-28 14:32 ` Andrey Rahmatullin 2005-06-28 9:29 ` Dmitry V. Levin 2005-06-28 10:17 ` Epiphanov Sergei 2005-06-28 10:27 ` [sisyphus] to cat or not to cat Dmitry V. Levin 2005-06-28 11:01 ` Epiphanov Sergei 2005-06-28 11:11 ` Dmitry V. Levin 2005-06-28 11:47 ` [sisyphus] mine fields Epiphanov Sergei 2005-06-28 12:19 ` [sisyphus] postfix-tls Dmitry V. Levin 2005-06-28 13:01 ` [sisyphus] Re: mine fields Konstantin A. Lepikhov 2005-06-28 17:58 ` [sisyphus] to cat or not to cat Igor Zubkov 2005-06-28 18:13 ` [sisyphus] [JT] rpm sux Dmitry V. Levin 2005-06-28 23:31 ` Igor Zubkov 2005-06-29 19:22 ` [sisyphus] Re: [JT] rpm os Michael Shigorin 2005-06-29 19:18 ` [sisyphus] [JT] Re: to cat or not to cat Michael Shigorin 2005-06-29 20:25 ` Dmitry V. Levin 2005-07-01 15:39 ` [sisyphus] " Alexey Tourbin
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20050627095346.GK31585@solemn.turbinal.org \ --to=at@altlinux.ru \ --cc=sisyphus@altlinux.ru \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
ALT Linux Sisyphus discussions This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \ sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru public-inbox-index sisyphus Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.sisyphus AGPL code for this site: git clone https://public-inbox.org/public-inbox.git