CWE-646: Reliance on File Name or Extension of Externally-Supplied File
The product allows a file to be uploaded, but it relies on the file name or extension of the file to determine the appropriate behaviors. This could be used by attackers to cause the file to be misclassified and processed in a dangerous fashion.
Last updated
Overview
An application might use the file name or extension of a user-supplied file to determine the proper course of action, such as selecting the correct process to which control should be passed, deciding what data should be made available, or what resources should be allocated. If the attacker can cause the code to misclassify the supplied file, then the wrong action could occur. For example, an attacker could supply a file that ends in a ".php.gif" extension that appears to be a GIF image, but would be processed as PHP code. In extreme cases, code execution is possible, but the attacker could also cause exhaustion of resources, denial of service, exposure of debug or system data (including application source code), or being bound to a particular server side process. This weakness may be due to a vulnerability in any of the technologies used by the web and application servers, due to misconfiguration, or resultant from another flaw in the application itself.
Real-world CVEs
10 recorded CVEs are caused by CWE-646 (Reliance on File Name or Extension of Externally-Supplied File). The highest-severity and most recent are shown first. 2 new CWE-646 CVEs have been recorded so far in 2026 (4 in 2025).
- CVE-2024-38432
Matrix – Tafnit v8 CWE-646: Reliance on File Name or Extension of Externally-Supplied File
Critical · CVSS 9.8 · EPSS 7th2024-07-30 - CVE-2024-52052
Stream Target Remote Code Execution in Wowza Streaming Engine
Critical · CVSS 9.4 · EPSS 43th2024-11-21 - CVE-2023-45599High · CVSS 8.8 · EPSS 12th2024-03-05
- CVE-2021-34639
WordPress Download Manager <= 3.1.24 Authenticated Arbitrary File Upload
High · CVSS 8.8 · EPSS 48th2021-08-05 - CVE-2026-45315
Open WebUI: Stored XSS via attacker-controlled file extension in /api/v1/audio/transcriptions
High · CVSS 8.7 · EPSS 8th2026-05-15 - CVE-2025-58449
Maho Vulnerable to Authenticated Remote Code Execution via File Upload
High · CVSS 8.7 · EPSS 24th2025-09-08 - CVE-2025-30662
Zoom Workplace VDI Plugin macOS Universal Installer - Symlink Following
Medium · CVSS 6.6 · EPSS 3th2025-11-13 - CVE-2025-1889
picklescan - Security scanning bypass via non-standard file extensions
Medium · CVSS 5.3 · EPSS 34th2025-03-03 - CVE-2026-20172
Cisco Enterprise Chat and Email Lite Agent File Upload Vulnerability
Medium · CVSS 4.3 · EPSS 2th2026-05-06 - CVE-2025-41720
Sauter: Arbitrary File Upload
Medium · CVSS 4.3 · EPSS 8th2025-10-22
Common consequences
What can happen when CWE-646 is exploited.
Read Application Data
Affects: Confidentiality
An attacker may be able to read sensitive data.
DoS: Crash, Exit, or Restart
Affects: Availability
An attacker may be able to cause a denial of service.
Gain Privileges or Assume Identity
Affects: Access Control
An attacker may be able to gain privileges.
How it happens
When it is introduced
Typically introduced during these phases of the software lifecycle.
Applies to
Technologies
How to prevent it
Practical mitigations for CWE-646, grouped by where in the lifecycle they apply.
Make decisions on the server side based on file content and not on file name or extension.
Attack patterns
CAPEC attack patterns that exploit this weakness.
Frequently asked questions
Common questions about CWE-646.
- What is CWE-646?
- The product allows a file to be uploaded, but it relies on the file name or extension of the file to determine the appropriate behaviors. This could be used by attackers to cause the file to be misclassified and processed in a dangerous fashion.
- What CVEs are caused by CWE-646?
- 10 recorded CVEs are attributed to CWE-646, including CVE-2024-38432, CVE-2024-52052 and CVE-2023-45599.
- How do you prevent CWE-646?
- Make decisions on the server side based on file content and not on file name or extension.
- What are the consequences of CWE-646?
- Exploiting CWE-646 can lead to: Read Application Data, DoS: Crash, Exit, or Restart, Gain Privileges or Assume Identity.
- Is CWE-646 actively exploited?
- 10 recorded CVEs are caused by CWE-646; none are currently in CISA's KEV catalog of actively exploited flaws.
References
- MITRE CWE definition (CWE-646) (opens in a new tab)
- CWE-646 vulnerabilities on NVD (opens in a new tab)
- Learn: What is a CWE?
Weakness data is sourced from the MITRE CWE catalog (v4.20). CVE associations are aggregated and kept current by RadicalNotion.AI.
Track CWE-646 CVEs
Get an alert when a new CWE-646 CVE affects your products, with AI-written analysis and remediation steps.