Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

   

Linda Webb

Got breaking Oracle news?    Burleson Consulting Oracle News

Click here for more Oracle News Headlines

 


Do semicolons in SQL expose your database to injection attacks?

QUESTION:

 

I've noticed that when you write SQL statements to execute over JDBC with Oracle 10g, you're not supposed to include the typical ending semicolon. For example, you're supposed to just write:

   "SELECT * FROM MYTABLE"

I was wondering if one reason for this is to cut down on SQL Injection attacks like those mentioned here:

http://www.tek-tips.com/viewthread.cfm?qid=940825&page=1 

ANSWER:

 

Great question!   


From XKCD

Answer from my research:  In SQL SERVER, yes.  In Oracle, no! 

**************************************************** 

http://www.webcohort.com/web_application_security/research/white_papers/blindfolded_sql_server_injection.html

Another technique uses the semicolon character. In SQL, a semicolon is used to chain several SQL statements in the same line. While with SQL injection this can be used inside the injection code, the Oracle drivers do not allow use of semicolons in this manner.  

**************************************************** 

http://online.securityfocus.com/infocus/1644   

Statements in Oracle tools and languages are delimited by semicolons (;) so we can try that next: 

SQL> exec get_cust('x'';select username from all_users where ''x''=''x');
debug:select customer_phone from customers where customer_surname='x';select
username from all_users where 'x'='x'
-911ORA-00911: invalid character 

Again this doesn’t work, as another Oracle error code is returned. Adding a semicolon after the first statement will not allow a second statement to be executed, so the only way to get Oracle to execute extra SQL is to either extend the existing where clause or to use a union or a subselect. 

******************************************************* 

http://www.imperva.com/application_defense_center/glossary/sql_injection.html  

    http://www.mydomain.com/products/products.asp?productid=123;DROP TABLE Products 

In this example the semicolon is used to pass the database server multiple statements in a single execution. The second statement is "DROP TABLE Products" which causes SQL Server to delete the entire Products table.


 

 
��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2017

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.

Remote Emergency Support provided by Conversational