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-39221 XSS in Contacts — security-advisories 6.4 Medium2021-10-25
CVE-2021-38471 AUVESY Versiondog — Versiondog 9.1 Critical2021-10-22
CVE-2021-39352 Catch Themes Demo Import <= 1.7 Admin+ Arbitrary File Upload — Catch Themes Demo Import 7.2 High2021-10-21
CVE-2021-3846 Unrestricted Upload of File with Dangerous Type in firefly-iii/firefly-iii — firefly-iii/firefly-iii 8.8 -2021-10-19
CVE-2021-38484 InHand Networks IR615 Router — IR615 Router 9.1 Critical2021-10-19
CVE-2021-41566 Tad TadTools - Arbitrary File Upload — TadTools 9.8 Critical2021-10-08
CVE-2021-3832 Integria IMS Remote Code Execution — Integria IMS 9.8 Critical2021-10-07
CVE-2021-41290 ECOA BAS controller - Path Traversal-1 — ECS Router Controller ECS (FLASH) 9.8 Critical2021-09-30
CVE-2021-24663 Simple School Staff Directory <= 1.1 - Admin+ Arbitrary File Upload — Simple Schools Staff Directory 7.2 -2021-09-20
CVE-2021-33698 SAP Business One 代码问题漏洞 — SAP Business One 8.1 -2021-09-15
CVE-2021-24620 Simple eCommerce <= 2.2.5 - Arbitrary File Upload — WordPress Simple Ecommerce Shopping Cart Plugin- Sell products through Paypal 9.8 -2021-09-13
CVE-2021-24493 Shopp eCommerce <= 1.4 - Unauthenticated Arbitrary File Upload — Shopp 9.8 -2021-09-13
CVE-2021-24490 Email Artillery <= 4.1 - Arbitrary File Upload — Email Artillery (MASS EMAIL) 8.0 -2021-09-13
CVE-2021-32955 Delta Electronics DIAEnergie 代码问题漏洞 — Delta Electronics DIAEnergie 9.8 -2021-08-30
CVE-2021-39149 XStream is vulnerable to an Arbitrary Code Execution attack — xstream 8.5 High2021-08-23
CVE-2021-39148 XStream is vulnerable to an Arbitrary Code Execution attack — xstream 8.5 High2021-08-23
CVE-2021-39147 XStream is vulnerable to an Arbitrary Code Execution attack — xstream 8.5 High2021-08-23
CVE-2021-39146 XStream is vulnerable to an Arbitrary Code Execution attack — xstream 8.5 High2021-08-23
CVE-2021-39145 XStream is vulnerable to an Arbitrary Code Execution attack — xstream 8.5 High2021-08-23
CVE-2021-39141 XStream is vulnerable to an Arbitrary Code Execution attack — xstream 8.5 High2021-08-23
CVE-2021-39153 XStream is vulnerable to an Arbitrary Code Execution attack — xstream 8.5 High2021-08-23
CVE-2021-39151 XStream is vulnerable to an Arbitrary Code Execution attack — xstream 8.5 High2021-08-23
CVE-2021-39154 XStream is vulnerable to an Arbitrary Code Execution attack — xstream 8.5 High2021-08-23
CVE-2021-37608 Arbitrary file upload vulnerability in OFBiz — Apache OFBiz 9.8 -2021-08-18
CVE-2021-22937 Pulse Secure Pulse Connect Secure 代码问题漏洞 — Pulse Connect Secure 6.5 -2021-08-16
CVE-2021-24499 Workreap theme < 2.2.2 - Unauthenticated Upload Leading to Remote Code Execution — Workreap 9.8 -2021-08-09
CVE-2021-35963 Learningdigital.com, Inc. Orca HCM - Unrestricted Upload of File with Dangerous Type — Orca HCM 9.8 Critical2021-07-19
CVE-2021-32538 ARTWARE CMS - Unrestricted Upload of File — CMS 9.8 Critical2021-07-07
CVE-2021-34624 ProfilePress 3.0 - 3.1.3 - Arbitrary File Upload in File Uploader Component — ProfilePress 9.8 Critical2021-07-07
CVE-2021-34623 ProfilePress 3.0 - 3.1.3 - Arbitrary File Upload in Image Uploader Component — ProfilePress 9.8 Critical2021-07-07

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