Reliance on IP Address for Authentication

Incomplete Variant
Structure: Simple
Description

This vulnerability occurs when a system uses a client's IP address as the sole or primary method to verify their identity.

Extended Description

Relying solely on an IP address for authentication is a significant security risk because these addresses are not reliable proof of identity. Attackers can easily forge, or 'spoof,' the source IP address in the network packets they send. While this manipulation makes response packets return to the faked address, a determined attacker can intercept this return traffic, especially if they are on the same network segment as the target system. Therefore, an IP address should only ever be used as one component within a broader, multi-factor authentication strategy. It can provide a useful layer of context, such as for geolocation or anomaly detection, but it must be combined with stronger credentials like API keys, tokens, or certificates. Using it alone is equivalent to trusting a return address on an envelope as definitive proof of the sender's identity.

Common Consequences 1
Scope: Access ControlNon-Repudiation

Impact: Hide ActivitiesGain Privileges or Assume Identity

Malicious users can fake authentication information, impersonating any IP address.

Potential Mitigations 1
Phase: Architecture and Design
Use other means of identity verification that cannot be simply spoofed. Possibilities include a username/password or certificate.
Demonstrative Examples 1

ID : DX-99

Both of these examples check if a request is from a trusted address before responding to the request.

Code Example:

Bad
C
c

Code Example:

Bad
Java
java
The code only verifies the address as stored in the request packet. An attacker can spoof this address, thus impersonating a trusted client.
Observed Examples 1
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.
References 2
The CLASP Application Security Process
Secure Software, Inc.
2005
ID: REF-18
IP address spoofing
Wikipedia
07-04-2006
ID: REF-1371
Likelihood of Exploit

High

Applicable Platforms
Languages:
Not Language-Specific : Undetermined
Modes of Introduction
Architecture and Design
Related Attack Patterns
Taxonomy Mapping
  • CLASP