CWE-434: CWE-434: Unrestricted Upload of File with Dangerous Type

BaseStable🏆 #6 in Top 25 (2024)

Description

View on MITRE
322Related CVEs
20.26Severity Score
Back to CWE Lookup

Technical Details

Structure
Simple
Vulnerability Mapping
ALLOWED

Applicable To

Languages
Languages
Platforms

🏆 CWE Top 25 Historical Ranking

2023:#10
Score: 10.41
298 CVEs
2024:#6↑4
Score: 20.26
322 CVEs
Trend:Worsening (moved down 4 ranks)

Frequently Asked Questions

What is CWE-434: CWE-434: Unrestricted Upload of File with Dangerous Type?+

CWE-434: CWE-434: Unrestricted Upload of File with Dangerous Type is a Common Weakness Enumeration (CWE) entry maintained by MITRE. Description

Is CWE-434 in the CWE Top 25 Most Dangerous Software Weaknesses?+

Yes. CWE-434 ranked #6 in the CWE Top 25 for 2024, associated with 322 CVEs that year. The CWE Top 25 highlights the most common and impactful software weaknesses based on real-world vulnerability data.

What are the security consequences of CWE-434: Unrestricted Upload of File with Dangerous Type?+

If exploited, CWE-434 (CWE-434: Unrestricted Upload of File with Dangerous Type) it can compromise Execute Unauthorized Code or Commands, leading to outcomes such as Scope: Integrity, Confidentiality, Availability Arbitrary code execution is possible if an uploaded file is interpreted and executed as code by the recipient. This is especially true for web-server extensions such as .asp and .php because these file types are often treated as automatically executable, even when file system permissions do not specify execution. For example, in Unix environments and programs typically cannot run unless the execute bit is set.

How do you prevent or mitigate CWE-434: Unrestricted Upload of File with Dangerous Type?+

Recommended mitigations for CWE-434 include: Generate a new, unique filename for an uploaded file instead of using the user-supplied filename, so that no external input is used at all.[ REF-422 ] [ REF-423 ] Strategy: Enforcement by Conversion When the set of acceptable objects, such as filenames or URLs, is limited or known, create a mapping from a set of fixed input values (such as numeric IDs) to the actual filenames or URLs, and reject all other inputs. Consider storing the uploaded files outside of the web document root entirely. Then, use other mechanisms to deliver the files dynamically. [ REF-423 ]

Which programming languages are affected by CWE-434: Unrestricted Upload of File with Dangerous Type?+

CWE-434 commonly affects Languages. Note that weaknesses are often language-agnostic patterns, so secure coding practices apply broadly.

What is the difference between a CWE and a CVE?+

A CWE (Common Weakness Enumeration) like CWE-434 describes a category of software weakness — the underlying flaw type. A CVE (Common Vulnerabilities and Exposures) identifies a specific, real-world vulnerability in a particular product. In short, a CWE is the kind of mistake, and a CVE is an instance of that mistake being found in software.

Learn More