While pentesting a website (yes, legally), an sql injection popped up, but I can't see how to use it currently. The query string looks like this, and the insertion point is at the first _ after values:
query = 'SELECT item.a
FROM favitem item
WHERE ( item.a =?) AND (item.b=? )', values = [123456789_, 987654321]
a simple
, 1] UNION SELECT banner FROM v$version WHERE banner LIKE 'Oracle%'; --
doesn't return any values, but states it was successfull. It is always successful when it includes '%', even on random strings, that are unlikely to match at all. It returns an error when the it states LIKE 'Oracle' (without %). Any suggestions why this is always successful with %?
?) used in the DB acces code? Is that a prepared statement in the background or is the code actually doing string replacement.query = ...defines a variable in whatever language you are using - it is a not valid SQL statement). Parameter markers like?are usually used in "prepared statements" which are not subject to SQL injection."in Java, not single quotes'and the comma notation for thevaluespart also seems a bit strange. Are you using any framework? e.g. Spring JDBC Template?