Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security SecProg
[Top] [All Lists]

Re: php - inject code into $_SERVER ?

Subject: Re: php - inject code into $_SERVER ?
Date: Thu, 03 Feb 2005 22:30:03 +0100
C. Church wrote:

----- Original Message ----- From: "exon" <exon@home.se>

Don't trust any input from the user or their browser.


Exactly. But trust the input from the server. You don't have much choice anyway, so it's a waste of time bothering about it.



I disagree. You never know when a new vulnerability will pop up somewhere - maybe there's not a vulnerability today, but maybe there'll be one tomorrow. Maybe it won't require "ownership" of a webserver, maybe it'll be bad handling of data that wouldn't affect anything but software using those SERVER variables... It's _never_ a waste of time to ask yourself whether or not a variable is safe, and since it's coming from _outside_ of _your_ code, what's the trouble with adding a single line to check the contents of the variable?



Because if an attacker can set environment variables to arbitrary values through a webserver exploit he/she can also modify other slices of memory making PHP-scripts the last of your worries. An exploit not requiring PHP to be installed and sending the $_SERVER provided variables will be infinitely easier to write (due to heap/stack offset reasons, where eip and such can be easily calculated but arbitrary variables cannot without some serious code injection) and more generic as well. In short; No idiot on earth would want to change the values of $_SERVER in hope that it will be used if they already have the possibility to execute arbitrary code.


<Prev in Thread] Current Thread [Next in Thread>