← Back to Labs
Weakness (CWE)
CWE-434
Unrestricted Upload of File with Dangerous Type
About
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
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
- 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]
CVEs with this weakness
Frequently asked questions
What is CWE-434?
The product allows the upload or transfer of dangerous file types that are automatically processed within its environment.
How likely is CWE-434 to be exploited?
MITRE rates the likelihood of exploit for CWE-434 as medium.
Which platforms does CWE-434 affect?
CWE-434 has been observed on: ASP.NET, PHP, Web Server, AI/ML.
How many CVEs does Rainforest track for CWE-434?
Rainforest Labs currently tracks 9 published CVEs mapped to CWE-434. They are listed on this page.
Empower Your Security Strategy with Rainforest
Discover vulnerabilities early, prioritize critical threats, and protect what truly matters. Rainforest streamlines your security operations, saving you time and reducing costs, so you can focus on what drives your business forward.
