<?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=Runestone</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=Runestone"/>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php/Special:Contributions/Runestone"/>
		<updated>2026-04-30T08:58:15Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.2</generator>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Talk:Testing_for_DOM-based_Cross_site_scripting_(OTG-CLIENT-001)&amp;diff=52454</id>
		<title>Talk:Testing for DOM-based Cross site scripting (OTG-CLIENT-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Talk:Testing_for_DOM-based_Cross_site_scripting_(OTG-CLIENT-001)&amp;diff=52454"/>
				<updated>2009-01-30T13:35:42Z</updated>
		
		<summary type="html">&lt;p&gt;Runestone: New page: I've now tried this PoC code local and remotely without any receiving any alert box: &amp;lt;pre&amp;gt; &amp;lt;script&amp;gt; document.write(&amp;quot;Site is at: &amp;quot; + document.location.href + &amp;quot;.&amp;quot;); &amp;lt;/script&amp;gt; &amp;lt;/pre&amp;gt; I've tes...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I've now tried this PoC code local and remotely without any receiving any alert box:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
document.write(&amp;quot;Site is at: &amp;quot; + document.location.href + &amp;quot;.&amp;quot;);&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
I've tested this in both FF3, IE7 and IE5. Can anyone explain why this simple PoC won't work?&lt;/div&gt;</summary>
		<author><name>Runestone</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_IMAP/SMTP_Injection_(OTG-INPVAL-011)&amp;diff=52422</id>
		<title>Testing for IMAP/SMTP Injection (OTG-INPVAL-011)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_IMAP/SMTP_Injection_(OTG-INPVAL-011)&amp;diff=52422"/>
				<updated>2009-01-30T09:38:00Z</updated>
		
		<summary type="html">&lt;p&gt;Runestone: correcting typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
This threat affects all applications that communicate with mail servers (IMAP/SMTP), generally webmail applications. The aim of this test is to verify the capacity to inject arbitrary IMAP/SMTP commands into the mail servers, due to input data not properly sanitized.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Description of the Issue==&lt;br /&gt;
The IMAP/SMTP Injection technique is more effective if the mail server is not directly accessible from Internet. Where full communication with the backend mail server is possible, it is recommended to make a direct testing.&lt;br /&gt;
&lt;br /&gt;
An IMAP/SMTP Injection makes it possible to access a mail server which otherwise would not be directly accessible from the Internet. In some cases, these internal systems do not have the same level of infrastructure security and hardening that is applied to the front-end web servers. Therefore, mail server results may be more vulnerable to attacks by end users (see the scheme presented in Figure 1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[Image:imap-smtp-injection.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
Figure 1 - Communication with the mail servers using the IMAP/SMTP Injection technique.&amp;lt;/center&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Figure 1 depicts the flow of traffic generally seen when using webmail technologies. Step 1 and 2 is the user interacting with the webmail client, whereas step 2 is the tester bypassing the webmail client and interacting with the back-end mail servers directly. &lt;br /&gt;
&lt;br /&gt;
This technique allows a wide variety of actions and attacks. The possibilities depend on the type and scope of injection and the mail server technology being tested. &lt;br /&gt;
&lt;br /&gt;
Some examples of attacks using the IMAP/SMTP Injection technique are:&lt;br /&gt;
* Exploitation of vulnerabilities in the IMAP/SMTP protocol&lt;br /&gt;
* Application restrictions evasion&lt;br /&gt;
* Anti-automation process evasion&lt;br /&gt;
* Information leaks&lt;br /&gt;
* Relay/SPAM&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
The standard attack patterns are:&lt;br /&gt;
* Identifying vulnerable parameters&lt;br /&gt;
* Understanding the data flow and deployment structure of the client&lt;br /&gt;
* IMAP/SMTP command injection&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Identifying vulnerable parameters'''&lt;br /&gt;
----&lt;br /&gt;
In order to detect vulnerable parameters, the tester has to analyze the application's ability in handling input. Input validation testing requires the tester to send bogus, or malicious, requests to the server and analyse the response. In a secure application, the response should be an error with some corresponding action telling the client that something has gone wrong. In a vulnerable application, the malicious request may be processed by the back-end application that will answer with a &amp;quot;HTTP 200 OK&amp;quot; response message.&lt;br /&gt;
&lt;br /&gt;
It is important to note that the requests being sent should match the technology being tested. Sending SQL injection strings for Microsoft SQL server when a MySQL server is being used will result in false positive responses. In this case, sending malicious IMAP commands is modus operandi since IMAP is the underlying protocol being tested.   &lt;br /&gt;
&lt;br /&gt;
IMAP special parameters that should be used are:&lt;br /&gt;
{| border=1&lt;br /&gt;
 || '''On the IMAP server''' || '''On the SMTP server'''&lt;br /&gt;
|-&lt;br /&gt;
 || Authentication || Emissor e-mail &lt;br /&gt;
|-&lt;br /&gt;
 || operations with mail boxes (list, read, create, delete, rename) || Destination e-mail&lt;br /&gt;
|-&lt;br /&gt;
 || operations with messages (read, copy, move, delete) || Subject&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
 || Disconnection || Message body&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
 ||  || Attached files&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
In this example, the &amp;quot;mailbox&amp;quot; parameter is being tested by manipulating all requests with the parameter in:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://&amp;lt;webmail&amp;gt;/src/read_body.php?mailbox=INBOX&amp;amp;passed_id=46106&amp;amp;startMessage=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The following examples can be used.&lt;br /&gt;
* Assign a null value to the parameter:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://&amp;lt;webmail&amp;gt;/src/read_body.php?mailbox=&amp;amp;passed_id=46106&amp;amp;startMessage=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Substitute the value with a random value:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://&amp;lt;webmail&amp;gt;/src/read_body.php?mailbox=NOTEXIST&amp;amp;passed_id=46106&amp;amp;startMessage=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Add other values to the parameter:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://&amp;lt;webmail&amp;gt;/src/read_body.php?mailbox=INBOX PARAMETER2&amp;amp;passed_id=46106&amp;amp;startMessage=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Add non standard special characters (i.e.: \, ', &amp;quot;, @, #, !, |):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://&amp;lt;webmail&amp;gt;/src/read_body.php?mailbox=INBOX&amp;quot;&amp;amp;passed_id=46106&amp;amp;startMessage=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Eliminate the parameter:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://&amp;lt;webmail&amp;gt;/src/read_body.php?passed_id=46106&amp;amp;startMessage=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final result of the above testing gives the tester three possible situations: &amp;lt;br&amp;gt;&lt;br /&gt;
S1 - The application returns a error code/message &amp;lt;br&amp;gt;&lt;br /&gt;
S2 - The application does not return an error code/message, but it does not realize the requested operation &amp;lt;br&amp;gt;&lt;br /&gt;
S3 - The application does not return an error code/message and realizes the operation requested normally &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Situations S1 and S2 represent successful IMAP/SMTP injection.&lt;br /&gt;
&lt;br /&gt;
An attacker's aim is receiving the S1 response, as it is an indicator that the application is vulnerable to injection and further manipulation.&lt;br /&gt;
&lt;br /&gt;
Let's suppose that a user retrieves the email headers using the following HTTP request:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://&amp;lt;webmail&amp;gt;/src/view_header.php?mailbox=INBOX&amp;amp;passed_id=46105&amp;amp;passed_ent_id=0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An attacker might modify the value of the parameter INBOX by injecting the character &amp;quot; (%22 using URL encoding):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://&amp;lt;webmail&amp;gt;/src/view_header.php?mailbox=INBOX%22&amp;amp;passed_id=46105&amp;amp;passed_ent_id=0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, the application answer may be:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ERROR: Bad or malformed request.&lt;br /&gt;
Query: SELECT &amp;quot;INBOX&amp;quot;&amp;quot;&lt;br /&gt;
Server responded: Unexpected extra arguments to Select&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The situation S2 is harder to test successfully. The tester needs to use blind command injection in order to determine if the server is vulnerable.&lt;br /&gt;
&lt;br /&gt;
On the other hand, the last situation (S3) is not revelant in this paragraph.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
* List of vulnerable parameters &lt;br /&gt;
* Affected functionality &lt;br /&gt;
* Type of possible injection (IMAP/SMTP) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Understanding the data flow and deployment structure of the client'''&lt;br /&gt;
----&lt;br /&gt;
After identifying all vulnerable parameters (for example, &amp;quot;passed_id&amp;quot;), the tester needs to determine what level of injection is possible and then design a testing plan to further exploit the application.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this test case, we have detected that the application's &amp;quot;passed_id&amp;quot; parameter is vulnerable and is used in the following request:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://&amp;lt;webmail&amp;gt;/src/read_body.php?mailbox=INBOX&amp;amp;passed_id=46225&amp;amp;startMessage=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the following test case (providing an alphabetical value when a numerical value is required):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://&amp;lt;webmail&amp;gt;/src/read_body.php?mailbox=INBOX&amp;amp;passed_id=test&amp;amp;startMessage=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will generate the following error message:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ERROR : Bad or malformed request.&lt;br /&gt;
Query: FETCH test:test BODY[HEADER]&lt;br /&gt;
Server responded: Error in IMAP command received by server.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this example, the error message returned the name of the executed command and the corresponding parameters.&lt;br /&gt;
&lt;br /&gt;
In other situations, the error message (&amp;quot;not controlled&amp;quot; by the application) contains the name of the executed command, but reading the suitable RFC (see &amp;quot;Reference&amp;quot; paragraph) allows the tester to understand what other possible commands can be executed.&lt;br /&gt;
&lt;br /&gt;
If the application does not return descriptive error messages, the tester needs to analyze the affected functionality to deduce all the possible commands (and parameters) associated with the above mentioned functionality. For example, if a vulnerable parameter has been detected in the create  mailbox functionality, it is logical to assume that the affected IMAP command is &amp;quot;CREATE&amp;quot;. According to the RFC, the CREATE command accepts one parameter which specifies the name of the mailbox to create.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
* List of IMAP/SMTP commands affected &lt;br /&gt;
* Type, value, and number of parameters expected by the affected IMAP/SMTP commands&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''IMAP/SMTP command injection'''&lt;br /&gt;
----&lt;br /&gt;
Once the tester has identified vulnerable parameters and has analyzed the context in which they are executed, the next stage is exploiting the functionality.&lt;br /&gt;
&lt;br /&gt;
This stage has two possible outcomes:&amp;lt;br&amp;gt;&lt;br /&gt;
1. The injection is possible in an unauthenticated state: the affected functionality does not require the user to be authenticated. The injected (IMAP) commands available are limited to: CAPABILITY, NOOP, AUTHENTICATE, LOGIN, and LOGOUT.&amp;lt;br&amp;gt; &lt;br /&gt;
2. The injection is only possible in an authenticated state: the successful exploitation requires the user to be fully authenticated before testing can continue.&lt;br /&gt;
&lt;br /&gt;
In any case, the typical structure of an IMAP/SMTP Injection is as follows:&lt;br /&gt;
* Header: ending of the expected command;&lt;br /&gt;
* Body: injection of the new command;&lt;br /&gt;
* Footer: beginning of the expected command.&lt;br /&gt;
&lt;br /&gt;
It is important to remember that, in order to execute an IMAP/SMTP command, the previous command must be terminated with the CRLF (%0d%0a) sequence. &lt;br /&gt;
Let's suppose that in the stage 1 (&amp;quot;Identifying vulnerable parameters&amp;quot;), the attacker detects that the parameter &amp;quot;message_id&amp;quot; in the following request is vulnerable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://&amp;lt;webmail&amp;gt;/read_email.php?message_id=4791&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let's suppose also that the outcome of the analysis performed in the stage 2 (&amp;quot;Understanding the data flow and deployment structure of the client&amp;quot;) has identified the command and arguments associated with this parameter as:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FETCH 4791 BODY[HEADER]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this scenario, the IMAP injection structure would be:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://&amp;lt;webmail&amp;gt;/read_email.php?message_id=4791 BODY[HEADER]%0d%0aV100 CAPABILITY%0d%0aV101 FETCH 4791&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which would generate the following commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
???? FETCH 4791 BODY[HEADER]&lt;br /&gt;
V100 CAPABILITY&lt;br /&gt;
V101 FETCH 4791 BODY[HEADER]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Header = 4791 BODY[HEADER]&lt;br /&gt;
Body   = %0d%0aV100 CAPABILITY%0d%0a&lt;br /&gt;
Footer = V101 FETCH 4791 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Result Expected:'''&amp;lt;br&amp;gt;&lt;br /&gt;
* Arbitrary IMAP/SMTP command injection&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* RFC 0821 “Simple Mail Transfer Protocol”.&lt;br /&gt;
* RFC 3501 “Internet Message Access Protocol - Version 4rev1”.&lt;br /&gt;
* Vicente Aguilera Díaz: “MX Injection: Capturing and Exploiting Hidden Mail Servers&amp;quot; - &amp;lt;u&amp;gt;http://www.webappsec.org/projects/articles/121106.pdf&amp;lt;/u&amp;gt;&lt;/div&gt;</summary>
		<author><name>Runestone</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_XPath_Injection_(OTG-INPVAL-010)&amp;diff=52419</id>
		<title>Testing for XPath Injection (OTG-INPVAL-010)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_XPath_Injection_(OTG-INPVAL-010)&amp;diff=52419"/>
				<updated>2009-01-30T09:10:16Z</updated>
		
		<summary type="html">&lt;p&gt;Runestone: removed a break == cosmetic change&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v3}}&lt;br /&gt;
&lt;br /&gt;
== Brief Summary ==&lt;br /&gt;
XPath is a language that has been designed and developed primarily to address parts of an XML document. In [[XPATH Injection|XPath injection]] testing, we test if it is possible to inject data into an application so that it executes user-controlled XPath queries. When successfully exploited, this vulnerability may allow an attacker to bypass authentication mechanisms or access information without proper authorization.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Short Description of the Issue == &lt;br /&gt;
Web applications heavily use databases to store and access the data they need for their operations. Historically, relational databases have been by far the most common technology for data storage, but, in the last years, we are witnessing an increasing popularity for databases that organize data using the XML language. Just like relational databases are accessed via SQL language, XML databases use XPath as their standard query language. Since, from a conceptual point of view, XPath is very similar to SQL in its purpose and applications, an interesting result is that XPath injection attacks follow the same logic as [[SQL Injection]] attacks. In some aspects, XPath is even more powerful than standard SQL, as its whole power is already present in its specifications, whereas a large number of the techniques that can be used in a SQL Injection attack depend on the characteristics of the SQL dialect used by the target database. This means that XPath injection attacks can be much more adaptable and ubiquitous. Another advantage of an XPath injection attack is that, unlike SQL, no ACLs are enforced, as our query can access every part of the XML document.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Black Box testing and example ==&lt;br /&gt;
The XPath attack pattern was first published by Amit Klein [1] and is very similar to the usual SQL Injection. In order to get a first grasp of the problem, let's imagine a login page that manages the authentication to an application in which the user must enter his/her username and password. Let's assume that our database is represented by the following XML file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;ISO-8859-1&amp;quot;?&amp;gt; &lt;br /&gt;
&amp;lt;users&amp;gt; &lt;br /&gt;
&amp;lt;user&amp;gt; &lt;br /&gt;
&amp;lt;username&amp;gt;gandalf&amp;lt;/username&amp;gt; &lt;br /&gt;
&amp;lt;password&amp;gt;!c3&amp;lt;/password&amp;gt; &lt;br /&gt;
&amp;lt;account&amp;gt;admin&amp;lt;/account&amp;gt; &lt;br /&gt;
&amp;lt;/user&amp;gt; &lt;br /&gt;
&amp;lt;user&amp;gt; &lt;br /&gt;
&amp;lt;username&amp;gt;Stefan0&amp;lt;/username&amp;gt; &lt;br /&gt;
&amp;lt;password&amp;gt;w1s3c&amp;lt;/password&amp;gt; &lt;br /&gt;
&amp;lt;account&amp;gt;guest&amp;lt;/account&amp;gt; &lt;br /&gt;
&amp;lt;/user&amp;gt; &lt;br /&gt;
&amp;lt;user&amp;gt; &lt;br /&gt;
&amp;lt;username&amp;gt;tony&amp;lt;/username&amp;gt; &lt;br /&gt;
&amp;lt;password&amp;gt;Un6R34kb!e&amp;lt;/password&amp;gt; &lt;br /&gt;
&amp;lt;account&amp;gt;guest&amp;lt;/account&amp;gt; &lt;br /&gt;
&amp;lt;/user&amp;gt; &lt;br /&gt;
&amp;lt;/users&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
An XPath query that returns the account whose username is &amp;quot;gandalf&amp;quot; and the password is &amp;quot;!c3&amp;quot; would be the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string(//user[username/text()='gandalf' and password/text()='!c3']/account/text()) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the application does not properly filter user input, the tester will be able to inject XPath code and interfere with the query result. For instance, the tester could input the following values:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: ' or '1' = '1 &lt;br /&gt;
Password: ' or '1' = '1 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Looks quite familiar, doesn't it? &lt;br /&gt;
Using these parameters, the query becomes: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string(//user[username/text()='' or '1' = '1' and password/text()='' or '1' = '1']/account/text()) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
As in a common SQL Injection attack, we have created a query that always evaluates to true, which means that the application will authenticate the user even if a username or a password have not been provided.&lt;br /&gt;
&lt;br /&gt;
And as in a common SQL Injection attack, with XPath injection, the first step is to insert a single quote (') in the field to be tested, introducing a syntax error in the query, and to check whether the application returns an error message. &lt;br /&gt;
&lt;br /&gt;
If there is no knowledge about the XML data internal details and if the application does not provide useful error messages that help us reconstruct its internal logic, it is possible to perform a [[Blind XPath Injection]] attack, whose goal is to reconstruct the whole data structure. The technique is similar to inference based SQL Injection, as the approach is to inject code that creates a query that returns one bit of information. [[Blind XPath Injection]] is explained in more detail by Amit Klein in the referenced paper.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
'''Whitepapers'''&amp;lt;br&amp;gt;&lt;br /&gt;
* [1] Amit Klein: &amp;quot;Blind XPath Injection&amp;quot; - https://www.watchfire.com/securearea/whitepapers.aspx?id=9&lt;br /&gt;
* [2] XPath 1.0 specifications - http://www.w3.org/TR/xpath&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Runestone</name></author>	</entry>

	</feed>