CWE-434: Unrestricted Upload of File with Dangerous Type

BaseDraftExploit Likelihood: Medium🏆 #6 in Top 25 (2024)

The product allows the upload or transfer of dangerous file types that are automatically processed within its environment.

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

Technical Details

Structure
Simple
Vulnerability Mapping
ALLOWED

Applicable To

Languages
ASP.NETPHPNot Language-Specific
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)

Source-backed guidance

Additional facts reviewed against primary or authoritative security sources.

Combine review and analysis around the CWE-434 trust boundary

MITRE identifies dynamic analysis, manual source review, architecture or design review as applicable detection approaches. Use them to follow uploaded bytes from request parsing through validation, renaming, transformation, storage, retrieval, and any interpreter or web-server execution path. Require a reproducible source-to-sink or policy-to-enforcement trace, record coverage gaps, and confirm suspected findings dynamically where safe; no single scanner can establish complete coverage for this weakness.

CWE-434: detection methods and operational guidanceMITRE CWE

Treat file upload validation as layered containment

Allow only the extensions required by the business function, decode the filename before validating it, and do not trust the client-supplied Content-Type header. Generate storage names, enforce size limits, require authorization, and keep uploads outside the web root or on a separate host. Where appropriate, scan or sandbox content and protect the upload action against CSRF.

File Upload Cheat SheetOWASP Foundation

Apply lessons from CVE-2024-7694 in TeamT5 ThreatSonar Anti-Ransomware

NVD maps CVE-2024-7694 to CWE-434; uploaded file content was not validated sufficiently, allowing a remote administrator to place malicious files and execute system commands on the server. Use the case to test privileged upload features as code-execution boundaries, inspect file content rather than headers alone, and prevent uploaded content from entering executable locations.

CVE-2024-7694 DetailNIST National Vulnerability Database

Prioritize CWE-434 using its 2025 CWE Top 25 evidence

CWE-434 ranked #12 in the 2025 CWE Top 25 with a score of 6.87. The ranking table recorded 4 mapped vulnerabilities in CISA KEV for this measurement window. Use the rank to prioritize systemic prevention, detection coverage, and recurring-root-cause metrics across the portfolio, while retaining asset exposure and business impact for individual finding severity decisions.

2025 CWE Top 25 Most Dangerous Software WeaknessesMITRE CWE

Attempt executable, polyglot, and parser-confusing uploads

Test extension allowlists against case changes, multiple extensions, encoded names, alternate data streams where relevant, mismatched Content-Type, magic-byte spoofing, polyglots, archives, and files that exploit downstream processors. Verify server-generated names, size limits, authorization, malware or content scanning, and storage outside executable web paths, then retrieve each accepted file to confirm safe response headers.

Test Upload of Unexpected File TypesOWASP Foundation

Frequently Asked Questions

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

CWE-434: Unrestricted Upload of File with Dangerous Type is a Common Weakness Enumeration (CWE) entry maintained by MITRE. The product allows the upload or transfer of dangerous file types that are automatically processed within its environment.

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 Unrestricted Upload of File with Dangerous Type?+

If exploited, CWE-434 (Unrestricted Upload of File with Dangerous Type) it can compromise Integrity, Confidentiality and Availability, leading to outcomes such as Execute Unauthorized Code or Commands.

How do you prevent or mitigate 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] Consider storing the uploaded files outside of the web document root entirely. Then, use other mechanisms to deliver the files dynamically. [REF-423] Define a very limited set of allowable extensions and only generate filenames that end in these extensions. Consider the possibility of XSS (CWE-79) before allowing .html or .htm file types.

How is Unrestricted Upload of File with Dangerous Type detected?+

CWE-434 can be detected using Dynamic Analysis with Automated Results Interpretation, Dynamic Analysis with Manual Results Interpretation, Manual Static Analysis - Source Code, Automated Static Analysis - Source Code and Architecture or Design Review. Combining automated tooling with manual review typically yields the best coverage.

Which programming languages are affected by Unrestricted Upload of File with Dangerous Type?+

CWE-434 commonly affects ASP.NET, PHP and Not Language-Specific. Note that weaknesses are often language-agnostic patterns, so secure coding practices apply broadly.

What are real-world examples of Unrestricted Upload of File with Dangerous Type?+

MITRE documents real CVEs mapped to CWE-434, including CVE-2023-5227, CVE-2001-0901, CVE-2002-1841, CVE-2005-1868 and CVE-2005-1881. You can look up the full details of each CVE, including CVSS scores and remediation guidance, on our CVE Lookup tool.

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

Advertisement