|
|
|
|
| Re: How to prevent SQL Injection in OracleText SQL statement [message #398566 is a reply to message #398543] |
Thu, 16 April 2009 14:40  |
 |
Barbara Boehmer
Messages: 7667 Registered: November 2002 Location: California, USA
|
Senior Member |
|
|
Security issues with sql injection happen when an unvalidated user-supplied string is executed dynamically. If you can eliminate the dynamic execution, then there is no problem. There is no need for dynamic sql in the snippet of code that you posted. You can probably just do whatever you are doing staticly. For example if you are opening a ref cursor, then you can do so safely with something like:
open your_refcursor for
select * from your_table
where contains (text, p_text) > 0;
instead of opening it dynamically, allowing sql injection like this:
open your_refcursor for
'select * from your_table
where contains (text,''' || p_text || ''') > 0';
|
|
|
|