|
|||||||||||
|
Re: Can System() of Perl be bypassed?
From: Glynn Clements <glynn.clements(at)virgin.net>
Date: Wed Jan 22 2003 - 17:37:14 EST Sandeep Giri wrote: > In my PERL code,I am using user's input as command line argument for the
It depends upon how it is called. The entry for "system" in the perlfunc(1) manpage says:
Note
So, if there's a single scalar argument (i.e. you generate a single string by concatenating the user's input with some other data), then yes, the user can execute arbitrary commands. > Is PERL's -T (Taint mode) the solution for this?
The obvious solution is to either use multiple arguments or an array with more than one element, so that the shell isn't used. There may be advantages to using taint mode as well, but that's a separate issue. -- Glynn ClementsReceived on Wed Jan 22 18:20:49 2003 This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 14:02:45 EDT |
||||||||||
|
|||||||||||