Logo
-

Byte Open Security

(ByteOS Network)

Log In

Sign Up

ByteOS

Security
Vulnerability Details
Registries
Custom Views
Weaknesses
Attack Patterns
Filters & Tools
CWE-241:Improper Handling of Unexpected Data Type
Weakness ID:241
Version:v4.17
Weakness Name:Improper Handling of Unexpected Data Type
Vulnerability Mapping:Allowed
Abstraction:Base
Structure:Simple
Status:Draft
Likelihood of Exploit:
DetailsContent HistoryObserved CVE ExamplesReports
▼Description

The product does not handle or incorrectly handles when a particular element is not the expected type, e.g. it expects a digit (0-9) but is provided with a letter (A-Z).

▼Extended Description

▼Alternate Terms
▼Relationships
Relevant to the view"Research Concepts - (1000)"
NatureMappingTypeIDName
ChildOfAllowed-with-ReviewC228Improper Handling of Syntactically Invalid Structure
Nature: ChildOf
Mapping: Allowed-with-Review
Type: Class
ID: 228
Name: Improper Handling of Syntactically Invalid Structure
▼Memberships
NatureMappingTypeIDName
MemberOfProhibitedC19Data Processing Errors
MemberOfProhibitedC743CERT C Secure Coding Standard (2008) Chapter 10 - Input Output (FIO)
MemberOfProhibitedC877CERT C++ Secure Coding Section 09 - Input Output (FIO)
MemberOfProhibitedC993SFP Secondary Cluster: Incorrect Input Handling
MemberOfProhibitedC1163SEI CERT C Coding Standard - Guidelines 09. Input Output (FIO)
MemberOfProhibitedC1407Comprehensive Categorization: Improper Neutralization
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 19
Name: Data Processing Errors
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 743
Name: CERT C Secure Coding Standard (2008) Chapter 10 - Input Output (FIO)
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 877
Name: CERT C++ Secure Coding Section 09 - Input Output (FIO)
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 993
Name: SFP Secondary Cluster: Incorrect Input Handling
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 1163
Name: SEI CERT C Coding Standard - Guidelines 09. Input Output (FIO)
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 1407
Name: Comprehensive Categorization: Improper Neutralization
▼Tags
NatureMappingTypeIDName
MemberOfProhibitedBSBOSS-279Input Validation Strategy
MemberOfProhibitedBSBOSS-294Not Language-Specific Weaknesses
MemberOfProhibitedBSBOSS-315Unexpected State (impact)
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-315
Name: Unexpected State (impact)
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-326
Name: Varies by Context (impact)
▼Relevant To View
Relevant to the view"Weaknesses Addressed by the SEI CERT C Coding Standard - (1154)"
NatureMappingTypeIDName
MemberOfProhibitedC1163SEI CERT C Coding Standard - Guidelines 09. Input Output (FIO)
Nature: MemberOf
Mapping: Prohibited
Type: Category
ID: 1163
Name: SEI CERT C Coding Standard - Guidelines 09. Input Output (FIO)
Relevant to the view"Software Development - (699)"
NatureMappingTypeIDName
MemberOfProhibitedC19Data Processing Errors
Nature: MemberOf
Mapping: Prohibited
Type: Category
ID: 19
Name: Data Processing Errors
Relevant to the view"Software Fault Pattern (SFP) Clusters - (888)"
NatureMappingTypeIDName
MemberOfProhibitedC993SFP Secondary Cluster: Incorrect Input Handling
Nature: MemberOf
Mapping: Prohibited
Type: Category
ID: 993
Name: SFP Secondary Cluster: Incorrect Input Handling
▼Background Detail

▼Common Consequences
ScopeLikelihoodImpactNote
IntegrityOtherN/AVaries by ContextUnexpected State
N/A
Scope: Integrity, Other
Likelihood: N/A
Impact: Varies by Context, Unexpected State
Note:
N/A
▼Potential Mitigations
Phase:Implementation
Mitigation ID: MIT-5
Strategy: Input Validation
Effectiveness:
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:


Phase:Implementation
Mitigation ID: MIT-20
Strategy: Input Validation
Effectiveness:
Description:

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.

Note:

▼Modes Of Introduction
Phase: Implementation
Note:

N/A

▼Applicable Platforms
Languages
Class: Not Language-Specific(Undetermined Prevalence)
▼Demonstrative Examples
▼Observed Examples
ReferenceDescription
CVE-1999-1156
FTP server crash via PORT command with non-numeric character.
CVE-2004-0270
Anti-virus product has assert error when line length is non-numeric.
Reference: CVE-1999-1156
Description:
FTP server crash via PORT command with non-numeric character.
Reference: CVE-2004-0270
Description:
Anti-virus product has assert error when line length is non-numeric.
▼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
      Research Gap

      Probably under-studied.

      N/A

      ▼Taxonomy Mappings
      Taxonomy NameEntry IDFitEntry Name
      PLOVERN/AN/AWrong Data Type
      CERT C Secure CodingFIO37-CCWE More AbstractDo not assume that fgets() or fgetws() returns a nonempty string when successful
      Taxonomy Name: PLOVER
      Entry ID: N/A
      Fit: N/A
      Entry Name: Wrong Data Type
      Taxonomy Name: CERT C Secure Coding
      Entry ID: FIO37-C
      Fit: CWE More Abstract
      Entry Name: Do not assume that fgets() or fgetws() returns a nonempty string when successful
      ▼Related Attack Patterns
      IDName
      CAPEC-48
      Passing Local Filenames to Functions That Expect a URL
      ID: CAPEC-48
      Name: Passing Local Filenames to Functions That Expect a URL
      ▼References
      Details not found