CAPEC-73
User-Controlled Filename
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.
On this page
Ask an AI about this attack pattern
Show the prompt
Explain the attack pattern CAPEC-73: User-Controlled Filename: how it unfolds, what it needs and how to prevent and detect it in my systems. Use https://capec.mitre.org/data/definitions/73.html and https://cve.bz/cve/capec/73?via=ask-ai-copy, which lists recent CVEs with the weaknesses it exploits. Cite the sources.Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this attack pattern's id and public links.
Prerequisites
The victim must trust the name and locale of user controlled filenames.
Skills required
- Low skill
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 skill
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 skill
Exploiting a client side vulnerability to inject malicious scripts into the browser's executable process.
Consequences
| Impact | Affects | Note |
|---|---|---|
| Gain Privileges | Confidentiality, Access Control, Authorization | |
| Execute Unauthorized Commands | Confidentiality, Integrity, Availability | Run Arbitrary Code |
| Alter Execution Logic | Availability | |
| Read Data | Confidentiality |
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
Weaknesses it exploits
- 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
- CWE-116 Improper Encoding or Escaping of Output
- CWE-184 Incomplete List of Disallowed Inputs
- CWE-348 Use of Less Trusted Source
- CWE-350 Reliance on Reverse DNS Resolution for a Security-Critical Action
- CWE-697 Incorrect Comparison
Recent CVEs with these weaknesses
- 5.5CVE-2026-139984
A weakness has been identified in walinejs Waline up to 1.43.6. The affected element is an unknown function of the component OAuth Login Callback Handler. Executing a manipulation of the argument Type can lead to improper input validation.…
- 3.7CVE-2026-140099
Forge, also called node-forge, is a native implementation of Transport Layer Security in JavaScript. Prior to 1.4.4, pki.privateKeyFromPem() and pki.privateKeyFromAsn1() ignore the RSAPrivateKey version and otherPrimeInfos fields and inter…
- 9.1CVE-2026-140097
Vite is a frontend tooling framework for JavaScript. From 4.0.0 until 6.4.6, 7.3.8, 8.1.7, 8.2.5, and 8.3.7 in Vite, and prior to 1.5.1 in vite-plus, a network-exposed development server embeds request-derived module identifiers from the _…
- 8.8CVE-2026-75938
A flaw was found in openshift/cluster-api-provider-ibmcloud. When the IBMPowerVSCluster.Spec.Ignition is configured, the controller embeds an IBM Identity and Access Management (IAM) bearer token directly into the PowerVS instance user-dat…
- 5.4CVE-2026-140006
minimatch is a minimal matching utility for converting glob expressions into JavaScript RegExp objects. From 7.4.0 until 11.0.8, minimatch.escape() can produce patterns that do not exclusively match the supplied literal input: leading ! ca…
- 7.6CVE-2026-125083
The vault-auth plugin in Kong Gateway Enterprise and Kong AI Gateway does not escape the access token in the HashiCorp Vault KV request URL, allowing a Consumer to read older secret versions and authenticate with rotated, revoked or reassi…
- 6.9CVE-2026-139874
Jivejdon through 5.0 contains an IP spoofing vulnerability in IPForwardingFilter that allows unauthenticated attackers to forge client addresses via untrusted X-Forwarded-For headers. Attackers can send arbitrary X-Forwarded-For values to …
- 9.1CVE-2026-137019
Enclave OS Mini is a Rust-based runtime for confidential applications inside Intel SGX enclaves. Prior to enclave-os-mini-wasm version 0.53.0 and enclave-cluster version 0.8.0, Enclave OS Mini accepted a caller-chosen user_handle during FI…
The newest records naming one of them. Each weakness's page lists them all.
Related attack patterns
Examples
Phishing attacks rely on a user clicking on links on that are supplied to them by attackers masquerading as a…
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.
MITRE's words, unchanged: CAPEC-73 at MITRE. CAPEC is Copyright © 2007–2026, The MITRE Corporation, used under the CAPEC terms of use: “The MITRE Corporation (MITRE) hereby grants you a non-exclusive, royalty-free license to use Common Attack Pattern Enumeration and Classification (CAPEC™) for research, development, and commercial purposes. Any copy you make for such purposes is authorized provided that you reproduce MITRE’s copyright designation and this license in any such copy.” CAPEC and the CAPEC logo are trademarks of The MITRE Corporation. Credits. All attack patterns.