CAPECattack pattern
CAPEC-73 User-Controlled Filename
High
Official page ↗
- Abstraction
- Standard
- Status
- Draft
- Likelihood of attack
- High
- Typical severity
- High
- CAPEC 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
• Confidentiality, Access Control, Authorization: Gain Privileges
• Confidentiality, Integrity, Availability: Execute Unauthorized Commands
• 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
Related
Can precede · CAPEC (1)
- CAPEC-592 Stored XSS attack pattern
Child of · CAPEC (1)
- CAPEC-165 File Manipulation attack pattern
Weakness · CWE (8)
- CWE-116 Improper Encoding or Escaping of Output weakness
- CWE-184 Incomplete List of Disallowed Inputs weakness
- CWE-20 Improper Input Validation weakness
- CWE-348 Use of Less Trusted Source weakness
- CWE-350 Reliance on Reverse DNS Resolution for a Security-Critical Action weakness
- CWE-697 Incorrect Comparison weakness
- CWE-86 Improper Neutralization of Invalid Characters in Identifiers in Web Pages weakness
- CWE-96 Improper Neutralization of Directives in Statically Saved Code weakness
Referenced by CWE · attack pattern (8)
- CWE-116 Improper Encoding or Escaping of Output weakness
- CWE-184 Incomplete List of Disallowed Inputs weakness
- CWE-20 Improper Input Validation weakness
- CWE-348 Use of Less Trusted Source weakness
- CWE-350 Reliance on Reverse DNS Resolution for a Security-Critical Action weakness
- CWE-697 Incorrect Comparison weakness
- CWE-86 Improper Neutralization of Invalid Characters in Identifiers in Web Pages weakness
- CWE-96 Improper Neutralization of Directives in Statically Saved Code weakness