Name |
Passing Local Filenames to Functions That Expect a URL |
|
Likelyhood of attack |
Typical severity |
High |
High |
|
Summary |
This attack relies on client side code to access local files and resources instead of URLs. When the client browser is expecting a URL string, but instead receives a request for a local file, that execution is likely to occur in the browser process space with the browser's authority to local files. The attacker can send the results of this request to the local files out to a site that they control. This attack may be used to steal sensitive authentication data (either local or remote), or to gain system profile information to launch further attacks. |
Prerequisites |
The victim's software must not differentiate between the location and type of reference passed the client software, e.g. browser |
Execution Flow |
Step |
Phase |
Description |
Techniques |
1 |
Explore |
[Identify web application URL inputs] Review application inputs to find those that are designed to be URLs. |
- Manually navigate web site pages to identify URLs.
- Use automated tools to identify URLs.
|
2 |
Experiment |
[Identify URL inputs allowing local access.] Execute test local commands via each URL input to determine which are successful. |
- Manually execute a local command (such as 'pwd') via the URL inputs.
- Using an automated tool, test each URL input for weakness.
|
3 |
Exploit |
[Execute malicious commands] Using the identified URL inputs that allow local command execution, execute malicious commands. |
- Execute local commands via the URL input.
|
|
Solutions | Implementation: Ensure all content that is delivered to client is sanitized against an acceptable content specification. Implementation: Ensure all configuration files and resource are either removed or protected when promoting code into production. Design: Use browser technologies that do not allow client side scripting. Implementation: Perform input validation for all remote content. Implementation: Perform output validation for all remote content. Implementation: Disable scripting languages such as JavaScript in browser |
Related Weaknesses |
CWE ID
|
Description
|
CWE-241 |
Improper Handling of Unexpected Data Type |
CWE-706 |
Use of Incorrectly-Resolved Name or Reference |
|
Related CAPECS |
CAPEC ID
|
Description
|
CAPEC-212 |
An adversary leverages a legitimate capability of an application in such a way as to achieve a negative technical impact. The system functionality is not altered or modified but used in a way that was not intended. This is often accomplished through the overuse of a specific functionality or by leveraging functionality with design flaws that enables the adversary to gain access to unauthorized, sensitive data. |
|