<?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=Asterix</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=Asterix"/>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php/Special:Contributions/Asterix"/>
		<updated>2026-04-25T13:40:41Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.2</generator>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_Stack_Traces_(OTG-ERR-002)&amp;diff=188346</id>
		<title>Testing for Stack Traces (OTG-ERR-002)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Testing_for_Stack_Traces_(OTG-ERR-002)&amp;diff=188346"/>
				<updated>2015-01-21T16:14:26Z</updated>
		
		<summary type="html">&lt;p&gt;Asterix: /* Black Box testing */ Corrected typo - final &amp;quot;)&amp;quot; at the end of first bullet.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v4}}&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
&lt;br /&gt;
Stack traces are not vulnerabilities by themselves, but they often reveal information that is interesting to an attacker. Attackers attempt to generate these stack traces by tampering with the input to the web application with malformed HTTP requests and other input data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the application responds with stack traces that are not managed it could reveal information useful to attackers. This information could then be used in further attacks. Providing debugging information as a result of operations that generate errors is considered a bad practice due to multiple reasons. For example, it may contain information on internal workings of the application such as relative paths of the point where the application is installed or how objects are referenced internally.  &lt;br /&gt;
&lt;br /&gt;
==How to Test==&lt;br /&gt;
=== Black Box testing ===&lt;br /&gt;
&lt;br /&gt;
There are a variety of techniques that will cause exception messages to be sent in an HTTP response. Note that in most cases this will be an HTML page, but exceptions can be sent as part of SOAP or REST responses too.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some tests to try include: &lt;br /&gt;
*invalid input (such as input that is not consistent with application logic).&lt;br /&gt;
*input that contains non alphanumeric characters or query syntax.&lt;br /&gt;
*empty inputs.&lt;br /&gt;
*inputs that are too long. &lt;br /&gt;
*access to internal pages without authentication. &lt;br /&gt;
*bypassing application flow.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All the above tests could lead to application errors that may contain stack traces. It is recommended to use a fuzzer in addition to any manual testing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some tools, such as [[OWASP_Zed_Attack_Proxy_Project|OWASP ZAP]] and Burp proxy will automatically detect these exceptions in the response stream as you are doing other penetration and testing work.&lt;br /&gt;
&lt;br /&gt;
=== Gray Box Testing ===&lt;br /&gt;
&lt;br /&gt;
Search the code for the calls that cause an exception to be rendered to a String or output stream. For example, in Java this might be code in a JSP that looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;amp;lt;% e.printStackTrace( new PrintWriter( out ) ) %&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In some cases, the stack trace will be specifically formatted into HTML, so be careful of accesses to stack trace elements.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Search the configuration to verify error handling configuration and the use of default error pages.  For example, in Java this configuration can be found in web.xml.&lt;br /&gt;
&lt;br /&gt;
==Tools==&lt;br /&gt;
[1] ZAP Proxy - https://www.owasp.org/index.php/OWASP_Zed_Attack_Proxy_Project &lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [1] [[http://www.ietf.org/rfc/rfc2616.txt?number=2616 RFC2616]] Hypertext Transfer Protocol -- HTTP/1.1&lt;/div&gt;</summary>
		<author><name>Asterix</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Talk:Testing_for_Error_Code_(OTG-ERR-001)&amp;diff=188345</id>
		<title>Talk:Testing for Error Code (OTG-ERR-001)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Talk:Testing_for_Error_Code_(OTG-ERR-001)&amp;diff=188345"/>
				<updated>2015-01-21T16:12:02Z</updated>
		
		<summary type="html">&lt;p&gt;Asterix: Proposition to move reference section to the end.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I propose to move Reference section to the end of the page (like it is done on many other pages).&lt;/div&gt;</summary>
		<author><name>Asterix</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Testing_for_XPath_Injection_(OTG-INPVAL-010)&amp;diff=188344</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=188344"/>
				<updated>2015-01-21T16:05:56Z</updated>
		
		<summary type="html">&lt;p&gt;Asterix: Corrected link to reference [1] Previous link was outdated.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:OWASP Testing Guide v4}}&lt;br /&gt;
&lt;br /&gt;
== 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 testing, we test if it is possible to inject XPath syntax into a request interpreted by the application, allowing an attacker to execute user-controlled XPath queries. When successfully exploited, this vulnerability may allow an attacker to bypass authentication mechanisms or access information without proper authorization.&lt;br /&gt;
&lt;br /&gt;
&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. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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;
&lt;br /&gt;
== How to Test ==&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;
&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;
&lt;br /&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;
&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;
&lt;br /&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;
&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;
&lt;br /&gt;
&lt;br /&gt;
Looks quite familiar, doesn't it? Using these parameters, the query becomes: &lt;br /&gt;
&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;
&lt;br /&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. 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;
&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;
&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; - http://dl.packetstormsecurity.net/papers/bypass/Blind_XPath_Injection_20040518.pdf&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>Asterix</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Talk:Testing_for_Heap_Overflow&amp;diff=188343</id>
		<title>Talk:Testing for Heap Overflow</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Talk:Testing_for_Heap_Overflow&amp;diff=188343"/>
				<updated>2015-01-21T15:59:02Z</updated>
		
		<summary type="html">&lt;p&gt;Asterix: Proposition to change the order of sections &amp;quot;Heap Overflow&amp;quot; and &amp;quot;Stack Overflow&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If we look at this statement on the page: &amp;quot;Locating heap overflows requires closer examination in comparison to stack overflows&amp;quot; in should be logically concluded that we already discussed stack overflows, but in reality we are going to discuss it in the next section. I think, it is better to change the order of &amp;quot;Heap Overflow&amp;quot; and &amp;quot;Stack Overflow sections&amp;quot;&lt;/div&gt;</summary>
		<author><name>Asterix</name></author>	</entry>

	</feed>