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.

Primary

Architecture and Design

Implementation

Operation

High

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.

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

Allowed
This CWE entry is at the Variant level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.
Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.

Evgeny Lebanidze
Cigital
2008-01-30
Draft 8
2008-01-30

CWE Content Team
MITRE
2008-09-08
updated Common_Consequences, Relationships, Observed_Example

CWE Content Team
MITRE
2008-10-13
Significant clarification of the weakness description.

CWE Content Team
MITRE
2008-10-14
updated Description, Name, Observed_Examples, Relationships

CWE Content Team
MITRE
2009-07-27
updated Related_Attack_Patterns

CWE Content Team
MITRE
2009-10-29
updated Common_Consequences

CWE Content Team
MITRE
2010-12-13
updated Applicable_Platforms, Common_Consequences

CWE Content Team
MITRE
2011-03-29
updated Common_Consequences, Description

CWE Content Team
MITRE
2011-06-01
updated Common_Consequences

CWE Content Team
MITRE
2012-05-11
updated Relationships

CWE Content Team
MITRE
2012-10-30
updated Potential_Mitigations

CWE Content Team
MITRE
2014-07-30
updated Relationships

CWE Content Team
MITRE
2017-11-08
updated Enabling_Factors_for_Exploitation

CWE Content Team
MITRE
2020-02-24
updated Applicable_Platforms, Relationships

CWE Content Team
MITRE
2021-10-28
updated Relationships

CWE Content Team
MITRE
2023-01-31
updated Description

CWE Content Team
MITRE
2023-04-27
updated Relationships

CWE Content Team
MITRE
2023-06-29
updated Description, Mapping_Notes

CWE Content Team
MITRE
2025-12-11
4.19
2025-12-11
updated Relationships, Weakness_Ordinalities

Taking Actions based on File Name or Extension of a User Supplied File