What is CWE-20?
The product accepts input or data without correctly verifying that it has the properties required for safe and correct processing.
The product accepts input or data without correctly verifying that it has the properties required for safe and correct processing.
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
Input validation is a frequently-used technique for checking potentially dangerous inputs in order to ensure that the inputs are safe for processing within the code, or when communicating with other components.
Input can consist of:
raw data - strings, numbers, parameters, file contents, etc.
metadata - information about the raw data, such as headers or size
Data can be simple or structured. Structured data can be composed of many nested layers, composed of combinations of metadata and raw data, with other simple or structured data.
Many properties of raw data or metadata may need to be validated upon entry into the code, such as:
specified quantities such as size, length, frequency, price, rate, number of operations, time, etc.
implied or derived quantities, such as the actual size of a file instead of a specified size
indexes, offsets, or positions into more complex data structures
symbolic keys or other elements into hash tables, associative arrays, etc.
well-formedness, i.e. syntactic correctness - compliance with expected syntax
lexical token correctness - compliance with rules for what is treated as a token
specified or derived type - the actual type of the input (or what the input appears to be)
consistency - between individual data elements, between raw data and metadata, between references, etc.
conformance to domain-specific rules, e.g. business logic
equivalence - ensuring that equivalent inputs are treated the same
authenticity, ownership, or other attestations about the input, e.g. a cryptographic signature to prove the source of the data
Implied or derived properties of data must often be calculated or inferred by the code itself. Errors in deriving properties may be considered a contributing factor to improper input validation.
Input validation applies to raw data and metadata, including strings, numbers, parameters, file contents, headers, and sizes. Validation may need to establish size and range limits, indexes and offsets, symbolic keys, syntax and lexical correctness, data type, consistency between related values, conformance to business rules, equivalence, and authenticity or ownership claims.
The data may be simple or deeply structured, with nested combinations of metadata and raw values. Properties that are implied or derived by the application must also be calculated correctly. Validation failures can occur when developers trust client-side checks, cookies, hidden fields, or other inputs that an attacker can modify, or when validation is incomplete, occurs before data from multiple sources is combined, or is bypassed through decoding and representation differences.
This weakness is a broad validation failure rather than a problem limited to one input format. It can affect network data, request parameters and headers, cookies, environment variables, reverse DNS results, URL components, email, files and filenames, databases, API results, and data supplied by external systems. The failure may involve missing values, extra values, malformed syntax, invalid types, out-of-range quantities, inconsistent length or size fields, unsafe references, or violations of domain-specific rules.
It is commonly introduced during architecture and design when trust boundaries are misunderstood, and during implementation when checks are omitted or applied inconsistently. It is especially important at component interfaces, language boundaries, and transitions between external representations and internal data.
Depending on the input and the affected component, an attacker may cause crashes, restarts, excessive CPU or memory consumption, or other denial of service. Control over resource references may expose memory, files, or directories. Malicious input may also modify memory or data, alter control flow, or result in unauthorized code or command execution.
| Impact | Scope | Explanation |
|---|---|---|
| DoS: Crash, Exit, or Restart, DoS: Resource Consumption (CPU), DoS: Resource Consumption (Memory) | Availability | An attacker could provide unexpected values and cause a program crash or arbitrary control of resource allocation, leading to excessive consumption of resources such as memory and CPU. |
| Read Memory, Read Files or Directories | Confidentiality | An attacker could read confidential data if they are able to control resource references. |
| Modify Memory, Execute Unauthorized Code or Commands | Integrity, Confidentiality, Availability | An attacker could use malicious input to modify data or possibly alter control flow in unexpected ways, including arbitrary command execution. |
Architecture and design:
Implementation:
Use multiple complementary approaches because no single method covers all validation rules. Automated static analysis can identify locations where recognized validation methods or frameworks are absent, but may produce false positives when custom validation is not understood. Manual static analysis is necessary for custom rules, especially business logic.
Fuzzing should supply unexpected inputs and verify that the application remains stable and returns application-controlled errors rather than crashes, exceptions, or interpreter-generated messages. The record also identifies binary or bytecode disassembly and weakness analysis, web, web-service, and database scanners, fuzz testers and framework-based fuzzers, host interface scanning, monitored virtual environments, focused source spot checks, manual source review, source-code weakness analyzers, inspections, formal methods, and attack modeling. The SOAR-listed binary, bytecode, and partial-coverage methods are not complete coverage guarantees.
| Method | Approach | Effectiveness |
|---|---|---|
| Automated Static Analysis | Some instances of improper input validation can be detected using automated static analysis. A static analysis tool might allow the user to specify which application-specific methods or functions perform input validation; the tool might also have built-in knowledge of validation frameworks such as Struts. The tool may then suppress or de-prioritize any associated warnings. This allows the analyst to focus on areas of the software in which input validation does not appear to be present. Except in the cases described in the previous paragraph, automated static analysis might not be able to recognize when proper input validation is being performed, leading to false positives - i.e., warnings that do not have any security consequences or require any code changes. | — |
| Manual Static Analysis | When custom input validation is required, such as when enforcing business rules, manual analysis is necessary to ensure that the validation is properly implemented. | — |
| Fuzzing | Fuzzing techniques can be useful for detecting input validation errors. When unexpected inputs are provided to the software, the software should not crash or otherwise become unstable, and it should generate application-controlled error messages. If exceptions or interpreter-generated error messages occur, this indicates that the input was not detected and handled within the application logic itself. | — |
| Automated Static Analysis - Binary or Bytecode | According to SOAR [REF-1479], the following detection techniques may be useful: ``` Cost effective for partial coverage: ``` Bytecode Weakness Analysis - including disassembler + source code weakness analysis Binary Weakness Analysis - including disassembler + source code weakness analysis | SOAR Partial |
| Manual Static Analysis - Binary or Bytecode | According to SOAR [REF-1479], the following detection techniques may be useful: ``` Cost effective for partial coverage: ``` Binary / Bytecode disassembler - then use manual analysis for vulnerabilities & anomalies | SOAR Partial |
| Dynamic Analysis with Automated Results Interpretation | According to SOAR [REF-1479], the following detection techniques may be useful: ``` Highly cost effective: ``` Web Application Scanner Web Services Scanner Database Scanners | High |
| Dynamic Analysis with Manual Results Interpretation | According to SOAR [REF-1479], the following detection techniques may be useful: ``` Highly cost effective: ``` Fuzz Tester Framework-based Fuzzer ``` Cost effective for partial coverage: ``` Host Application Interface Scanner Monitored Virtual Environment - run potentially malicious code in sandbox / wrapper / virtual machine, see if it does anything suspicious | High |
| 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) | High |
| 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 | High |
| Architecture or Design Review | According to SOAR [REF-1479], the following detection techniques may be useful: ``` Highly cost effective: ``` Inspection (IEEE 1028 standard) (can apply to requirements, design, source code, etc.) Formal Methods / Correct-By-Construction ``` Cost effective for partial coverage: ``` Attack Modeling | High |
The official record provides the following representative examples, not an exhaustive list. They include:
CVE-2024-37032: an unvalidated digest format enabled relative path traversal in an LLM management tool.CVE-2022-45918: an improperly validated path enabled traversal using ../ sequences.CVE-2021-30860 and CVE-2021-30663: improper validation led to integer overflow.CVE-2021-22205: validation bypass through a backslash followed by a newline led to eval injection.CVE-2021-21220: insufficient validation led to heap corruption.CVE-2020-9054, CVE-2008-5305, and CVE-2008-1625: insufficient validation enabled command or eval injection and code execution.CVE-2020-3452, CVE-2008-1284, and CVE-2008-3660: validation failures contributed to directory traversal.CVE-2020-3580, CVE-2008-3843, and CVE-2008-2223: validation failures contributed to XSS or SQL injection.Below are representative vulnerabilities related to this CWE, prioritized by severity.
CWE™ Program, operated by The MITRE Corporation. Copyright © 2006–2026, The MITRE Corporation. The MITRE Corporation hereby grants you a non-exclusive, royalty-free license to use CWE for research, development, and commercial purposes. CWE Terms of Use.
CyStack VulnScan continuously discovers assets, validates vulnerabilities, and helps security teams prioritize remediation across the organization.
Explore CyStack VulnScanen