| Impact | Details |
|---|---|
|
Bypass Protection Mechanism; Execute Unauthorized Code or Commands |
Scope: Access Control, Integrity
An attacker could include dangerous input that bypasses validation protection mechanisms which can be used to launch various attacks including injection attacks, execute arbitrary code or cause other unintended behavior.
|
| Phase(s) | Mitigation |
|---|---|
|
Implementation |
Strategy: Input Validation Inputs should be decoded and canonicalized to the application's current internal representation before being validated (CWE-180). Make sure that the application does not decode the same input twice (CWE-174). Such errors could be used to bypass allowlist validation schemes by introducing dangerous inputs after they have been checked.
|
| Nature | Type | ID | Name |
|---|---|---|---|
| ChildOf | Class Class - a weakness that is described in a very abstract fashion, typically independent of any specific language or technology. More specific than a Pillar Weakness, but more general than a Base Weakness. Class level weaknesses typically describe issues in terms of 1 or 2 of the following dimensions: behavior, property, and resource. | 20 | Improper Input Validation |
| ChildOf | Class Class - a weakness that is described in a very abstract fashion, typically independent of any specific language or technology. More specific than a Pillar Weakness, but more general than a Base Weakness. Class level weaknesses typically describe issues in terms of 1 or 2 of the following dimensions: behavior, property, and resource. | 696 | Incorrect Behavior Order |
| ParentOf | Variant Variant - a weakness that is linked to a certain type of product, typically involving a specific language or technology. More specific than a Base weakness. Variant level weaknesses typically describe issues in terms of 3 to 5 of the following dimensions: behavior, property, technology, language, and resource. | 180 | Incorrect Behavior Order: Validate Before Canonicalize |
| ParentOf | Variant Variant - a weakness that is linked to a certain type of product, typically involving a specific language or technology. More specific than a Base weakness. Variant level weaknesses typically describe issues in terms of 3 to 5 of the following dimensions: behavior, property, technology, language, and resource. | 181 | Incorrect Behavior Order: Validate Before Filter |
| Phase | Note |
|---|---|
| Implementation | Since early validation errors usually arise from improperly implemented defensive mechanisms, it is likely that these will be introduced more frequently as secure programming becomes implemented more widely. |
Class: Not Language-Specific (Undetermined Prevalence)
Example 1
The following code attempts to validate a given input path by checking it against an allowlist and then return the canonical path. In this specific case, the path is considered valid if it starts with the string "/safe_dir/".
The problem with the above code is that the validation step occurs before canonicalization occurs. An attacker could provide an input path of "/safe_dir/../" that would pass the validation step. However, the canonicalization process sees the double dot as a traversal to the parent directory and hence when canonicized the path would become just "/".
To avoid this problem, validation should occur after canonicalization takes place. In this case canonicalization occurs during the initialization of the File object. The code below fixes the issue.
Example 2
This script creates a subdirectory within a user directory and sets the user as the owner.
While the script attempts to screen for '..' sequences, an attacker can submit a directory path including ".~.", which will then become ".." after the filtering step. This allows a Path Traversal (CWE-21) attack to occur.
Note: this is a curated list of examples for users to understand the variety of ways in which this weakness can be introduced. It is not a complete list of all CVEs that are related to this CWE entry.
| Reference | Description |
|---|---|
|
Product allows remote attackers to view restricted files via an HTTP request containing a "*" (wildcard or asterisk) character.
|
|
|
Product modifies the first two letters of a filename extension after performing a security check, which allows remote attackers to bypass authentication via a filename with a .ats extension instead of a .hts extension.
|
|
|
Database consumes an extra character when processing a character that cannot be converted, which could remove an escape character from the query and make the application subject to SQL injection attacks.
|
|
|
Overlaps "fakechild/../realchild"
|
|
|
Product checks URI for "<" and other literal characters, but does it before hex decoding the URI, so "%3E" and other sequences are allowed.
|
|
|
Directory traversal vulnerability allows remote attackers to read or modify arbitrary files via invalid characters between two . (dot) characters, which are filtered and result in a ".." sequence.
|
|
|
Directory traversal vulnerability allows attackers to overwrite arbitrary files via invalid characters between two . (dot) characters, which are filtered and result in a ".." sequence.
|
| Nature | Type | ID | Name |
|---|---|---|---|
| MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 722 | OWASP Top Ten 2004 Category A1 - Unvalidated Input |
| MemberOf | ViewView - a subset of CWE entries that provides a way of examining CWE content. The two main view structures are Slices (flat lists) and Graphs (containing relationships between entries). | 884 | CWE Cross-section |
| MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 992 | SFP Secondary Cluster: Faulty Input Transformation |
| MemberOf | CategoryCategory - a CWE entry that contains a set of other entries that share a common characteristic. | 1410 | Comprehensive Categorization: Insufficient Control Flow Management |
Rationale
This CWE entry is at the Base level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.Comments
Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.Research Gap
| Mapped Taxonomy Name | Node ID | Fit | Mapped Node Name |
|---|---|---|---|
| PLOVER | Early Validation Errors |
| Submissions | |||
|---|---|---|---|
| Submission Date | Submitter | Organization | |
|
2006年07月19日
(CWE Draft 3, 2006年07月19日) |
PLOVER | ||
| Modifications | |||
| Modification Date | Modifier | Organization | |
| 2023年06月29日 | CWE Content Team | MITRE | |
| updated Mapping_Notes | |||
| 2023年04月27日 | CWE Content Team | MITRE | |
| updated Relationships | |||
| 2023年01月31日 | CWE Content Team | MITRE | |
| updated Description | |||
| 2020年06月25日 | CWE Content Team | MITRE | |
| updated Demonstrative_Examples, Potential_Mitigations, Relationships | |||
| 2020年02月24日 | CWE Content Team | MITRE | |
| updated Relationships | |||
| 2017年11月08日 | CWE Content Team | MITRE | |
| updated Applicable_Platforms | |||
| 2017年01月19日 | CWE Content Team | MITRE | |
| updated Relationships | |||
| 2014年07月30日 | CWE Content Team | MITRE | |
| updated Relationships | |||
| 2012年05月11日 | CWE Content Team | MITRE | |
| updated Common_Consequences, Demonstrative_Examples, Observed_Examples, References, Relationships | |||
| 2011年06月01日 | CWE Content Team | MITRE | |
| updated Common_Consequences | |||
| 2011年03月29日 | CWE Content Team | MITRE | |
| updated Potential_Mitigations | |||
| 2010年06月21日 | CWE Content Team | MITRE | |
| updated Research_Gaps | |||
| 2009年03月10日 | CWE Content Team | MITRE | |
| updated Relationships | |||
| 2008年10月14日 | CWE Content Team | MITRE | |
| updated Description | |||
| 2008年09月08日 | CWE Content Team | MITRE | |
| updated Modes_of_Introduction, Relationships, Taxonomy_Mappings | |||
| 2008年08月15日 | Veracode | ||
| Suggested OWASP Top Ten 2004 mapping | |||
| 2008年07月01日 | Eric Dalci | Cigital | |
| updated Potential_Mitigations, Time_of_Introduction | |||
| Previous Entry Names | |||
| Change Date | Previous Entry Name | ||
| 2008年04月11日 | Early Validation Errors | ||
Use of the Common Weakness Enumeration (CWE™) and the associated references from this website are subject to the Terms of Use. CWE is sponsored by the U.S. Department of Homeland Security (DHS) Cybersecurity and Infrastructure Security Agency (CISA) and managed by the Homeland Security Systems Engineering and Development Institute (HSSEDI) which is operated by The MITRE Corporation (MITRE). Copyright © 2006–2025, The MITRE Corporation. CWE, CWSS, CWRAF, and the CWE logo are trademarks of The MITRE Corporation.