Logo
-

Byte Open Security

(ByteOS Network)

Log In

Sign Up

ByteOS

Security
Vulnerability Details
Registries
Custom Views
Weaknesses
Attack Patterns
Filters & Tools
CWE-790:Improper Filtering of Special Elements
Weakness ID:790
Version:v4.17
Weakness Name:Improper Filtering of Special Elements
Vulnerability Mapping:Allowed-with-Review
Abstraction:Class
Structure:Simple
Status:Incomplete
Likelihood of Exploit:
DetailsContent HistoryObserved CVE ExamplesReports
▼Description

The product receives data from an upstream component, but does not filter or incorrectly filters special elements before sending it to a downstream component.

▼Extended Description

▼Alternate Terms
▼Relationships
Relevant to the view"Research Concepts - (1000)"
NatureMappingTypeIDName
ChildOfDiscouragedC138Improper Neutralization of Special Elements
ParentOfAllowedB791Incomplete Filtering of Special Elements
Nature: ChildOf
Mapping: Discouraged
Type: Class
ID: 138
Name: Improper Neutralization of Special Elements
Nature: ParentOf
Mapping: Allowed
Type: Base
ID: 791
Name: Incomplete Filtering of Special Elements
▼Memberships
NatureMappingTypeIDName
MemberOfProhibitedC1019Validate Inputs
MemberOfProhibitedC1407Comprehensive Categorization: Improper Neutralization
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 1019
Name: Validate Inputs
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 1407
Name: Comprehensive Categorization: Improper Neutralization
▼Tags
NatureMappingTypeIDName
MemberOfProhibitedBSBOSS-315Unexpected State (impact)
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-315
Name: Unexpected State (impact)
▼Relevant To View
Relevant to the view"Architectural Concepts - (1008)"
NatureMappingTypeIDName
MemberOfProhibitedC1019Validate Inputs
Nature: MemberOf
Mapping: Prohibited
Type: Category
ID: 1019
Name: Validate Inputs
▼Background Detail

▼Common Consequences
ScopeLikelihoodImpactNote
IntegrityN/AUnexpected State
N/A
Scope: Integrity
Likelihood: N/A
Impact: Unexpected State
Note:
N/A
▼Potential Mitigations
▼Modes Of Introduction
Phase: Implementation
Note:

REALIZATION: This weakness is caused during implementation of an architectural security tactic.

▼Applicable Platforms
▼Demonstrative Examples
Example 1

The following code takes untrusted input and uses a regular expression to filter "../" from the input. It then appends this result to the /home/user/ directory and attempts to read the file in the final resulting path.

Language: ( code)
N/A

Language: Perl(Bad code)
my $Username = GetUntrustedInput(); $Username =~ s/\.\.\///; my $filename = "/home/user/" . $Username; ReadAndSendFile($filename);

Language: ( code)
N/A

Since the regular expression does not have the /g global match modifier, it only removes the first instance of "../" it comes across. So an input value such as:

Language: (Attack code)
../../../etc/passwd

Language: ( code)
N/A

will have the first "../" stripped, resulting in:

Language: (Result code)
../../etc/passwd

Language: ( code)
N/A

This value is then concatenated with the /home/user/ directory:

Language: (Result code)
/home/user/../../etc/passwd

Language: ( code)
N/A

which causes the /etc/passwd file to be retrieved once the operating system has resolved the ../ sequences in the pathname. This leads to relative path traversal (CWE-23).

▼Observed Examples
ReferenceDescription
▼Affected Resources
    ▼Functional Areas
      ▼Weakness Ordinalities
      OrdinalityDescription
      ▼Detection Methods
      ▼Vulnerability Mapping Notes
      Usage:Allowed-with-Review
      Reason:Abstraction
      Rationale:

      This CWE entry is a Class and might have Base-level children that would be more appropriate

      Comments:

      Examine children of this entry to see if there is a better fit

      Suggestions:
      ▼Notes
      ▼Taxonomy Mappings
      Taxonomy NameEntry IDFitEntry Name
      ▼Related Attack Patterns
      IDName
      ▼References
      Details not found