CWE•Class•Stable•20 recent CVEs
CWE-20Improper Input Validation
Description
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.
[object Object]
Common consequences
- Availability→DoS: Crash, Exit, or Restart,DoS: Resource Consumption (CPU),DoS: Resource Consumption (Memory)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.
- Confidentiality→Read Memory,Read Files or DirectoriesAn attacker could read confidential data if they are able to control resource references.
- Integrity,Confidentiality,Availability→Modify Memory,Execute Unauthorized Code or CommandsAn attacker could use malicious input to modify data or possibly alter control flow in unexpected ways, including arbitrary command execution.
Potential mitigations
- Architecture and DesignConsider using language-theoretic security (LangSec) techniques that characterize inputs using a formal language and build "recognizers" for that language. This effectively requires parsing to be a distinct layer that effectively enforces a boundary between raw input and internal data representations, instead of allowing parser code to be scattered throughout the program, where it could be subject
- Architecture and DesignUse an input validation framework such as Struts or the OWASP ESAPI Validation API. Note that using a framework does not automatically address all input validation problems; be mindful of weaknesses that could arise from misusing the framework itself (CWE-1173).
- Architecture and Design,ImplementationUnderstand all the potential areas where untrusted inputs can enter the product, including but not limited to: parameters or arguments, cookies, anything read from the network, environment variables, reverse DNS lookups, query results, request headers, URL components, e-mail, files, filenames, databases, and any external systems that provide data to the application. Remember that such inputs may b
- Implementation[object Object]
- Architecture and Design[object Object]
- ImplementationWhen your application combines data from multiple sources, perform the validation after the sources have been combined. The individual data elements may pass the validation step but violate the intended restrictions after they have been combined.
- ImplementationBe especially careful to validate all input when invoking code that crosses language boundaries, such as from an interpreted language to native code. This could create an unexpected interaction between the language boundaries. Ensure that you are not violating any of the expectations of the language with which you are interfacing. For example, even though Java may not be susceptible to buffer over
- ImplementationDirectly convert your input type into the expected data type, such as using a conversion function that translates a string into a number. After converting to the expected data type, ensure that the input's values fall within the expected range of allowable values and that multi-field consistencies are maintained.
- Implementation[object Object]
- ImplementationWhen exchanging data between components, ensure that both components are using the same character encoding. Ensure that the proper encoding is applied at each interface. Explicitly set the encoding you are using whenever the protocol allows you to do so.
Related CWEs
CWE-707Improper NeutralizationCWE-345Insufficient Verification of Data AuthenticityCWE-22Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')CWE-41Improper Resolution of Path EquivalenceCWE-74Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')CWE-119Improper Restriction of Operations within the Bounds of a Memory BufferCWE-770Allocation of Resources Without Limits or Throttling
Recent CVEs classified under this CWE
CVE-2026-117012026-06-09CVE-2026-116972026-06-09CVE-2026-116913.12026-06-09CVE-2026-116892026-06-09CVE-2026-116863.12026-06-09CVE-2026-116854.32026-06-09CVE-2026-116822026-06-09CVE-2026-116762026-06-09CVE-2026-116753.12026-06-09CVE-2026-116662026-06-09CVE-2026-116602026-06-09CVE-2026-116592026-06-09CVE-2026-116582026-06-09CVE-2026-116532026-06-09CVE-2026-492342026-06-08CVE-2026-474302026-06-08CVE-2026-114607.32026-06-07CVE-2026-463576.52026-06-05CVE-2026-452917.52026-06-05CVE-2026-87142026-06-05