---
title: "CAPEC-48: Passing Local Filenames to Functions That Expect a URL"
url: https://radicalnotion.ai/capec/capec-48
type: capec
description: "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."
updated: 2026-06-01
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CAPEC-48: Passing Local Filenames to Functions That Expect a URL

- **Abstraction:** Standard
- **Status:** Draft
- **Typical severity:** High
- **Likelihood of attack:** High
- **CAPEC catalog version:** 3.9

## Description

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.

## Execution flow

### Step 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.

### Step 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.

### Step 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.

## Prerequisites

- The victim's software must not differentiate between the location and type of reference passed the client software, e.g. browser

## Skills required

- **Medium:** Attacker identifies known local files to exploit

## Consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Confidentiality | Read Data | - |
| Integrity | Modify Data | - |

## Mitigations

- 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

## Example instances

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.Driver hibernate.connection.url = jdbc:postgresql://localhost/mydatabase hibernate.connection.username = username hibernate.connection.password = password hibernate.c3p0.min\_size=5 hibernate.c3p0.max\_size=20 Even if the attacker cannot write this file, there is plenty of information to leverage to gain further access.

## Related weaknesses (CWE)

- [CWE-241](https://radicalnotion.ai/cwe/cwe-241): Improper Handling of Unexpected Data Type
- [CWE-706](https://radicalnotion.ai/cwe/cwe-706): Use of Incorrectly-Resolved Name or Reference

## Related attack patterns

| Relationship | CAPEC | Name |
| --- | --- | --- |
| Parent | [CAPEC-212](https://radicalnotion.ai/capec/capec-212) | Functionality Misuse |

## Frequently asked questions

### What is CAPEC-48?

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.

### How does a Passing Local Filenames to Functions That Expect a URL attack work?

It typically unfolds over 3 phases. It begins with: \[Identify web application URL inputs\] Review application inputs to find those that are designed to be URLs.

### How do you prevent CAPEC-48?

Implementation: Ensure all content that is delivered to client is sanitized against an acceptable content specification.

### What weaknesses does CAPEC-48 target?

CAPEC-48 exploits 2 CWE weaknesses: CWE-241 (Improper Handling of Unexpected Data Type) and CWE-706 (Use of Incorrectly-Resolved Name or Reference).

### How severe is CAPEC-48?

MITRE rates CAPEC-48 as High severity with high likelihood of attack.

Primary source: [MITRE CAPEC](https://capec.mitre.org/data/definitions/48.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/capec/capec-48). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
