Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^4: Perl needs Zend (mod_perl vs. fastcgi)

by perrin (Chancellor)
on Oct 22, 2006 at 16:06 UTC ( [id://579867]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Perl needs Zend (mod_perl vs. fastcgi)
in thread Perl needs Zend

Security isn't significantly different between them. In both cases, you may choose to run as a trusted user or not. In both cases, a crashed script only affects its own child process, not the server as a whole. In both cases, screwing up the perl environment can affect later perl scripts run in the same process. That's hard to avoid in any persistent environment.
  • Comment on Re^4: Perl needs Zend (mod_perl vs. fastcgi)

Replies are listed 'Best First'.
Re^5: Perl needs Zend (mod_perl vs. fastcgi)
by shmem (Chancellor) on Oct 23, 2006 at 05:48 UTC
    You are right in what concerns environment; but a crash in mod_perl takes down the apache child, whereas with fastcgi only perl is blown away. The apache child talking to it serves a 500 error page (or whatever it got until that) and stays alive.

    With a compromise, the situation is worse with mod_perl. If you've 0wn3d a mod_perl script, you've got apache, not just the script as in fastcgi.

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

      With FastCGI, perl and the FastCGI child process dies. There is no meaningful difference between that and an apache/mod_perl process dying. In both cases, the current request is ruined, another process is spawned, and things continue.

      With a security problem, you do not "get" apache if you compromise a mod_perl script. You have no access to anything else in the server but your current process, and certainly no access to the parent process. What matters is what you can do to the system itself, which is determined by what user you run as, and this is the same for FastCGI.

        That really depends on the type of exploit. AFAIK it's possible to change the server runtime config of an apache child from within a mod_perl script (please correct me if I'm wrong), and that copy might be serving other things than just that script.

        So, you have that apache child owned for it's lifetime (of course not the parent), which could lead to further exploits in other areas of the webserver. That's not possible with fastcgi.

        Of course all this is theoretical without a POC.

        --shmem

        _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                      /\_¯/(q    /
        ----------------------------  \__(m.====·.(_("always off the crowd"))."·
        ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://579867]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-16 16:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found