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.
Potential Impact
Access Control
Bypass Protection Mechanism, Gain Privileges or Assume Identity
Demonstrative Examples
$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;}$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'];}
...Real-World CVE Examples
| CVE ID | Description |
|---|---|
| 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. |
Related Weaknesses
Taxonomy Mappings
- PLOVER: — Use of Less Trusted Source
Frequently Asked Questions
What is CWE-348?
CWE-348 (Use of Less Trusted Source) is a software weakness identified by MITRE's Common Weakness Enumeration. It is classified as a Base-level weakness. 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.
How can CWE-348 be exploited?
Attackers can exploit CWE-348 (Use of Less Trusted Source) to bypass protection mechanism, gain privileges or assume identity. This weakness is typically introduced during the Architecture and Design, Implementation phase of software development.
How do I prevent CWE-348?
Follow secure coding practices, conduct code reviews, and use automated security testing tools (SAST/DAST) to detect this weakness early in the development lifecycle.
What is the severity of CWE-348?
CWE-348 is classified as a Base-level weakness (Medium abstraction). It has been observed in 4 real-world CVEs.