While this will help, the occurrence of '://' being the ultimate
exploit is not necessarily the case. An injection attack can still
be very effective by exploiting any user variable ($_GET or $_POST)
that hasn't been validated properly.
eg.:
<?php
shell_exec('ls ' . $_GET['pictures_match'] . '.jpg');
?>
$_GET['pictures_match'] could be: '*; rm -rf /; ls *'; This is, of
course, the obligatory "delete all your files" example. Claerly, you
can see why this is bad where a user variable does not contain any
sort of URL. And, obviously, an attacker would have to know your
application, but that's not too far fetched if these are open source
apps we're talking about.
- Brent
At 2007-07-30 07:41, you wrote:
>How can we protect ourselves? What is the common pattern here? It
>seems that any occurrence of "://" in a http query string is
>required for all of these attacks. What I would like to do (if it is
>possible) is to block this from being passed to ANY php script in
>the query string or POST variables etc.
Brent Epp
mailto:brent (at mark) pdcweb.net