Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CWE-434 (危险类型文件的不加限制上传) — Vulnerability Class 2034

2034 vulnerabilities classified as CWE-434 (危险类型文件的不加限制上传). AI Chinese analysis included.

CWE-434 represents a critical input validation weakness where applications permit the upload of file types that are inherently dangerous or automatically processed by the system. Attackers typically exploit this vulnerability by uploading malicious scripts, such as web shells or executable binaries, disguised as legitimate documents or images. Once uploaded, these files are executed by the server, granting the attacker remote code execution capabilities and potentially full system compromise. To mitigate this risk, developers must implement strict allowlists that define only the specific, safe file extensions permitted for upload. Additionally, files should be stored outside the web root directory to prevent direct execution, and content verification techniques, such as checking file headers rather than relying solely on extensions, should be employed to ensure integrity and prevent evasion of basic validation checks.

MITRE CWE Description
The product allows the upload or transfer of dangerous file types that are automatically processed within its environment.
Common Consequences (1)
Integrity, Confidentiality, AvailabilityExecute 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 spec…
Mitigations (5)
Architecture and DesignGenerate 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 DesignWhen 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 DesignConsider storing the uploaded files outside of the web document root entirely. Then, use other mechanisms to deliver the files dynamically. [REF-423]
ImplementationAssume 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…
Architecture and DesignDefine 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.
Examples (2)
The following code intends to allow a user to upload a picture to the web server. The HTML code that drives the form on the user end has an input field of type "file".
<form action="upload_picture.php" method="post" enctype="multipart/form-data"> Choose a file to upload: <input type="file" name="filename"/> <br/> <input type="submit" name="submit" value="Submit"/> </form>
Good · HTML
// Define the target location where the picture being // uploaded is going to be saved. $target = "pictures/" . basename($_FILES['uploadedfile']['name']); // Move the uploaded file to the new location. if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target)) { echo "The picture has been successfully uploaded."; } else { echo "There was an error uploading the picture, please try again."; }
Bad · PHP
The following code demonstrates the unrestricted upload of a file with a Java servlet and a path traversal vulnerability. The action attribute of an HTML form is sending the upload file request to the Java servlet.
<form action="FileUploadServlet" method="post" enctype="multipart/form-data"> Choose a file to upload: <input type="file" name="filename"/> <br/> <input type="submit" name="submit" value="Submit"/> </form>
Good · HTML
public class FileUploadServlet extends HttpServlet { ... protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); PrintWriter out = response.getWriter(); String contentType = request.getContentType(); // the starting position of the boundary header int ind = contentType.indexOf("boundary="); String boundary = contentType.substring(ind+9); String pLine = new String(); String uploadLocation = new String(UPLOAD_DIRECTORY_STRING); //Constant value // verify that content type is multipart form data i
Bad · Java
CVE IDTitleCVSSSeverityPublished
CVE-2021-21351 XStream is vulnerable to an Arbitrary Code Execution attack — xstream 5.4 Medium2021-03-22
CVE-2021-21344 XStream is vulnerable to an Arbitrary Code Execution attack — xstream 5.3 Medium2021-03-22
CVE-2021-21346 XStream is vulnerable to an Arbitrary Code Execution attack — xstream 6.1 Medium2021-03-22
CVE-2021-21347 XStream is vulnerable to an Arbitrary Code Execution attack — xstream 6.1 Medium2021-03-22
CVE-2021-24145 Modern Events Calendar Lite < 5.16.5 - Authenticated Arbitrary File Upload leading to RCE — Modern Events Calendar Lite 7.2 -2021-03-18
CVE-2021-24123 PowerPress < 8.3.8 - Authenticated Arbitrary File Upload leading to RCE — PowerPress 7.2 -2021-03-18
CVE-2020-7847 ipTIME NAS 代码问题漏洞 — ipTIME NAS 7.4 High2021-02-23
CVE-2021-21014 Magento Commerce Arbitrary Folder Empty Could Lead To Arbitrary Code Execution — Magento Commerce 9.1 -2021-02-11
CVE-2021-22698 Schneider Electric EcoStruxure Power Build - Rapsody 代码问题漏洞 — EcoStruxure Power Build - Rapsody software V2.1.13 and prior. 7.8 -2021-01-25
CVE-2021-22697 Schneider Electric EcoStruxure Power Build - Rapsody 代码问题漏洞 — EcoStruxure Power Build - Rapsody software V2.1.13 and prior. 7.8 -2021-01-25
CVE-2021-21245 Pre-Auth Arbitrary File Upload — onedev 10.0 Critical2021-01-15
CVE-2020-26286 Arbitary file upload — hedgedoc 7.5 High2020-12-28
CVE-2020-26255 PHP Phar archives could be uploaded and executed in Kirby — kirby 6.8 Medium2020-12-08
CVE-2020-7569 Schneider Electric EcoStruxure Building Operation WebReports 代码问题漏洞 — EcoStruxure Building Operation WebReports V1.9 - V3.1 8.8 -2020-11-19
CVE-2020-24407 Arbitrary code execution via file import functionality — Magento Commerce 9.1 Critical2020-11-09
CVE-2020-15277 Remote Code Execution in baserCMS — basercms 7.2 High2020-10-30
CVE-2020-8260 Pulse Secure Pulse Connect Secure 代码问题漏洞 — Pulse Connect Secure / Pulse Policy Secure 7.2 -2020-10-28
CVE-2020-3436 Cisco Adaptive Security Appliance Software and Firepower Threat Defense Software Web Services File Upload Denial of Service Vulnerability — Cisco Adaptive Security Appliance (ASA) Software 8.6 -2020-10-21
CVE-2019-1888 Cisco Unified Contact Center Express Privilege Escalation Vulnerability — Cisco Unified Contact Center Express 7.2 -2020-09-23
CVE-2020-15189 Remote Code Execution in SOY CMS — soycms 6.8 Medium2020-09-18
CVE-2020-6288 SAP Business Objects Business Intelligence Platform 代码问题漏洞 — SAP Business Objects Business Intelligence Platform (Web Intelligence HTML interface) 6.5 -2020-09-09
CVE-2020-15645 Marvell QConvergeConsole 代码问题漏洞 — QConvergeConsole 8.8 -2020-08-25
CVE-2020-7302 DLP ePO extension - Unrestricted Upload of File with Dangerous Type — DLP ePO extension 5.4 Medium2020-08-13
CVE-2020-14488 OpenClinic GA — OpenClinic GA 8.8 High2020-07-29
CVE-2020-12005 多款Rockwell Automation产品代码问题漏洞 — FactoryTalk Linx, RSLinx Classic, Connected Components Workbench, ControlFLASH Plus, FactoryTalk Asset Centre, FactoryTalk Linx CommDTM, Studio 5000 Launcher, Studio 5000 Logix Designer software 9.1 -2020-06-15
CVE-2020-11011 RCE via file upload in Phproject — Phproject 9.9 Critical2020-04-22
CVE-2020-10621 Advantech WebAccess/NMS 代码问题漏洞 — WebAccess/NMS 9.8 -2020-04-09
CVE-2020-6008 WordPress LifterLMS插件代码问题漏洞 — LifterLMS Wordpress Plugin 9.8 -2020-03-31
CVE-2020-8866 Horde Groupware Webmail 代码问题漏洞 — Groupware Webmail Edition 8.1 -2020-03-23
CVE-2020-6975 Digi International ConnectPort LTS 32 MEI 代码问题漏洞 — Digi International ConnectPort LTS 32 MEI 8.1 -2020-02-12

Vulnerabilities classified as CWE-434 (危险类型文件的不加限制上传) represent 2034 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.