Logo
-

Byte Open Security

(ByteOS Network)

Log In

Sign Up

ByteOS

Security
Vulnerability Details
Registries
Custom Views
Weaknesses
Attack Patterns
Filters & Tools
CWE-348:Use of Less Trusted Source
Weakness ID:348
Version:v4.17
Weakness Name:Use of Less Trusted Source
Vulnerability Mapping:Allowed
Abstraction:Base
Structure:Simple
Status:Draft
Likelihood of Exploit:
DetailsContent HistoryObserved CVE ExamplesReports
▼Description

The product has two different sources of the same data or information, but it uses the source that has less support for verification, is less trusted, or is less resistant to attack.

▼Extended Description

▼Alternate Terms
▼Relationships
Relevant to the view"Research Concepts - (1000)"
NatureMappingTypeIDName
ChildOfDiscouragedC345Insufficient Verification of Data Authenticity
Nature: ChildOf
Mapping: Discouraged
Type: Class
ID: 345
Name: Insufficient Verification of Data Authenticity
▼Memberships
NatureMappingTypeIDName
MemberOfProhibitedV884CWE Cross-section
MemberOfProhibitedC975SFP Secondary Cluster: Architecture
MemberOfProhibitedC1214Data Integrity Issues
MemberOfProhibitedC1411Comprehensive Categorization: Insufficient Verification of Data Authenticity
Nature: MemberOf
Mapping: Prohibited
Type:View
ID: 884
Name: CWE Cross-section
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 975
Name: SFP Secondary Cluster: Architecture
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 1214
Name: Data Integrity Issues
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 1411
Name: Comprehensive Categorization: Insufficient Verification of Data Authenticity
▼Tags
NatureMappingTypeIDName
MemberOfProhibitedBSBOSS-294Not Language-Specific Weaknesses
MemberOfProhibitedBSBOSS-316Bypass Protection Mechanism (impact)
MemberOfProhibitedBSBOSS-332Gain Privileges or Assume Identity (impact)
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-294
Name: Not Language-Specific Weaknesses
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-316
Name: Bypass Protection Mechanism (impact)
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-332
Name: Gain Privileges or Assume Identity (impact)
▼Relevant To View
Relevant to the view"Software Development - (699)"
NatureMappingTypeIDName
MemberOfProhibitedC1214Data Integrity Issues
Nature: MemberOf
Mapping: Prohibited
Type: Category
ID: 1214
Name: Data Integrity Issues
Relevant to the view"Software Fault Pattern (SFP) Clusters - (888)"
NatureMappingTypeIDName
MemberOfProhibitedC975SFP Secondary Cluster: Architecture
Nature: MemberOf
Mapping: Prohibited
Type: Category
ID: 975
Name: SFP Secondary Cluster: Architecture
▼Background Detail

▼Common Consequences
ScopeLikelihoodImpactNote
Access ControlN/ABypass Protection MechanismGain Privileges or Assume Identity

An attacker could utilize the untrusted data source to bypass protection mechanisms and gain access to sensitive data.

Scope: Access Control
Likelihood: N/A
Impact: Bypass Protection Mechanism, Gain Privileges or Assume Identity
Note:

An attacker could utilize the untrusted data source to bypass protection mechanisms and gain access to sensitive data.

▼Potential Mitigations
▼Modes Of Introduction
Phase: Architecture and Design
Note:

N/A

Phase: Implementation
Note:

N/A

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

This code attempts to limit the access of a page to certain IP Addresses. It checks the 'HTTP_X_FORWARDED_FOR' header in case an authorized user is sending the request through a proxy.

Language: ( code)
N/A

Language: PHP(Bad code)
$requestingIP = '0.0.0.0'; if (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER)) { $requestingIP = $_SERVER['HTTP_X_FORWARDED_FOR']; else{ $requestingIP = $_SERVER['REMOTE_ADDR']; } if(in_array($requestingIP,$ipAllowlist)){ generatePage(); return; } else{ echo "You are not authorized to view this page"; return; }

Language: ( code)
N/A

The 'HTTP_X_FORWARDED_FOR' header can be user controlled and so should never be trusted. An attacker can falsify the header to gain access to the page.

Language: ( code)
N/A

This fixed code only trusts the 'REMOTE_ADDR' header and so avoids the issue:

Language: PHP(Good code)
$requestingIP = '0.0.0.0'; if (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER)) { echo "This application cannot be accessed through a proxy."; return; else{ $requestingIP = $_SERVER['REMOTE_ADDR']; } ...*

Language: ( code)
N/A

Be aware that 'REMOTE_ADDR' can still be spoofed. This may seem useless because the server will send the response to the fake address and not the attacker, but this may still be enough to conduct an attack. For example, if the generatePage() function in this code is resource intensive, an attacker could flood the server with fake requests using an authorized IP and consume significant resources. This could be a serious DoS attack even though the attacker would never see the page's sensitive content.

▼Observed Examples
ReferenceDescription
CVE-2001-0860
Product uses IP address provided by a client, instead of obtaining it from the packet headers, allowing easier spoofing.
CVE-2004-1950
Web product uses the IP address in the X-Forwarded-For HTTP header instead of a server variable that uses the connecting IP address, allowing filter bypass.
CVE-2001-0908
Product logs IP address specified by the client instead of obtaining it from the packet headers, allowing information hiding.
CVE-2006-1126
PHP application uses IP address from X-Forwarded-For HTTP header, instead of REMOTE_ADDR.
Reference: CVE-2001-0860
Description:
Product uses IP address provided by a client, instead of obtaining it from the packet headers, allowing easier spoofing.
Reference: CVE-2004-1950
Description:
Web product uses the IP address in the X-Forwarded-For HTTP header instead of a server variable that uses the connecting IP address, allowing filter bypass.
Reference: CVE-2001-0908
Description:
Product logs IP address specified by the client instead of obtaining it from the packet headers, allowing information hiding.
Reference: CVE-2006-1126
Description:
PHP application uses IP address from X-Forwarded-For HTTP header, instead of REMOTE_ADDR.
▼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
      ▼Taxonomy Mappings
      Taxonomy NameEntry IDFitEntry Name
      PLOVERN/AN/AUse of Less Trusted Source
      Taxonomy Name: PLOVER
      Entry ID: N/A
      Fit: N/A
      Entry Name: Use of Less Trusted Source
      ▼Related Attack Patterns
      IDName
      CAPEC-141
      Cache Poisoning
      CAPEC-142
      DNS Cache Poisoning
      CAPEC-73
      User-Controlled Filename
      CAPEC-76
      Manipulating Web Input to File System Calls
      CAPEC-85
      AJAX Footprinting
      ID: CAPEC-141
      Name: Cache Poisoning
      ID: CAPEC-142
      Name: DNS Cache Poisoning
      ID: CAPEC-73
      Name: User-Controlled Filename
      ID: CAPEC-76
      Name: Manipulating Web Input to File System Calls
      ID: CAPEC-85
      Name: AJAX Footprinting
      ▼References
      Details not found