<?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=Jacob+Robertson</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=Jacob+Robertson"/>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php/Special:Contributions/Jacob_Robertson"/>
		<updated>2026-04-26T03:26:51Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.2</generator>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Top_10_2010-A5-Cross-Site_Request_Forgery_(CSRF)&amp;diff=126530</id>
		<title>Top 10 2010-A5-Cross-Site Request Forgery (CSRF)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Top_10_2010-A5-Cross-Site_Request_Forgery_(CSRF)&amp;diff=126530"/>
				<updated>2012-03-19T13:29:52Z</updated>
		
		<summary type="html">&lt;p&gt;Jacob Robertson: grammar&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Top_10_2010:TopTemplate|useprev=2010PrevLink|usenext=2010NextLink|prev=A4-Insecure Direct Object References|next=A6-Security Misconfiguration}}&lt;br /&gt;
&lt;br /&gt;
{{Top_10_2010:SummaryTableHeaderBeginTemplate}}&lt;br /&gt;
{{Top_10_2010:SummaryTableValue-2-Template|Exploitability|AVERAGE}}&lt;br /&gt;
{{Top_10_2010:SummaryTableValue-1-Template|Prevalence|WIDESPREAD}}&lt;br /&gt;
{{Top_10_2010:SummaryTableValue-1-Template|Detectability|EASY}}&lt;br /&gt;
{{Top_10_2010:SummaryTableValue-2-Template|Impact|MODERATE}}&lt;br /&gt;
{{Top_10_2010:SummaryTableHeaderEndTemplate}}&lt;br /&gt;
     &amp;lt;td {{Template:Top 10 2010:SummaryTableRowStyleTemplate}}&amp;gt;Consider anyone who can trick your users into submitting a request to your website. Any website or other HTML feed that your users access could do this.&amp;lt;/td&amp;gt;&lt;br /&gt;
     &amp;lt;td {{Template:Top 10 2010:SummaryTableRowStyleTemplate}}&amp;gt;Attacker creates forged HTTP requests and tricks a victim into submitting them via image tags, XSS, or numerous other techniques. If the &amp;lt;u&amp;gt;user is authenticated&amp;lt;/u&amp;gt;, the attack succeeds.&amp;lt;/td&amp;gt;&lt;br /&gt;
     &amp;lt;td colspan=2  {{Template:Top 10 2010:SummaryTableRowStyleTemplate}}&amp;gt;[[CSRF]] takes advantage of web applications that allow attackers to predict all the details of a particular action.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Since browsers send credentials like session cookies automatically, attackers can create malicious web pages which generate forged requests that are indistinguishable from legitimate ones.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Detection of CSRF flaws is fairly easy via penetration testing or code analysis.&amp;lt;/td&amp;gt;&lt;br /&gt;
     &amp;lt;td {{Template:Top 10 2010:SummaryTableRowStyleTemplate}}&amp;gt;Attackers can cause victims to change any data the victim is allowed to change or perform any function the victim is authorized to use&amp;lt;/td&amp;gt;&lt;br /&gt;
     &amp;lt;td {{Template:Top 10 2010:SummaryTableRowStyleTemplate}}&amp;gt;Consider the business value of the affected data or application functions. Imagine not being sure if users intended to take these actions.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Consider the impact to your reputation.&amp;lt;/td&amp;gt;&lt;br /&gt;
{{Top_10_2010:SummaryTableEndTemplate}}&lt;br /&gt;
&lt;br /&gt;
{{Top_10_2010:SubsectionAdvancedTemplate|type={{Top_10_2010:StyleTemplate}}|number=1|risk=5}}&lt;br /&gt;
The easiest way to check whether an application is vulnerable is to see if each link and form contains an unpredictable token for each user. Without such an unpredictable token, attackers can forge malicious requests. Focus on the links and forms that invoke state-changing functions, since those are the most important CSRF targets.&lt;br /&gt;
&lt;br /&gt;
You should check multi-step transactions, as they are not inherently immune. Attackers can easily forge a series of requests by using multiple tags or possibly JavaScript.&lt;br /&gt;
&lt;br /&gt;
Note that session cookies, source IP addresses, and other information that is automatically sent by the browser doesn’t count since this information is also included in forged requests.&lt;br /&gt;
&lt;br /&gt;
OWASP’s [[CSRFTester | CSRF Tester]] tool can help generate test cases to demonstrate the dangers of CSRF flaws.&lt;br /&gt;
{{Top_10_2010:SubsectionAdvancedTemplate|type={{Top_10_2010:StyleTemplate}}|number=2|risk=5}}&lt;br /&gt;
Preventing CSRF requires the inclusion of an unpredictable token in the body or URL of each HTTP request. Such tokens should at a minimum be unique per user session, but can also be unique per request.&lt;br /&gt;
#The preferred option is to include the unique token in a hidden field. This causes the value to be sent in the body of the HTTP request, avoiding its inclusion in the URL, which is subject to exposure.&lt;br /&gt;
#The unique token can also be included in the URL itself, or a URL parameter. However, such placement runs the risk that the URL will be exposed to an attacker, thus compromising the secret token.&lt;br /&gt;
&lt;br /&gt;
OWASP’s [[CSRFGuard | CSRF Guard]] can be used to automatically include such tokens in your Java EE, .NET, or PHP application. OWASP’s [http://owasp-esapi-java.googlecode.com/svn/trunk_doc/latest/org/owasp/esapi/HTTPUtilities.html ESAPI] includes token generators and validators that developers can use to protect their transactions.&lt;br /&gt;
{{Top_10_2010:SubsectionAdvancedTemplate|type={{Top_10_2010:StyleTemplate}}|number=3|risk=5}}&lt;br /&gt;
The application allows a user to submit a state changing request that does not include anything secret. Like so:&lt;br /&gt;
{{Top_10_2010:ExampleBeginTemplate}}&amp;lt;nowiki&amp;gt;http://example.com/app/transferFunds?amount=1500&amp;amp;amp;destinationAccount=4673243243&amp;lt;/nowiki&amp;gt;{{Top_10_2010:ExampleEndTemplate}}&lt;br /&gt;
So, the attacker constructs a request that will transfer money from the victim’s account to their account, and then embeds this attack in an image request or iframe stored on various sites under the attacker’s control.&lt;br /&gt;
{{Top_10_2010:ExampleBeginTemplate}}&amp;lt;nowiki&amp;gt;&amp;amp;lt;img src=&amp;quot;http://example.com/app/transferFunds?amount=1500&amp;amp;destinationAccount=attackersAcct#&amp;quot; width=&amp;quot;0&amp;quot; height=&amp;quot;0&amp;quot; /&amp;amp;gt;&amp;lt;/nowiki&amp;gt;{{Top_10_2010:ExampleEndTemplate}}&lt;br /&gt;
If the victim visits any of these sites while already authenticated to example.com, any forged requests will include the user’s session info, inadvertently authorizing the request.&lt;br /&gt;
{{Top_10_2010:SubsectionAdvancedTemplate|type={{Top_10_2010:StyleTemplate}}|number=4|risk=5}}&lt;br /&gt;
{{Top_10_2010:SubSubsectionOWASPReferencesTemplate}}&lt;br /&gt;
*[[CSRF | OWASP CSRF Article]]&lt;br /&gt;
*[[Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet | OWASP CSRF Prevention Cheat Sheet]]&lt;br /&gt;
*[[CSRFGuard | OWASP CSRFGuard - CSRF Defense Tool]]&lt;br /&gt;
*[[ESAPI | ESAPI Project Home Page]]&lt;br /&gt;
*[http://owasp-esapi-java.googlecode.com/svn/trunk_doc/latest/org/owasp/esapi/HTTPUtilities.html ESAPI HTTPUtilities Class with AntiCSRF Tokens]&lt;br /&gt;
*[[Testing_for_CSRF_(OWASP-SM-005) | OWASP Testing Guide: Chapter on CSRF Testing]]&lt;br /&gt;
*[[CSRFTester | OWASP CSRFTester - CSRF Testing Tool]]&lt;br /&gt;
{{Top_10_2010:SubSubsectionExternalReferencesTemplate}}&lt;br /&gt;
*[http://cwe.mitre.org/data/definitions/352.html CWE Entry 352 on CSRF]&lt;br /&gt;
{{Top_10_2010:BottomAdvancedTemplate|type={{Top_10_2010:StyleTemplate}}|useprev=2010PrevLink|usenext=2010NextLink|prev=A4-Insecure Direct Object References|next=A6-Security Misconfiguration}}&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Top Ten Project]]&lt;/div&gt;</summary>
		<author><name>Jacob Robertson</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Top_10_2010-A5-Cross-Site_Request_Forgery_(CSRF)&amp;diff=112730</id>
		<title>Top 10 2010-A5-Cross-Site Request Forgery (CSRF)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Top_10_2010-A5-Cross-Site_Request_Forgery_(CSRF)&amp;diff=112730"/>
				<updated>2011-06-23T14:27:01Z</updated>
		
		<summary type="html">&lt;p&gt;Jacob Robertson: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Top_10_2010:TopTemplate|useprev=2010PrevLink|usenext=2010NextLink|prev=A4-Insecure Direct Object References|next=A6-Security Misconfiguration}}&lt;br /&gt;
&lt;br /&gt;
{{Top_10_2010:SummaryTableHeaderBeginTemplate}}&lt;br /&gt;
{{Top_10_2010:SummaryTableValue-2-Template|Exploitability|AVERAGE}}&lt;br /&gt;
{{Top_10_2010:SummaryTableValue-1-Template|Prevalence|WIDESPREAD}}&lt;br /&gt;
{{Top_10_2010:SummaryTableValue-1-Template|Detectability|EASY}}&lt;br /&gt;
{{Top_10_2010:SummaryTableValue-2-Template|Impact|MODERATE}}&lt;br /&gt;
{{Top_10_2010:SummaryTableHeaderEndTemplate}}&lt;br /&gt;
     &amp;lt;td {{Template:Top 10 2010:SummaryTableRowStyleTemplate}}&amp;gt;Consider anyone who can trick your users into submitting a request to your website. Any website or other HTML feed that your users access could do this.&amp;lt;/td&amp;gt;&lt;br /&gt;
     &amp;lt;td {{Template:Top 10 2010:SummaryTableRowStyleTemplate}}&amp;gt;Attacker creates forged HTTP requests and tricks a victim into submitting them via image tags, XSS, or numerous other techniques. If the &amp;lt;u&amp;gt;user is authenticated&amp;lt;/u&amp;gt;, the attack succeeds.&amp;lt;/td&amp;gt;&lt;br /&gt;
     &amp;lt;td colspan=2  {{Template:Top 10 2010:SummaryTableRowStyleTemplate}}&amp;gt;[[CSRF]] takes advantage of web applications that allow attackers to predict all the details of a particular action.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Since browsers send credentials like session cookies automatically, attackers can create malicious web pages which generate forged requests that are indistinguishable from legitimate ones.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Detection of CSRF flaws is fairly easy via penetration testing or code analysis.&amp;lt;/td&amp;gt;&lt;br /&gt;
     &amp;lt;td {{Template:Top 10 2010:SummaryTableRowStyleTemplate}}&amp;gt;Attackers can cause victims to change any data the victim is allowed to change or perform any function the victim is authorized to use&amp;lt;/td&amp;gt;&lt;br /&gt;
     &amp;lt;td {{Template:Top 10 2010:SummaryTableRowStyleTemplate}}&amp;gt;Consider the business value of the affected data or application functions. Imagine not being sure if users intended to take these actions.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Consider the impact to your reputation.&amp;lt;/td&amp;gt;&lt;br /&gt;
{{Top_10_2010:SummaryTableEndTemplate}}&lt;br /&gt;
&lt;br /&gt;
{{Top_10_2010:SubsectionAdvancedTemplate|type={{Top_10_2010:StyleTemplate}}|number=1|risk=5}}&lt;br /&gt;
The easiest way to check whether an application is vulnerable is to see if each link and form contains an unpredictable token for each user. Without such an unpredictable token, attackers can forge malicious requests. Focus on the links and forms that invoke state-changing functions, since those are the most important CSRF targets.&lt;br /&gt;
&lt;br /&gt;
You should check multi-step transactions, as they are not inherently immune. Attackers can easily forge a series of requests by using multiple tags or possibly JavaScript.&lt;br /&gt;
&lt;br /&gt;
Note that session cookies, source IP addresses, and other information that is automatically sent by the browser doesn’t count since this information is also included in forged requests.&lt;br /&gt;
&lt;br /&gt;
OWASP’s [[CSRFTester | CSRF Tester]] tool can help generate test cases to demonstrate the dangers of CSRF flaws.&lt;br /&gt;
{{Top_10_2010:SubsectionAdvancedTemplate|type={{Top_10_2010:StyleTemplate}}|number=2|risk=5}}&lt;br /&gt;
Preventing CSRF requires the inclusion of a unpredictable token in the body or URL of each HTTP request. Such tokens should at a minimum be unique per user session, but can also be unique per request.&lt;br /&gt;
#The preferred option is to include the unique token in a hidden field. This causes the value to be sent in the body of the HTTP request, avoiding its inclusion in the URL, which is subject to exposure.&lt;br /&gt;
#The unique token can also be included in the URL itself, or a URL parameter. However, such placement runs the risk that the URL will be exposed to an attacker, thus compromising the secret token.&lt;br /&gt;
&lt;br /&gt;
OWASP’s [[CSRFGuard | CSRF Guard]] can be used to automatically include such tokens in your Java EE, .NET, or PHP application. OWASP’s [http://owasp-esapi-java.googlecode.com/svn/trunk_doc/latest/org/owasp/esapi/HTTPUtilities.html ESAPI] includes token generators and validators that developers can use to protect their transactions.&lt;br /&gt;
{{Top_10_2010:SubsectionAdvancedTemplate|type={{Top_10_2010:StyleTemplate}}|number=3|risk=5}}&lt;br /&gt;
The application allows a user to submit a state changing request that does not include anything secret. Like so:&lt;br /&gt;
{{Top_10_2010:ExampleBeginTemplate}}&amp;lt;nowiki&amp;gt;http://example.com/app/transferFunds?amount=1500&amp;amp;amp;destinationAccount=4673243243&amp;lt;/nowiki&amp;gt;{{Top_10_2010:ExampleEndTemplate}}&lt;br /&gt;
So, the attacker constructs a request that will transfer money from the victim’s account to their account, and then embeds this attack in an image request or iframe stored on various sites under the attacker’s control.&lt;br /&gt;
{{Top_10_2010:ExampleBeginTemplate}}&amp;lt;nowiki&amp;gt;&amp;amp;lt;img src=&amp;quot;http://example.com/app/transferFunds?amount=1500&amp;amp;destinationAccount=attackersAcct#&amp;quot; width=&amp;quot;0&amp;quot; height=&amp;quot;0&amp;quot; /&amp;amp;gt;&amp;lt;/nowiki&amp;gt;{{Top_10_2010:ExampleEndTemplate}}&lt;br /&gt;
If the victim visits any of these sites while already authenticated to example.com, any forged requests will include the user’s session info, inadvertently authorizing the request.&lt;br /&gt;
{{Top_10_2010:SubsectionAdvancedTemplate|type={{Top_10_2010:StyleTemplate}}|number=4|risk=5}}&lt;br /&gt;
{{Top_10_2010:SubSubsectionOWASPReferencesTemplate}}&lt;br /&gt;
*[[CSRF | OWASP CSRF Article]]&lt;br /&gt;
*[[Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet | OWASP CSRF Prevention Cheat Sheet]]&lt;br /&gt;
*[[CSRFGuard | OWASP CSRFGuard - CSRF Defense Tool]]&lt;br /&gt;
*[[ESAPI | ESAPI Project Home Page]]&lt;br /&gt;
*[http://owasp-esapi-java.googlecode.com/svn/trunk_doc/latest/org/owasp/esapi/HTTPUtilities.html ESAPI HTTPUtilities Class with AntiCSRF Tokens]&lt;br /&gt;
*[[Testing_for_CSRF_(OWASP-SM-005) | OWASP Testing Guide: Chapter on CSRF Testing]]&lt;br /&gt;
*[[CSRFTester | OWASP CSRFTester - CSRF Testing Tool]]&lt;br /&gt;
{{Top_10_2010:SubSubsectionExternalReferencesTemplate}}&lt;br /&gt;
*[http://cwe.mitre.org/data/definitions/352.html CWE Entry 352 on CSRF]&lt;br /&gt;
{{Top_10_2010:BottomAdvancedTemplate|type={{Top_10_2010:StyleTemplate}}|useprev=2010PrevLink|usenext=2010NextLink|prev=A4-Insecure Direct Object References|next=A6-Security Misconfiguration}}&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Top Ten Project]]&lt;/div&gt;</summary>
		<author><name>Jacob Robertson</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Top_10_2010-A1-Injection&amp;diff=112122</id>
		<title>Top 10 2010-A1-Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Top_10_2010-A1-Injection&amp;diff=112122"/>
				<updated>2011-06-14T13:19:09Z</updated>
		
		<summary type="html">&lt;p&gt;Jacob Robertson: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Top_10_2010:TopTemplate|usenext=2010NextLink|next=A2-Cross-Site Scripting (XSS)|useprev=2010PrevLink|prev=Main}}&lt;br /&gt;
&lt;br /&gt;
{{Top_10_2010:SummaryTableHeaderBeginTemplate}}&lt;br /&gt;
{{Top_10_2010:SummaryTableValue-1-Template|Exploitability|EASY}}&lt;br /&gt;
{{Top_10_2010:SummaryTableValue-2-Template|Prevalence|COMMON}}&lt;br /&gt;
{{Top_10_2010:SummaryTableValue-2-Template|Detectability|AVERAGE}}&lt;br /&gt;
{{Top_10_2010:SummaryTableValue-1-Template|Impact|SEVERE}}&lt;br /&gt;
{{Top_10_2010:SummaryTableHeaderEndTemplate}}&lt;br /&gt;
     &amp;lt;td {{Template:Top 10 2010:SummaryTableRowStyleTemplate}}&amp;gt;Consider anyone who can send untrusted data to the system, including external users, internal users, and administrators.&amp;lt;/td&amp;gt;&lt;br /&gt;
     &amp;lt;td {{Template:Top 10 2010:SummaryTableRowStyleTemplate}}&amp;gt;Attacker sends simple text-based attacks that exploit the syntax of the targeted interpreter. Almost any source of data can be an injection vector, including internal sources&amp;lt;/td&amp;gt;&lt;br /&gt;
     &amp;lt;td colspan=2  {{Template:Top 10 2010:SummaryTableRowStyleTemplate}}&amp;gt;Injection flaws occur when an application sends untrusted data to an interpreter. Injection flaws are very prevalent, particularly in legacy code, often found in SQL queries, LDAP queries, XPath queries, OS commands, program arguments, etc. Injection flaws are easy to discover when examining code, but more difficult via testing. Scanners and fuzzers can help attackers find them.&amp;lt;/td&amp;gt;&lt;br /&gt;
     &amp;lt;td {{Template:Top 10 2010:SummaryTableRowStyleTemplate}}&amp;gt;Injection can result in data loss or corruption, lack of accountability, or denial of access. Injection can sometimes lead to complete host takeover.&amp;lt;/td&amp;gt;&lt;br /&gt;
     &amp;lt;td {{Template:Top 10 2010:SummaryTableRowStyleTemplate}}&amp;gt;Consider the business value of the affected data and the platform running the interpreter. All data could be stolen, modified, or deleted. Could your reputation be harmed?&amp;lt;/td&amp;gt;&lt;br /&gt;
{{Top_10_2010:SummaryTableEndTemplate}}&lt;br /&gt;
&lt;br /&gt;
{{Top_10_2010:SubsectionAdvancedTemplate|type={{Top_10_2010:StyleTemplate}}|number=1|risk=1}}&lt;br /&gt;
The best way to find out if an application is vulnerable to injection is to verify that all use of interpreters clearly separates untrusted data from the command or query. For SQL calls, this means using bind variables in all prepared statements and stored procedures, and avoiding dynamic queries.&lt;br /&gt;
&lt;br /&gt;
Checking the code is a fast and accurate way to see if the application uses interpreters safely. Code analysis tools can help a security analyst find the use of interpreters and trace the data flow through the application. Manual penetration testers can confirm these issues by crafting exploits that confirm the vulnerability.&lt;br /&gt;
&lt;br /&gt;
Automated dynamic scanning which exercises the application may provide insight into whether some exploitable injection problems exist. Scanners cannot always reach interpreters and can have difficulty detecting whether an attack was successful.&lt;br /&gt;
{{Top_10_2010:SubsectionAdvancedTemplate|type={{Top_10_2010:StyleTemplate}}|number=2|risk=1}}&lt;br /&gt;
Preventing injection requires keeping untrusted data separate from commands and queries.&lt;br /&gt;
&lt;br /&gt;
#The preferred option is to use a safe API which avoids the use of the interpreter entirely or provides a parameterized interface. Beware of APIs, such as stored procedures, that appear parameterized, but may still allow injection under the hood.&lt;br /&gt;
#If a parameterized API is not available, you should carefully escape special characters using the specific escape syntax for that interpreter. [[ESAPI | OWASP's ESAPI]] has some of these [http://owasp-esapi-java.googlecode.com/svn/trunk_doc/latest/org/owasp/esapi/Encoder.html escaping routines].&lt;br /&gt;
#Positive or &amp;quot;whitelist&amp;quot; input validation with appropriate canonicalization also helps protect against injection, but is '''not''' a complete defense as many applications require special characters in their input. [[ESAPI | OWASP's ESAPI]] has an extensible library of [http://owasp-esapi-java.googlecode.com/svn/trunk_doc/latest/org/owasp/esapi/Validator.html white list input validation routines].&lt;br /&gt;
{{Top_10_2010:SubsectionAdvancedTemplate|type={{Top_10_2010:StyleTemplate}}|number=3|risk=1}}&lt;br /&gt;
The application uses untrusted data in the construction of the following vulnerable SQL call:&lt;br /&gt;
{{Top_10_2010:ExampleBeginTemplate}}&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;String query = &amp;quot;SELECT * FROM accounts WHERE custID='&amp;quot; + request.getParameter(&amp;quot;id&amp;quot;) +&amp;quot;'&amp;quot;;&amp;lt;/span&amp;gt;{{Top_10_2010:ExampleEndTemplate}}&lt;br /&gt;
The attacker modifies the 'id' parameter in their browser to send: ' or '1'='1. This changes the meaning of the query to return all the records from the accounts database, instead of only the intended customer's.&lt;br /&gt;
{{Top_10_2010:ExampleBeginTemplate}}&amp;lt;nowiki&amp;gt;http://example.com/app/accountView?id=&amp;lt;/nowiki&amp;gt;&amp;lt;span style=&amp;quot;color: red;&amp;quot;&amp;gt;' or '1'='1&amp;lt;/span&amp;gt;{{Top_10_2010:ExampleEndTemplate}}&lt;br /&gt;
In the worst case, the attacker uses this weakness to invoke special stored procedures in the database, allowing a complete takeover of the database host.&lt;br /&gt;
{{Top_10_2010:SubsectionAdvancedTemplate|type={{Top_10_2010:StyleTemplate}}|number=4|risk=1}}&lt;br /&gt;
{{Top_10_2010:SubSubsectionOWASPReferencesTemplate}}&lt;br /&gt;
* [[SQL_Injection_Prevention_Cheat_Sheet | OWASP SQL Injection Prevention Cheat Sheet]]&lt;br /&gt;
* [[Command_Injection | OWASP Injection Flaws Article]]&lt;br /&gt;
* [http://owasp-esapi-java.googlecode.com/svn/trunk_doc/latest/org/owasp/esapi/Encoder.html ESAPI Encoder API]&lt;br /&gt;
* [http://owasp-esapi-java.googlecode.com/svn/trunk_doc/latest/org/owasp/esapi/Validator.html ESAPI Input Validation API]&lt;br /&gt;
* [http://www.owasp.org/index.php/ASVS#tab=Downloads ASVS: Output Encoding/Escaping Requirements (V6)]&lt;br /&gt;
* [[Testing_for_SQL_Injection_(OWASP-DV-005) | OWASP Testing Guide: Chapter on SQL Injection Testing]]&lt;br /&gt;
* [[Reviewing_Code_for_SQL_Injection | OWASP Code Review Guide: Chapter on SQL Injection]]&lt;br /&gt;
* [[Reviewing_Code_for_OS_Injection | OWASP Code Review Guide: Command Injection]]&lt;br /&gt;
{{Top_10_2010:SubSubsectionExternalReferencesTemplate}}&lt;br /&gt;
* [http://cwe.mitre.org/data/definitions/77.html CWE Entry 77 on Command Injection]&lt;br /&gt;
* [http://cwe.mitre.org/data/definitions/89.html CWE Entry 89 on SQL Injection]&lt;br /&gt;
{{Top_10_2010:BottomAdvancedTemplate|type={{Top_10_2010:StyleTemplate}}|usenext=2010NextLink|next=A2-Cross-Site Scripting (XSS)|useprev=2010PrevLink|prev=Main}}&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Top Ten Project]]&lt;/div&gt;</summary>
		<author><name>Jacob Robertson</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Top_10_2010-A1-Injection&amp;diff=112121</id>
		<title>Top 10 2010-A1-Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Top_10_2010-A1-Injection&amp;diff=112121"/>
				<updated>2011-06-14T13:17:46Z</updated>
		
		<summary type="html">&lt;p&gt;Jacob Robertson: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Top_10_2010:TopTemplate|usenext=2010NextLink|next=A2-Cross-Site Scripting (XSS)|useprev=2010PrevLink|prev=Main}}&lt;br /&gt;
&lt;br /&gt;
{{Top_10_2010:SummaryTableHeaderBeginTemplate}}&lt;br /&gt;
{{Top_10_2010:SummaryTableValue-1-Template|Exploitability|EASY}}&lt;br /&gt;
{{Top_10_2010:SummaryTableValue-2-Template|Prevalence|COMMON}}&lt;br /&gt;
{{Top_10_2010:SummaryTableValue-2-Template|Detectability|AVERAGE}}&lt;br /&gt;
{{Top_10_2010:SummaryTableValue-1-Template|Impact|SEVERE}}&lt;br /&gt;
{{Top_10_2010:SummaryTableHeaderEndTemplate}}&lt;br /&gt;
     &amp;lt;td {{Template:Top 10 2010:SummaryTableRowStyleTemplate}}&amp;gt;Consider anyone who can send untrusted data to the system, including external users, internal users, and administrators.&amp;lt;/td&amp;gt;&lt;br /&gt;
     &amp;lt;td {{Template:Top 10 2010:SummaryTableRowStyleTemplate}}&amp;gt;Attacker sends simple text-based attacks that exploit the syntax of the targeted interpreter. Almost any source of data can be an injection vector, including internal sources&amp;lt;/td&amp;gt;&lt;br /&gt;
     &amp;lt;td colspan=2  {{Template:Top 10 2010:SummaryTableRowStyleTemplate}}&amp;gt;Injection flaws occur when an application sends untrusted data to an interpreter. Injection flaws are very prevalent, particularly in legacy code, often found in SQL queries, LDAP queries, XPath queries, OS commands, program arguments, etc. Injection flaws are easy to discover when examining code, but more difficult via testing. Scanners and fuzzers can help attackers find them.&amp;lt;/td&amp;gt;&lt;br /&gt;
     &amp;lt;td {{Template:Top 10 2010:SummaryTableRowStyleTemplate}}&amp;gt;Injection can result in data loss or corruption, lack of accountability, or denial of access. Injection can sometimes lead to complete host takeover.&amp;lt;/td&amp;gt;&lt;br /&gt;
     &amp;lt;td {{Template:Top 10 2010:SummaryTableRowStyleTemplate}}&amp;gt;Consider the business value of the affected data and the platform running the interpreter. All data could be stolen, modified, or deleted. Could your reputation be harmed?&amp;lt;/td&amp;gt;&lt;br /&gt;
{{Top_10_2010:SummaryTableEndTemplate}}&lt;br /&gt;
&lt;br /&gt;
{{Top_10_2010:SubsectionAdvancedTemplate|type={{Top_10_2010:StyleTemplate}}|number=1|risk=1}}&lt;br /&gt;
The best way to find out if an application is vulnerable to injection is to verify that all use of interpreters clearly separates untrusted data from the command or query. For SQL calls, this means using bind variables in all prepared statements and stored procedures, and avoiding dynamic queries.&lt;br /&gt;
&lt;br /&gt;
Checking the code is a fast and accurate way to see if the application uses interpreters safely. Code analysis tools can help a security analyst find the use of interpreters and trace the data flow through the application. Manual penetration testers can confirm these issues by crafting exploits that confirm the vulnerability.&lt;br /&gt;
&lt;br /&gt;
Automated dynamic scanning which exercises the application may provide insight into whether some exploitable injection problems exist. Scanners cannot always reach interpreters and can have difficulty detecting whether an attack was successful.&lt;br /&gt;
{{Top_10_2010:SubsectionAdvancedTemplate|type={{Top_10_2010:StyleTemplate}}|number=2|risk=1}}&lt;br /&gt;
Preventing injection requires keeping untrusted data separate from commands and queries.&lt;br /&gt;
&lt;br /&gt;
#The preferred option is to use a safe API which avoids the use of the interpreter entirely or provides a parameterized interface. Beware of APIs, such as stored procedures, that appear parameterized, but may still allow injection under the hood.&lt;br /&gt;
#If a parameterized API is not available, you should carefully escape special characters using the specific escape syntax for that interpreter. [[ESAPI | OWASP's ESAPI]] has some of these [http://owasp-esapi-java.googlecode.com/svn/trunk_doc/latest/org/owasp/esapi/Encoder.html escaping routines].&lt;br /&gt;
#Positive or &amp;quot;whitelist&amp;quot; input validation with appropriate canonicalization also helps protect against injection, but is '''not''' a complete defense as many applications require special characters in their input. [[ESAPI | OWASP's ESAPI]] has an extensible library of [http://owasp-esapi-java.googlecode.com/svn/trunk_doc/latest/org/owasp/esapi/Validator.html white list input validation routines].&lt;br /&gt;
{{Top_10_2010:SubsectionAdvancedTemplate|type={{Top_10_2010:StyleTemplate}}|number=3|risk=1}}&lt;br /&gt;
The application uses untrusted data in the construction of the following vulnerable SQL call:&lt;br /&gt;
{{Top_10_2010:ExampleBeginTemplate}}&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;String query = &amp;quot;SELECT * FROM accounts WHERE custID='&amp;quot; + request.getParameter(&amp;quot;id&amp;quot;) +&amp;quot;'&amp;quot;;&amp;lt;/span&amp;gt;{{Top_10_2010:ExampleEndTemplate}}&lt;br /&gt;
The attacker modifies the 'id' parameter in their browser to send: ' or '1'='1. This changes the meaning of the query to return all the records from the accounts database, instead of only the intended customer's.&lt;br /&gt;
{{Top_10_2010:ExampleBeginTemplate}}&amp;lt;nowiki&amp;gt;http://example.com/app/accountView?id='&amp;lt;/nowiki&amp;gt; or &amp;lt;span style=&amp;quot;color: red;&amp;quot;&amp;gt;'1'='1&amp;lt;/span&amp;gt;{{Top_10_2010:ExampleEndTemplate}}&lt;br /&gt;
In the worst case, the attacker uses this weakness to invoke special stored procedures in the database, allowing a complete takeover of the database host.&lt;br /&gt;
{{Top_10_2010:SubsectionAdvancedTemplate|type={{Top_10_2010:StyleTemplate}}|number=4|risk=1}}&lt;br /&gt;
{{Top_10_2010:SubSubsectionOWASPReferencesTemplate}}&lt;br /&gt;
* [[SQL_Injection_Prevention_Cheat_Sheet | OWASP SQL Injection Prevention Cheat Sheet]]&lt;br /&gt;
* [[Command_Injection | OWASP Injection Flaws Article]]&lt;br /&gt;
* [http://owasp-esapi-java.googlecode.com/svn/trunk_doc/latest/org/owasp/esapi/Encoder.html ESAPI Encoder API]&lt;br /&gt;
* [http://owasp-esapi-java.googlecode.com/svn/trunk_doc/latest/org/owasp/esapi/Validator.html ESAPI Input Validation API]&lt;br /&gt;
* [http://www.owasp.org/index.php/ASVS#tab=Downloads ASVS: Output Encoding/Escaping Requirements (V6)]&lt;br /&gt;
* [[Testing_for_SQL_Injection_(OWASP-DV-005) | OWASP Testing Guide: Chapter on SQL Injection Testing]]&lt;br /&gt;
* [[Reviewing_Code_for_SQL_Injection | OWASP Code Review Guide: Chapter on SQL Injection]]&lt;br /&gt;
* [[Reviewing_Code_for_OS_Injection | OWASP Code Review Guide: Command Injection]]&lt;br /&gt;
{{Top_10_2010:SubSubsectionExternalReferencesTemplate}}&lt;br /&gt;
* [http://cwe.mitre.org/data/definitions/77.html CWE Entry 77 on Command Injection]&lt;br /&gt;
* [http://cwe.mitre.org/data/definitions/89.html CWE Entry 89 on SQL Injection]&lt;br /&gt;
{{Top_10_2010:BottomAdvancedTemplate|type={{Top_10_2010:StyleTemplate}}|usenext=2010NextLink|next=A2-Cross-Site Scripting (XSS)|useprev=2010PrevLink|prev=Main}}&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Top Ten Project]]&lt;/div&gt;</summary>
		<author><name>Jacob Robertson</name></author>	</entry>

	</feed>