CWE · MITRE source
CWE-646Reliance 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.
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.
Last updated: 20 August 2026 13:14 UTC
OWASP Top 10 for Web (2025)
This weakness contributes to A06:2025 Insecure Design.
Control responseHuman-reviewed
Answering this weakness across the control lifecycle, from our framework cross-walks.
—
—
—
NIST 800-53 r5 controls that address this weakness (0)AI-assisted
| Control | Title | Family | Why it addresses this CWE |
|---|---|---|---|
| No NIST controls proposed yet. | |||
Top CVEs of this weakness type, ranked by Risk Priority
| CVE | Risk | CVSS | EPSS | Published |
|---|---|---|---|---|
CVE-2025-1889 UPD | 7.3 | 9.8 | 0.0038 | 2025-03-03 |
CVE-2026-45315 UPD | 6.0 | 8.7 | 0.0019 | 2026-05-15 |
CVE-2021-34639 UPD | 5.8 | 7.5 | 0.0058 | 2021-08-05 |
CVE-2024-52052 UPD | 5.5 | 7.2 | 0.0048 | 2024-11-21 |
CVE-2025-30662 UPD | 4.8 | 6.6 | 0.0013 | 2025-11-13 |
CVE-2023-45599 UPD | 4.0 | 5.5 | 0.0022 | 2024-03-05 |
CVE-2024-38432 UPD | 4.0 | 5.5 | 0.0017 | 2024-07-30 |
CVE-2025-41720 UPD | 3.5 | 4.3 | 0.0017 | 2025-10-22 |
CVE-2026-20172 UPD | 3.4 | 4.3 | 0.0013 | 2026-05-06 |