Improper Restriction of Communication Channel to Intended Endpoints

Incomplete Class
Structure: Simple
Description

The product establishes a communication channel to (or from) an endpoint for privileged or protected operations, but it does not properly ensure that it is communicating with the correct endpoint.

Extended Description

Attackers might be able to spoof the intended endpoint from a different system or process, thus gaining the same level of access as the intended endpoint. While this issue frequently involves authentication between network-based clients and servers, other types of communication channels and endpoints can have this weakness.

Common Consequences 1
Scope: IntegrityConfidentiality

Impact: Gain Privileges or Assume Identity

If an attacker can spoof the endpoint, the attacker gains all the privileges that were intended for the original endpoint.

Detection Methods 1
Automated Static AnalysisHigh
Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
Demonstrative Examples 2

ID : DX-208

These cross-domain policy files mean to allow Flash and Silverlight applications hosted on other domains to access its data:
Flash crossdomain.xml :

Code Example:

Bad
XML
xml
Silverlight clientaccesspolicy.xml :

Code Example:

Bad
XML
xml
These entries are far too permissive, allowing any Flash or Silverlight application to send requests. A malicious application hosted on any other web site will be able to send requests on behalf of any user tricked into executing it.

ID : DX-112

This Android application will remove a user account when it receives an intent to do so:

Code Example:

Bad
Java
java
This application does not check the origin of the intent, thus allowing any malicious application to remove a user. Always check the origin of an intent, or create an allowlist of trusted applications using the manifest.xml file.
Observed Examples 7
CVE-2022-30319S-bus functionality in a home automation product performs access control using an IP allowlist, which can be bypassed by a forged IP address.
CVE-2022-22547A troubleshooting tool exposes a web server on a random port between 9000-65535 that could be used for information gathering
CVE-2022-4390A WAN interface on a router has firewall restrictions enabled for IPv4, but it does not for IPv6, which is enabled by default
CVE-2012-2292Product has a Silverlight cross-domain policy that does not restrict access to another application, which allows remote attackers to bypass the Same Origin Policy.
CVE-2012-5810Mobile banking application does not verify hostname, leading to financial loss.
CVE-2014-1266chain: incorrect "goto" in Apple SSL product bypasses certificate validation, allowing Adversry-in-the-Middle (AITM) attack (Apple "goto fail" bug). Incorrect Control Flow Scoping (Incorrect Control Flow Scoping) -> Dead Code (Dead Code) -> Improper Certificate Validation (Improper Certificate Validation) -> Return of Wrong Status Code (Return of Wrong Status Code) -> Channel Accessible by Non-Endpoint (Channel Accessible by Non-Endpoint).
CVE-2000-1218DNS server can accept DNS updates from hosts that it did not query, leading to cache poisoning
Applicable Platforms
Languages:
Not Language-Specific : Undetermined
Modes of Introduction
Architecture and Design
Related Weaknesses