This site is the archived OWASP Foundation Wiki and is no longer accepting Account Requests.
To view the new OWASP Foundation website, please visit https://owasp.org

Difference between revisions of "Resource Injection"

From OWASP
Jump to: navigation, search
Line 1: Line 1:
 
{{Template:Attack}}
 
{{Template:Attack}}
 +
<br>
 +
[[Category:OWASP ASDR Project]]
 +
[[ASDR Table of Contents]]__TOC__
  
 
==Description==
 
==Description==
Line 11: Line 14:
 
The resource injection attack focus on accessing other resources than local filesystem, whose is done thru a different attack technique known as [[Path Manipulation]] attack.<br>
 
The resource injection attack focus on accessing other resources than local filesystem, whose is done thru a different attack technique known as [[Path Manipulation]] attack.<br>
  
== Severity ==
+
== Risk Factors==
 
+
TBD
High
+
[[Category:FIXME|need content here]]
 
 
== Likelihood of exploitation ==
 
  
Medium
 
  
 
==Examples ==
 
==Examples ==
Line 61: Line 61:
 
  ...
 
  ...
  
== External References==
+
 
 +
==Related [[Threat Agents]]==
 +
* [[:Category:Logical Attacks]]
 +
* [[:Category: Information Disclosure]]
 +
 
 +
==Related [[Attacks]]==
 +
* [[Path Traversal]]
 +
* [[Path Manipulation]]
 +
* [[Relative Path Traversal]]
 +
* [[:Category:Injection Attack | Injection Attacks]]
 +
 
 +
==Related [[Vulnerabilities]]==
 +
* [[:Category:Input Validation Vulnerability]]
 +
 
 +
==Related [[Controls]]==
 +
* [[:Category:Input Validation]]
 +
 
 +
==References==
 
http://samate.nist.gov/SRD/view_testcase.php?login=Guest&tID=1734 <br>
 
http://samate.nist.gov/SRD/view_testcase.php?login=Guest&tID=1734 <br>
  
Line 71: Line 88:
  
 
G. Hoglund and G. McGraw. Exploiting Software. Addison-Wesley, 2004.
 
G. Hoglund and G. McGraw. Exploiting Software. Addison-Wesley, 2004.
 
==Related Threats==
 
[[:Category:Logical Attacks]]
 
 
[[:Category: Information Disclosure]]
 
 
==Related Attacks==
 
*[[Path Traversal]]
 
*[[Path Manipulation]]
 
*[[Relative Path Traversal]]
 
*[[:Category:Injection Attack | Injection Attacks]]
 
 
==Related Vulnerabilities==
 
 
[[:Category:Input Validation Vulnerability]]
 
 
==Related Countermeasures==
 
[[:Category:Input Validation]]
 
  
  

Revision as of 00:22, 14 September 2008

This is an Attack. To view all attacks, please see the Attack Category page.

ASDR Table of Contents

Description

This attack consists in changing resources identifiers used by application in order to perform malicious task. When an application permits a user input to define a resource, like file name or port number, this data can be manipulated to execute or access different resources.
In order to be properly executed, the attacker must have the possibility to specify a resource identifier thru application form and the application must permit its execution.

The resource type affected by user input indicates the content type that may be exposed. For example, an application that permits input of special characters like period, slash, and backslash are risky when used in methods that interact with the file system.

The resource injection attack focus on accessing other resources than local filesystem, whose is done thru a different attack technique known as Path Manipulation attack.

Risk Factors

TBD


Examples

Example 1

The following examples represent an application which gets a port number from HTTP request and create a socket with this port number without any validation. A user using a proxy can modify this port and obtain a direct connection (socket) with the server.

Java code:

String rPort = request.getParameter("remotePort");
...
ServerSocket srvr = new ServerSocket(rPort);
Socket skt = srvr.accept(); 
...


.Net code:

int rPort = Int32.Parse(Request.get_Item("remotePort "));
...
IPEndPoint endpoint = new IPEndPoint(address,rPort);
socket = new Socket(endpoint.AddressFamily, 
SocketType.Stream, ProtocolType.Tcp);
socket.Connect(endpoint);
...

Example 2

This example is same as previous, but it gets port number from CGI requests using C++:

char* rPort = getenv("remotePort ");
...
serv_addr.sin_port = htons(atoi(rPort));
if (connect(sockfd,&serv_addr,sizeof(serv_addr)) < 0) 
error("ERROR connecting");
...

Example 3

This example in PLSQL / TSQL gets a URL path from a CGI and downloads the file contained on it. If a user modify the path or filename it’s possible to download arbitrary files from server:

...
filename := SUBSTR(OWA_UTIL.get_cgi_env('PATH_INFO'), 2);
WPG_DOCLOAD.download_file(filename); 
...


Related Threat Agents

Related Attacks

Related Vulnerabilities

Related Controls

References

http://samate.nist.gov/SRD/view_testcase.php?login=Guest&tID=1734

http://cwe.mitre.org/data/definitions/99.html

http://capec.mitre.org/data/index.html#Definition

http://www.fortifysoftware.com/vulncat/

G. Hoglund and G. McGraw. Exploiting Software. Addison-Wesley, 2004.