Re: Can System() of Perl be bypassed?

From: Luciano Miguel Ferreira Rocha (strange@nsk.no-ip.org)
Date: 01/24/03

  • Next message: Jason Coombs: "RE: PGP scripting..."
    Date: Fri, 24 Jan 2003 00:27:49 +0000
    From: Luciano Miguel Ferreira Rocha <strange@nsk.no-ip.org>
    To: secprog@securityfocus.com
    
    

    On Thu, Jan 23, 2003 at 02:15:43PM -0800, Brian Hatch wrote:
    > > my @args = ($Keywords,....);
    > > my @cmd = ("$JAVA",
    > > "-search.home=$SEARCH_HOME",
    > > "Searcher",
    > > @args);
    > > system(@cmd) == 0) ||error();
    > >
    > > Need I be more paranoid than this and use my own regex to filter out
    > > keywords my self?
     
    > However I have no idea if those values could be used to
    > break the program itself ($JAVA). If this program were
    > running with greater privs (suid, CGI, etc) then they can
    > supply a new $SEARCH_HOME path then they could cause their
    > own code to run. If there are bad keywords then you aren't
    > doing anything to get rid of them. (Or, preferably, only
    > allowing good keywords.)

    Java (at least Sun's sdk) ignores any options after a class or jar file,
    and passes them to the application instead.

    Regards,
    Luciano Rocha

    -- 
    Consciousness: that annoying time between naps.
    


    Relevant Pages

    • Re: Any regex/parsing gurus out there? ;-)
      ... > Ive posted a few times in the past, but not on the topic of regex... ... you'll need to know what characters serve as token separators, that is, ... To match multiple keywords at once, if you want a set of keywords to ... I'll explain the parentheses later. ...
      (comp.lang.java.help)
    • Re: Any regex/parsing gurus out there? ;-)
      ... You rock Daniel! ... >> functions and special language keywords. ... The regex for a keyword will thus be: ... I'll explain the parentheses later. ...
      (comp.lang.java.help)
    • Re: Searching for keywords in the META keywords tag
      ... We are both very lucky that the RegEx for that search was ... "John Lenaghan" wrote in message ... Searching for keywords in the META keywords tag ... >> You could search using regular expressions to find the keyword. ...
      (microsoft.public.frontpage.addins)
    • Re: Replacing words from strings except and / or / and not
      ... > if w in KEYWORDS: ... That's even easier than Skip's suggestion. ... thanks to Thomas for the regex tip! ...
      (comp.lang.python)
    • Re: Using check boxes to select items in a multi select list box
      ... This will be a single user situation, and if there are multiple users, they ... won't be trying to do data entry and filter records at the same time. ... Selecting and saving keywords works perfectly. ...
      (microsoft.public.access.forms)