VariantIncomplete

CWE-646Reliance on File Name or Extension of Externally-Supplied File

Category: other

Description

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.

Common consequences· 3

  • Confidentiality — Read Application Data
    An attacker may be able to read sensitive data.
  • Availability — DoS: Crash, Exit, or Restart
    An attacker may be able to cause a denial of service.
  • Access Control — Gain Privileges or Assume Identity
    An attacker may be able to gain privileges.

Potential mitigations· 1

  • [Architecture and Design]Make decisions on the server side based on file content and not on file name or extension.

Related CAPEC attack patterns· 1

CAPEC-209

References

  1. https://cwe.mitre.org/data/definitions/646.html

Exploits (incoming)1

TypeTargetConfidenceTier
AttackPatternXSS Using MIME Type Mismatchcapec-209100%live

(incoming)2

TypeTargetConfidenceTier
VulnerabilityCVE-2025-1889cve-2025-18890%live
VulnerabilityCVE-2026-45315cve-2026-453150%live

Related by meaning· 6

Nearest entities by semantic similarity across the cs-graph corpus.

CWE
Unrestricted Upload of File with Dangerous Type
CWE
Improper Restriction of Names for Files and Other Resources
CWE
Incomplete Identification of Uploaded File Variables (PHP)
CWE
Improper Control of Document Type Definition
CWE
Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion')
CVE
CVE-2025-3115
Sourced from MITRE CWE 4.20. Curated for EU compliance use cases by Adam Lundqvist, Founder at SQUR.