Dark Mode
Capec-48 Detail
Passing Local Filenames to Functions That Expect a URL
Standard Software Likelihood: High Typical Severity: High
Parents: 212
Threats: T62 T295
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.
Not present
| External ID | Source | Link | Description |
|---|---|---|---|
| CAPEC-48 | capec | https://capec.mitre.org/data/definitions/48.html | |
| CWE-241 | cwe | http://cwe.mitre.org/data/definitions/241.html | |
| CWE-706 | cwe | http://cwe.mitre.org/data/definitions/706.html | |
| REF-1 | reference_from_CAPEC | G. Hoglund, G. McGraw, Exploiting Software: How to Break Code, 2004--02, Addison-Wesley | |
| REF-416 | reference_from_CAPEC | https://websec.io/2012/11/26/Core-Concepts-Attack-Patterns.html | Core Concepts: Attack Patterns |
Explore
-
Identify web application URL inputs: Review application inputs to find those that are designed to be URLs.
| Techniques |
|---|
| Manually navigate web site pages to identify URLs. |
| Use automated tools to identify URLs. |
Experiment
-
Identify URL inputs allowing local access.: Execute test local commands via each URL input to determine which are successful.
| Techniques |
|---|
| Manually execute a local command (such as 'pwd') via the URL inputs. |
| Using an automated tool, test each URL input for weakness. |
Exploit
-
Execute malicious commands: Using the identified URL inputs that allow local command execution, execute malicious commands.
| Techniques |
|---|
| Execute local commands via the URL input. |
- The victim's software must not differentiate between the location and type of reference passed the client software, e.g. browser
Not present
| Medium |
|---|
| Attacker identifies known local files to exploit |
| Integrity | Confidentiality |
|---|---|
| Modify Data | Read Data |
- J2EE applications frequently use .properties files to store configuration information including JDBC connections, LDAP connection strings, proxy information, system passwords and other system metadata that is valuable to attackers looking to probe the system or bypass policy enforcement points. When these files are stored in publicly accessible directories and are allowed to be read by the public user, then an attacker can list the directory identify a .properties file and simply load its contents in the browser listing its contents. A standard Hibernate properties file contains hibernate.connection.driver_class = org.postgresql.Driverhibernate.connection.url = jdbc:postgresql://localhost/mydatabasehibernate.connection.username = usernamehibernate.connection.password = passwordhibernate.c3p0.min_size=5hibernate.c3p0.max_size=20 Even if the attacker cannot write this file, there is plenty of information to leverage to gain further access.