Food for thought... [PHP security]

Caporegime
Joined
18 Oct 2002
Posts
29,493
Location
Back in East London
nice :)

well you can still use it and in a lot of cases its needed, you've just got to remember to wrap it in htmlentities to cover your arse.
 
After some tests, it appears $_SERVER['SCRIPT_NAME'] is immune to this exact attack, but if some of the $_SERVER indices can be 'infected' then there will be a way to get them all :)
 
much of the $_SERVER superglobal can be spoofed anyway so one more wont hurt.

it's just the a case of looping through the $_SERVER superglobal and running each entry through urldecode() and then htmlentities().
 
This is a 'flaw' with PHP, thus it is a problem across all platforms and webservers.

jonno - using urldecode on input is a very touchy subject, as pointed out in one of the comments on the Reserved Variables page on php.net :)
 
Felix said:
What am I missing?
que?

If you mean you can't see the problem, basically it's an injection attack where the attacker could inject pretty much whatever they want onto your site, via a loophole in the superglobal $_SERVER['PHP_SELF'].
 
Back
Top Bottom