---
title: "CAPEC-73: User-Controlled Filename"
url: https://radicalnotion.ai/capec/capec-73
type: capec
description: "An attack of this type involves an adversary inserting malicious characters (such as a XSS redirection) into a filename, directly or indirectly that is then used by the target software to generate HTML text or other potentially executable content. Many websites rely on user-generated content and dynamically build resources like files, filenames, and URL links directly from user supplied data. In this attack pattern, the attacker uploads code that can execute in the client browser and/or redirect the client browser to a site that the attacker owns. All XSS attack payload variants can be used to pass and exploit these vulnerabilities."
updated: 2026-06-01
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CAPEC-73: User-Controlled Filename

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

## Description

An attack of this type involves an adversary inserting malicious characters (such as a XSS redirection) into a filename, directly or indirectly that is then used by the target software to generate HTML text or other potentially executable content. Many websites rely on user-generated content and dynamically build resources like files, filenames, and URL links directly from user supplied data. In this attack pattern, the attacker uploads code that can execute in the client browser and/or redirect the client browser to a site that the attacker owns. All XSS attack payload variants can be used to pass and exploit these vulnerabilities.

## Prerequisites

- The victim must trust the name and locale of user controlled filenames.

## Skills required

- **Low:** To achieve a redirection and use of less trusted source, an attacker can simply edit data that the host uses to build the filename
- **Medium:** Deploying a malicious "look-a-like" site (such as a site masquerading as a bank or online auction site) that the user enters their authentication data into.
- **High:** Exploiting a client side vulnerability to inject malicious scripts into the browser's executable process.

## Consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Confidentiality, Access Control, Authorization | Gain Privileges | - |
| Confidentiality, Integrity, Availability | Execute Unauthorized Commands | Run Arbitrary Code |
| Availability | Alter Execution Logic | - |
| Confidentiality | Read Data | - |

## Mitigations

- Design: Use browser technologies that do not allow client side scripting.
- Implementation: Ensure all content that is delivered to client is sanitized against an acceptable content specification.
- 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
- Implementation: Scan dynamically generated content against validation specification

## Example instances

Phishing attacks rely on a user clicking on links on that are supplied to them by attackers masquerading as a trusted resource such as a bank or online auction site. The end user's email client hosts the supplied resource name in this case via email. The resource name, however may either 1) direct the client browser to a malicious site to steal credentials and/or 2) execute code on the client machine to probe the victim's host system and network environment.

## Related weaknesses (CWE)

- [CWE-20](https://radicalnotion.ai/cwe/cwe-20): Improper Input Validation
- [CWE-86](https://radicalnotion.ai/cwe/cwe-86): Improper Neutralization of Invalid Characters in Identifiers in Web Pages
- [CWE-96](https://radicalnotion.ai/cwe/cwe-96): Improper Neutralization of Directives in Statically Saved Code
- [CWE-116](https://radicalnotion.ai/cwe/cwe-116): Improper Encoding or Escaping of Output
- [CWE-184](https://radicalnotion.ai/cwe/cwe-184): Incomplete List of Disallowed Inputs
- [CWE-348](https://radicalnotion.ai/cwe/cwe-348): Use of Less Trusted Source
- [CWE-350](https://radicalnotion.ai/cwe/cwe-350): Reliance on Reverse DNS Resolution for a Security-Critical Action
- [CWE-697](https://radicalnotion.ai/cwe/cwe-697): Incorrect Comparison

## Related attack patterns

| Relationship | CAPEC | Name |
| --- | --- | --- |
| Parent | [CAPEC-165](https://radicalnotion.ai/capec/capec-165) | File Manipulation |
| Can precede | [CAPEC-592](https://radicalnotion.ai/capec/capec-592) | Stored XSS |

## Frequently asked questions

### What is CAPEC-73?

An attack of this type involves an adversary inserting malicious characters (such as a XSS redirection) into a filename, directly or indirectly that is then used by the target software to generate HTML text or other potentially executable content. Many websites rely on user-generated content and dynamically build resources like files, filenames, and URL links directly from user supplied data. In this attack pattern, the attacker uploads code that can execute in the client browser and/or redirect the client browser to a site that the attacker owns. All XSS attack payload variants can be used to pass and exploit these vulnerabilities.

### How do you prevent CAPEC-73?

Design: Use browser technologies that do not allow client side scripting.

### What weaknesses does CAPEC-73 target?

CAPEC-73 exploits 8 CWE weaknesses, including CWE-20 (Improper Input Validation), CWE-86 (Improper Neutralization of Invalid Characters in Identifiers in Web Pages), CWE-96 (Improper Neutralization of Directives in Statically Saved Code) and CWE-116 (Improper Encoding or Escaping of Output).

### How severe is CAPEC-73?

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

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

---

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