CWEweakness
CWE-434 Unrestricted Upload of File with Dangerous Type
Medium
Official page ↗
- Alternate terms
- Unrestricted File Upload
- Abstraction
- Base
- Structure
- Simple
- Status
- Draft
- Likelihood of exploit
- Medium
- Languages
- ASP.NET, Not Language-Specific, PHP
- CWE version
- 5.0
Description
The product allows the upload or transfer of dangerous file types that are automatically processed within its environment.
Common consequences
• Integrity, Confidentiality, Availability: Execute Unauthorized Code or Commands — 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, programs typically cannot run unless the execute bit is set, but PHP programs may be executed by the web server without directly invoking them on the operating system.
Potential mitigations
• [Architecture and Design] 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]
• [Architecture and Design] 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.
• [Architecture and Design] Consider storing the uploaded files outside of the web document root entirely. Then, use other mechanisms to deliver the files dynamically. [REF-423]
• [Implementation] Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."
Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
For example, limiting filenames to alphanumeric characters can help to restrict the introduction of unintended file extensions.
• [Architecture and Design] 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.
• [Implementation] Ensure that only one extension is used in the filename. Some web servers, including some versions of Apache, may process files based on inner extensions so that "filename.php.gif" is fed to the PHP interpreter.[REF-422] [REF-423]
• [Implementation] When running on a web server that supports case-insensitive filenames, perform case-insensitive evaluations of the extensions that are provided.
• [Architecture and Design] For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.
• [Implementation] Do not rely exclusively on sanity checks of file contents to ensure that the file is of the expected type and size. It may be possible for an attacker to hide code in some file segments that will still be executed by the server. For example, GIF images may contain a free-form comments field.
• [Implementation] Do not rely exclusively on the MIME content type or filename attribute when determining how to render a file. Validating the MIME content type and ensuring that it matches the extension is only a partial solution.
• [Architecture and Design, Operation] Run your code using the lowest privileges that are required to accomplish the necessary tasks [REF-76]. If possible, create isolated accounts with limited privileges that are only used for a single task. That way, a successful attack will not immediately give the attacker access to the rest of the software or its environment. For example, database applications rarely need to run as the database administrator, especially in day-to-day operations.
• [Architecture and Design, Operation] Run the code in a "jail" or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which files can be accessed in a particular directory or which commands can be executed by the software.
OS-level examples include the Unix chroot jail, AppArmor, and SELinux. In general, managed code may provide some protection. For example, java.io.FilePermission in the Java SecurityManager allows the software to specify restrictions on file operations.
This may not be a feasible solution, and it only limits the impact to the operating system; the rest of the application may still be subject to compromise.
Be careful to avoid CWE-243 and other weaknesses related to jails.
Detection methods
• Dynamic Analysis with Automated Results Interpretation: According to SOAR [REF-1479], the following detection techniques may be useful:
Cost effective for partial coverage:
• Web Application Scanner
• Web Services Scanner
• Database Scanners
• Dynamic Analysis with Manual Results Interpretation: According to SOAR [REF-1479], the following detection techniques may be useful:
Cost effective for partial coverage:
• Fuzz Tester
• Framework-based Fuzzer
• Manual Static Analysis - Source Code: According to SOAR [REF-1479], the following detection techniques may be useful:
Highly cost effective:
• Focused Manual Spotcheck - Focused manual analysis of source
• Manual Source Code Review (not inspections)
• Automated Static Analysis - Source Code: According to SOAR [REF-1479], the following detection techniques may be useful:
Highly cost effective:
• Source code Weakness Analyzer
• Context-configured Source Code Weakness Analyzer
• Architecture or Design Review: According to SOAR [REF-1479], the following detection techniques may be useful:
Highly cost effective:
• Formal Methods / Correct-By-Construction
Cost effective for partial coverage:
• Inspection (IEEE 1028 standard) (can apply to requirements, design, source code, etc.)
Observed examples
• CVE-2023-5227: PHP-based FAQ management app does not check the MIME type for uploaded images
• CVE-2001-0901: Web-based mail product stores ".shtml" attachments that could contain SSI
• CVE-2002-1841: PHP upload does not restrict file types
• CVE-2005-1868: upload and execution of .php file
• CVE-2005-1881: upload file with dangerous extension
• CVE-2005-0254: program does not restrict file types
• CVE-2004-2262: improper type checking of uploaded files
• CVE-2006-4558: Double "php" extension leaves an active php extension in the generated filename.
• CVE-2006-6994: Chain: ASP program allows upload of .asp files (CWE-434) by bypassing client-side checks (CWE-601.
• CVE-2005-3288: ASP file upload
• CVE-2006-2428: ASP file upload
Related
Attack pattern · CAPEC (1)
- CAPEC-1 Accessing Functionality Not Properly Constrained by ACLs attack pattern
Observed example · CVE (11)
- CVE-2023-5227 Unrestricted Upload of File with Dangerous Type in GitHub repository thorsten/phpmyfaq prior to 3.1.8. vulnerability
- CVE-2006-6994 Unrestricted file upload vulnerability in add.asp in OzzyWork Gallery, possibly 2.0 and earlier, allows remote attackers to upload and… vulnerability
- CVE-2006-4558 DeluxeBB 1.06 and earlier, when run on the Apache HTTP Server with the mod_mime module, allows remote attackers to execute arbitrary PHP… vulnerability
- CVE-2006-2428 add.asp in DUware DUbanner 3.1 allows remote attackers to execute arbitrary code by uploading files with arbitrary extensions, such as ASP… vulnerability
- CVE-2005-3288 Mailsite Express allows remote attackers to upload and execute files with executable extensions such as ASP by attaching the file using the… vulnerability
- CVE-2005-1868 I-Man 0.9, and possibly earlier versions, allows remote attackers to execute arbitrary PHP code by uploading a file attachment with a .php… vulnerability
- CVE-2005-1881 upload.php in YaPiG 0.92b, 0.93u and 0.94u does not properly restrict the file extension for uploaded image files, which allows remote… vulnerability
- CVE-2005-0254 BibORB 1.3.2, and possibly earlier versions, does not properly enforce a restriction for uploading only PDF and PS files, which allows… vulnerability
- CVE-2004-2262 ImageManager in e107 before 0.617 does not properly check the types of uploaded files, which allows remote attackers to execute arbitrary… vulnerability
- CVE-2002-1841 The document management module in NOLA 1.1.1 and 1.1.2 does not restrict the types of files that are uploaded, which allows remote… vulnerability
- CVE-2001-0901 Hypermail allows remote attackers to execute arbitrary commands on a server supporting SSI via an attachment with a .shtml extension, which… vulnerability
Child of · CWE (1)
- CWE-669 Incorrect Resource Transfer Between Spheres weakness
Peer of · CWE (3)
Referenced by CAPEC · weakness (1)
- CAPEC-1 Accessing Functionality Not Properly Constrained by ACLs attack pattern
Referenced by CVE · weakness (4,556)
- CVE-2026-115245 The Chat AI with Dispatcher WordPress plugin before 2.4 does not properly validate uploaded files, relying only on a spoofable… vulnerability
- CVE-2026-16889 In openEQUELLA before 2026.1, the pre-login notice image upload endpoint (PUT /api/preloginnotice/image/{name}) does not validate the type… vulnerability
- CVE-2026-90864 A path traversal vulnerability in Progress Software WS_FTP Server versions prior to 2024.0.7 and 2025.0.4 on Windows could allow a… vulnerability
- CVE-2026-90866 A path traversal vulnerability in Progress Software WS_FTP Server versions prior to 2024.0.7 and 2025.0.4 on Windows could allow a… vulnerability
- CVE-2014-125138 C97net qEngine CMS through 6.0.0, Kemana Directory through 1.5.6, and Cart Engine through 3.0.0 contain an unrestricted file upload… vulnerability
- CVE-2026-103688 The Checkout Files Upload for WooCommerce WordPress plugin before 2.4.0 does not validate uploaded file types when its accepted file types… vulnerability
- CVE-2026-109218 The Contact Manager plugin for WordPress is vulnerable to Arbitrary File Upload in all versions up to, and including, 9.1.2 via the… vulnerability
- CVE-2026-109384 The The Innovative Form Builder – IvyForms plugin for WordPress is vulnerable to Arbitrary File Upload in all versions up to, and… vulnerability
- CVE-2026-111255 The affiliate-toolkit – Multi-Network Affiliate & Amazon Product Display plugin for WordPress is vulnerable to Arbitrary File Upload in all… vulnerability
- CVE-2026-117607 Xerte Online Toolkits through 3.15.5 contains a remote code execution vulnerability that allows authenticated users with system permission… vulnerability
- CVE-2026-67073 HCL BigFix AEX is affected by an Unrestricted File Upload and Improper Access Control vulnerability. vulnerability
- CVE-2026-84999 The Pie Register Premium plugin for WordPress is vulnerable to Unrestricted File Type Upload in all versions up to, and including, 3.8.4.0… vulnerability
- CVE-2026-116603 A flaw has been found in SourceCodester Online Food Ordering System 1.0. vulnerability
- CVE-2026-117512 A vulnerability was found in oretnom23 php-travel-agency-system. vulnerability
- CVE-2026-4337 Unrestricted Upload of File with Dangerous Type vulnerability in the PuMuKIT application allows a unauthenticated user to upload any type… vulnerability
- CVE-2026-115188 An unrestricted file upload vulnerability exists in the campaign import feature of Mautic 7. vulnerability
- CVE-2026-116113 A security flaw has been discovered in GouGuOA up to 6.1.2. vulnerability
- CVE-2026-116236 A vulnerability has been found in Oray Pugongying X5 Pro 7.6.1. vulnerability
- CVE-2026-116044 A security vulnerability has been detected in prasathmani TinyFileManager up to 2.6. vulnerability
- CVE-2026-116057 A vulnerability has been found in KodCloud KodExplorer up to 4.55. vulnerability
- CVE-2026-113472 The Depicter — Popup & Slider Builder WordPress plugin before 4.8.2 does not properly validate uploaded files in its editor media-upload… vulnerability
- CVE-2026-115481 baserCMS is a website development framework. vulnerability
- CVE-2026-54630 Part-DB is an open source inventory management system for electronic components. vulnerability
- CVE-2026-59188 Part-DB is an open source inventory management system for electronic components. vulnerability
- CVE-2026-102785 Joomla Extension - yootheme.com - Unauthenticated remote code execution in YOOtheme Pro 5.0.0-5.0.52 - YOOtheme Pro’s publicly accessible… vulnerability
- CVE-2026-111832 Unrestricted Upload of File with Dangerous Type vulnerability in WP Mailster WP Mailster wp-mailster allows Upload a Web Shell to a Web… vulnerability
- CVE-2026-111834 Unrestricted Upload of File with Dangerous Type vulnerability in Kitae Park Mang Board WP mangboard allows Upload a Web Shell to a Web… vulnerability
- CVE-2026-114259 A flaw has been found in oretnom23 file-management-system-php up to 2e3c1ebe60f121e8df4fb3f544f0e9591d9a01e4. vulnerability
- CVE-2026-114262 A vulnerability was determined in file-management-system dc9ce1bf27f94b23d906cb1e86ce374dc94ca5df. vulnerability
- CVE-2026-114398 Trudesk through 1.2.11 contains an unrestricted file upload vulnerability that allows any authenticated user to place HTML or SVG files in… vulnerability
Referenced by CWE · can precede (3)
Referenced by CWE · has member (9)
- CWE-1200 Weaknesses in the 2019 CWE Top 25 Most Dangerous Software Errors view
- CWE-1337 Weaknesses in the 2021 CWE Top 25 Most Dangerous Software Weaknesses view
- CWE-1340 CISQ Data Protection Measures view
- CWE-1350 Weaknesses in the 2020 CWE Top 25 Most Dangerous Software Weaknesses view
- CWE-1387 Weaknesses in the 2022 CWE Top 25 Most Dangerous Software Weaknesses view
- CWE-1425 Weaknesses in the 2023 CWE Top 25 Most Dangerous Software Weaknesses view
- CWE-1430 Weaknesses in the 2024 CWE Top 25 Most Dangerous Software Weaknesses view
- CWE-1435 Weaknesses in the 2025 CWE Top 25 Most Dangerous Software Weaknesses view
- CWE-884 CWE Cross-section view
Referenced by CWE · peer of (2)
Referenced by OWASP · mapped cwe (3)
- A06:2025 Insecure Design Top 10 2025
- A04:2021 Insecure Design Top 10 2021
- CS-File_Upload File Upload Cheat Sheet Cheat Sheet