RE: Can System() of Perl be bypassed?

From: Tom Arseneault (TArseneault@counterpane.com)
Date: 01/23/03

  • Next message: FBO: "Re: Can System() of Perl be bypassed?"
    From: Tom Arseneault <TArseneault@counterpane.com>
    To: "'Sandeep Giri'" <sandeepgiri@indiatimes.com>, secprog@securityfocus.com
    Date: Wed, 22 Jan 2003 15:10:39 -0800
    
    

    Taint stops you from using the raw input in the system command (you need to
    touch the data in some way to un-taint it, see the docs for more info) but
    if you miss something when you process his/her input you can still run into
    problems. So while it's a help, proper handling of the data (getting rid of
    shell escape characters or better yet create a char class of good characters
    and only allow them thru to the system command) is the way to go.

    Tom

    -----Original Message-----
    From: Sandeep Giri [mailto:sandeepgiri@indiatimes.com]
    Sent: Tuesday, January 21, 2003 11:03 PM
    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



    Relevant Pages

    • Re: Question about system call
      ... P> If memory serves me, back ticks are only needed inside a system command ... P> for UNIX commands and regular ticks specifying the system command within ... P> the Perl script. ...
      (perl.beginners)
    • Re: help chdir UNC path ( newbie )
      ... is a feature of CMD.EXE and has nothing to do with Perl). ... > Also CMD.EXE will interpret your command as a request to run a program ... the string doesn't get passed to the system command. ...
      (comp.lang.perl.misc)
    • Re: SYSTEM command problem
      ... I can run the script from the website and it creates the file fine. ... But the last line of code runs a SYSTEM command that calls Blat.exe and ... Perl will tell you what's wrong - if you ask it to. ... Another place to look for clues would be blat.exe's error log, ...
      (comp.lang.perl.misc)
    • Re: System, shell question
      ... > I am a beginner to perl and I have a question ... > execute a system command, ... > and the $cmd which is a prog takes another program ...
      (perl.beginners)
    • Re: Meaning of ` signs
      ... > Hey again all. ... I have progressed a great deal with the basics of perl. ... `` executes the enclosed text as a system command and returns ...
      (comp.lang.perl.misc)