Logo
-

Byte Open Security

(ByteOS Network)

Log In

Sign Up

ByteOS

Security
Vulnerability Details
Registries
Custom Views
Weaknesses
Attack Patterns
Filters & Tools
CWE-1286:Improper Validation of Syntactic Correctness of Input
Weakness ID:1286
Version:v4.17
Weakness Name:Improper Validation of Syntactic Correctness of Input
Vulnerability Mapping:Allowed
Abstraction:Base
Structure:Simple
Status:Incomplete
Likelihood of Exploit:
DetailsContent HistoryObserved CVE ExamplesReports
▼Description

The product receives input that is expected to be well-formed - i.e., to comply with a certain syntax - but it does not validate or incorrectly validates that the input complies with the syntax.

▼Extended Description

Often, complex inputs are expected to follow a particular syntax, which is either assumed by the input itself, or declared within metadata such as headers. The syntax could be for data exchange formats, markup languages, or even programming languages. When untrusted input is not properly validated for the expected syntax, attackers could cause parsing failures, trigger unexpected errors, or expose latent vulnerabilities that might not be directly exploitable if the input had conformed to the syntax.

▼Alternate Terms
▼Relationships
Relevant to the view"Research Concepts - (1000)"
NatureMappingTypeIDName
ChildOfDiscouragedC20Improper Input Validation
ParentOfAllowedB112Missing XML Validation
Nature: ChildOf
Mapping: Discouraged
Type: Class
ID: 20
Name: Improper Input Validation
Nature: ParentOf
Mapping: Allowed
Type: Base
ID: 112
Name: Missing XML Validation
▼Memberships
NatureMappingTypeIDName
MemberOfProhibitedC1215Data Validation Issues
MemberOfProhibitedC1406Comprehensive Categorization: Improper Input Validation
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 1215
Name: Data Validation Issues
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 1406
Name: Comprehensive Categorization: Improper Input Validation
▼Tags
NatureMappingTypeIDName
MemberOfProhibitedBSBOSS-279Input Validation Strategy
MemberOfProhibitedBSBOSS-294Not Language-Specific Weaknesses
MemberOfProhibitedBSBOSS-326Varies by Context (impact)
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-279
Name: Input Validation Strategy
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-294
Name: Not Language-Specific Weaknesses
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-326
Name: Varies by Context (impact)
▼Relevant To View
Relevant to the view"Software Development - (699)"
NatureMappingTypeIDName
MemberOfProhibitedC1215Data Validation Issues
Nature: MemberOf
Mapping: Prohibited
Type: Category
ID: 1215
Name: Data Validation Issues
▼Background Detail

▼Common Consequences
ScopeLikelihoodImpactNote
OtherN/AVaries by Context
N/A
Scope: Other
Likelihood: N/A
Impact: Varies by Context
Note:
N/A
▼Potential Mitigations
Phase:Implementation
Mitigation ID: MIT-5
Strategy: Input Validation
Effectiveness: High
Description:

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, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."

Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.

Note:

▼Modes Of Introduction
Phase: Implementation
Note:

N/A

▼Applicable Platforms
Languages
Class: Not Language-Specific(Often Prevalence)
▼Demonstrative Examples
Example 1

The following code loads and parses an XML file.

Language: ( code)
N/A

Language: Java(Bad code)
// Read DOM* try { ... DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating( false ); .... c_dom = factory.newDocumentBuilder().parse( xmlFile ); } catch(Exception ex) { ... }

Language: ( code)
N/A

The XML file is loaded without validating it against a known XML Schema or DTD.

▼Observed Examples
ReferenceDescription
CVE-2016-4029
Chain: incorrect validation of intended decimal-based IP address format (CWE-1286) enables parsing of octal or hexadecimal formats (CWE-1389), allowing bypass of an SSRF protection mechanism (CWE-918).
CVE-2007-5893
HTTP request with missing protocol version number leads to crash
Reference: CVE-2016-4029
Description:
Chain: incorrect validation of intended decimal-based IP address format (CWE-1286) enables parsing of octal or hexadecimal formats (CWE-1389), allowing bypass of an SSRF protection mechanism (CWE-918).
Reference: CVE-2007-5893
Description:
HTTP request with missing protocol version number leads to crash
▼Affected Resources
    ▼Functional Areas
      ▼Weakness Ordinalities
      OrdinalityDescription
      ▼Detection Methods
      ▼Vulnerability Mapping Notes
      Usage:Allowed
      Reason:Acceptable-Use
      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.

      Suggestions:
      ▼Notes
      Maintenance

      This entry is still under development and will continue to see updates and content improvements.

      N/A

      ▼Taxonomy Mappings
      Taxonomy NameEntry IDFitEntry Name
      ▼Related Attack Patterns
      IDName
      CAPEC-66
      SQL Injection
      CAPEC-676
      NoSQL Injection
      ID: CAPEC-66
      Name: SQL Injection
      ID: CAPEC-676
      Name: NoSQL Injection
      ▼References
      Details not found