aaron_s
Tue 15 January 2008, 03:45 am GMT +0100
Ok - as always - edited to protect my employer - or my job ;)
So, I've been auditing some code for my employer, and I found some unfiltered code a mysql query.
The url from /news is /newsitem/12 where 12 is the ID of the article.
Then, here is the code:
$newsID = basename($_SERVER['REQUEST_URI']);
$sql = "select * from Tnews where newsID={$newsID}";
So, I've already fixed this - so no worries, but I'm having a hard time actually proving the SQL injection issue here. Every time I put something in there, it gets urlencoded (obviously) by the browser. I've been able to successfully break the sql, but never get extra info. I've also tried telnet connections to the apache server - but any non-url encoded urls generate 400 errors for bad request.
Anyone have any ideas?
So, I've been auditing some code for my employer, and I found some unfiltered code a mysql query.
The url from /news is /newsitem/12 where 12 is the ID of the article.
Then, here is the code:
$newsID = basename($_SERVER['REQUEST_URI']);
$sql = "select * from Tnews where newsID={$newsID}";
So, I've already fixed this - so no worries, but I'm having a hard time actually proving the SQL injection issue here. Every time I put something in there, it gets urlencoded (obviously) by the browser. I've been able to successfully break the sql, but never get extra info. I've also tried telnet connections to the apache server - but any non-url encoded urls generate 400 errors for bad request.
Anyone have any ideas?