RE: Can System() of Perl be bypassed?
From: NESTING, DAVID M (SBCSI) (dn3723@sbc.com)
Date: 01/22/03
- Previous message: Brian Hatch: "Re: Can System() of Perl be bypassed?"
- Maybe in reply to: Sandeep Giri: "Can System() of Perl be bypassed?"
- Next in thread: Ilya Martynov: "Re: Can System() of Perl be bypassed?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: "NESTING, DAVID M (SBCSI)" <dn3723@sbc.com> To: "'Sandeep Giri'" <sandeepgiri@indiatimes.com>, secprog@securityfocus.com Date: Wed, 22 Jan 2003 15:30:17 -0600
Use the multiple-argument version of the system call, and ensure that the
program you're calling won't misbehave if weird input is provided:
system("/path/some-command", $user_data);
Passing $user_data and the command name in a single string (the
single-argument form of system()) causes the shell to parse and interpret
the data, which means shell metacharacters in the user's data will be
interpreted.
Read through perlsec for this and other gotchas. Taint mode in Perl will
help you avoid them, but don't rely exclusively on it. It will catch some
stupid mistakes, but it isn't a cure for not knowing what you're doing.
Good luck,
David
-----Original Message-----
From: Sandeep Giri [mailto:sandeepgiri@indiatimes.com]
Sent: Wednesday, 22 January, 2003 01:03
To: secprog@securityfocus.com
Subject: Can System() of Perl be bypassed?
Hi All,
In my PERL code,I am using user's input as command line argument for the
program being executed by System().
Can user run command of his choice by giving malicious input?
Is PERL's -T (Taint mode) the solution for this?
Thanks.
Sandeep Giri
- Next message: Ilya Martynov: "Re: Can System() of Perl be bypassed?"
- Previous message: Brian Hatch: "Re: Can System() of Perl be bypassed?"
- Maybe in reply to: Sandeep Giri: "Can System() of Perl be bypassed?"
- Next in thread: Ilya Martynov: "Re: Can System() of Perl be bypassed?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|