Logo
-

Byte Open Security

(ByteOS Network)

Log In

Sign Up

ByteOS

Security
Vulnerability Details
Registries
Custom Views
Weaknesses
Attack Patterns
Filters & Tools
CWE-290:Authentication Bypass by Spoofing
Weakness ID:290
Version:v4.17
Weakness Name:Authentication Bypass by Spoofing
Vulnerability Mapping:Allowed
Abstraction:Base
Structure:Simple
Status:Incomplete
Likelihood of Exploit:
DetailsContent HistoryObserved CVE ExamplesReports
▼Description

This attack-focused weakness is caused by incorrectly implemented authentication schemes that are subject to spoofing attacks.

▼Extended Description

▼Alternate Terms
▼Relationships
Relevant to the view"Research Concepts - (1000)"
NatureMappingTypeIDName
ChildOfAllowed-with-ReviewC1390Weak Authentication
ParentOfAllowedV291Reliance on IP Address for Authentication
ParentOfAllowedV293Using Referer Field for Authentication
ParentOfAllowedV350Reliance on Reverse DNS Resolution for a Security-Critical Action
ParentOfAllowedB358Improperly Implemented Security Check for Standard
ParentOfAllowed-with-ReviewC602Client-Side Enforcement of Server-Side Security
Nature: ChildOf
Mapping: Allowed-with-Review
Type: Class
ID: 1390
Name: Weak Authentication
Nature: ParentOf
Mapping: Allowed
Type: Variant
ID: 291
Name: Reliance on IP Address for Authentication
Nature: ParentOf
Mapping: Allowed
Type: Variant
ID: 293
Name: Using Referer Field for Authentication
Nature: ParentOf
Mapping: Allowed
Type: Variant
ID: 350
Name: Reliance on Reverse DNS Resolution for a Security-Critical Action
Nature: ParentOf
Mapping: Allowed
Type: Base
ID: 358
Name: Improperly Implemented Security Check for Standard
Nature: ParentOf
Mapping: Allowed-with-Review
Type: Class
ID: 602
Name: Client-Side Enforcement of Server-Side Security
▼Memberships
NatureMappingTypeIDName
MemberOfProhibitedV884CWE Cross-section
MemberOfProhibitedC956SFP Secondary Cluster: Channel Attack
MemberOfProhibitedC1010Authenticate Actors
MemberOfProhibitedC1211Authentication Errors
MemberOfProhibitedC1353OWASP Top Ten 2021 Category A07:2021 - Identification and Authentication Failures
MemberOfProhibitedC1366ICS Communications: Frail Security in Protocols
MemberOfProhibitedC1396Comprehensive Categorization: Access Control
Nature: MemberOf
Mapping: Prohibited
Type:View
ID: 884
Name: CWE Cross-section
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 956
Name: SFP Secondary Cluster: Channel Attack
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 1010
Name: Authenticate Actors
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 1211
Name: Authentication Errors
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 1353
Name: OWASP Top Ten 2021 Category A07:2021 - Identification and Authentication Failures
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 1366
Name: ICS Communications: Frail Security in Protocols
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 1396
Name: Comprehensive Categorization: Access Control
▼Tags
NatureMappingTypeIDName
MemberOfProhibitedBSBOSS-316Bypass Protection Mechanism (impact)
MemberOfProhibitedBSBOSS-332Gain Privileges or Assume Identity (impact)
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"Architectural Concepts - (1008)"
NatureMappingTypeIDName
MemberOfProhibitedC1010Authenticate Actors
Nature: MemberOf
Mapping: Prohibited
Type: Category
ID: 1010
Name: Authenticate Actors
Relevant to the view"Software Development - (699)"
NatureMappingTypeIDName
MemberOfProhibitedC1211Authentication Errors
Nature: MemberOf
Mapping: Prohibited
Type: Category
ID: 1211
Name: Authentication Errors
Relevant to the view"OWASP Top Ten (2021) - (1344)"
NatureMappingTypeIDName
MemberOfProhibitedC1353OWASP Top Ten 2021 Category A07:2021 - Identification and Authentication Failures
Nature: MemberOf
Mapping: Prohibited
Type: Category
ID: 1353
Name: OWASP Top Ten 2021 Category A07:2021 - Identification and Authentication Failures
Relevant to the view"SEI ETF Categories of Security Vulnerabilities in ICS - (1358)"
NatureMappingTypeIDName
MemberOfProhibitedC1366ICS Communications: Frail Security in Protocols
Nature: MemberOf
Mapping: Prohibited
Type: Category
ID: 1366
Name: ICS Communications: Frail Security in Protocols
Relevant to the view"Software Fault Pattern (SFP) Clusters - (888)"
NatureMappingTypeIDName
MemberOfProhibitedC956SFP Secondary Cluster: Channel Attack
Nature: MemberOf
Mapping: Prohibited
Type: Category
ID: 956
Name: SFP Secondary Cluster: Channel Attack
▼Background Detail

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

This weakness can allow an attacker to access resources which are not otherwise accessible without proper authentication.

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

This weakness can allow an attacker to access resources which are not otherwise accessible without proper authentication.

▼Potential Mitigations
▼Modes Of Introduction
Phase: Implementation
Note:

N/A

▼Applicable Platforms
▼Demonstrative Examples
Example 1

The following code authenticates users.

Language: ( code)
N/A

Language: Java(Bad code)
String sourceIP = request.getRemoteAddr(); if (sourceIP != null && sourceIP.equals(APPROVED_IP)) { authenticated = true; }

Language: ( code)
N/A

The authentication mechanism implemented relies on an IP address for source validation. If an attacker is able to spoof the IP, they may be able to bypass the authentication mechanism.

Example 2

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

Language: ( code)
N/A

Language: C(Bad code)
sd = socket(AF_INET, SOCK_DGRAM, 0); serv.sin_family = AF_INET; serv.sin_addr.s_addr = htonl(INADDR_ANY); servr.sin_port = htons(1008); bind(sd, (struct sockaddr *) & serv, sizeof(serv)); while (1) { memset(msg, 0x0, MAX_MSG); clilen = sizeof(cli); if (inet_ntoa(cli.sin_addr)==getTrustedAddress()) { n = recvfrom(sd, msg, MAX_MSG, 0, (struct sockaddr *) & cli, &clilen); } }

Language: Java(Bad code)
while(true) { DatagramPacket rp=new DatagramPacket(rData,rData.length); outSock.receive(rp); String in = new String(p.getData(),0, rp.getLength()); InetAddress clientIPAddress = rp.getAddress(); int port = rp.getPort(); if (isTrustedAddress(clientIPAddress) & secretKey.equals(in)) { out = secret.getBytes(); DatagramPacket sp =new DatagramPacket(out,out.length, IPAddress, port); outSock.send(sp); } }

Language: ( code)
N/A

The code only verifies the address as stored in the request packet. An attacker can spoof this address, thus impersonating a trusted client.

Example 3

The following code samples use a DNS lookup in order to decide whether or not an inbound request is from a trusted host. If an attacker can poison the DNS cache, they can gain trusted status.

Language: ( code)
N/A

Language: C(Bad code)
struct hostent *hp;struct in_addr myaddr; char* tHost = "trustme.example.com"; myaddr.s_addr=inet_addr(ip_addr_string); hp = gethostbyaddr((char *) &myaddr, sizeof(struct in_addr), AF_INET); if (hp && !strncmp(hp->h_name, tHost, sizeof(tHost))) { trusted = true; } else { trusted = false; }

Language: Java(Bad code)
String ip = request.getRemoteAddr(); InetAddress addr = InetAddress.getByName(ip); if (addr.getCanonicalHostName().endsWith("trustme.com")) { trusted = true; }

Language: C#(Bad code)
IPAddress hostIPAddress = IPAddress.Parse(RemoteIpAddress); IPHostEntry hostInfo = Dns.GetHostByAddress(hostIPAddress); if (hostInfo.HostName.EndsWith("trustme.com")) { trusted = true; }

Language: ( code)
N/A

IP addresses are more reliable than DNS names, but they can also be spoofed. Attackers can easily forge the source IP address of the packets they send, but response packets will return to the forged IP address. To see the response packets, the attacker has to sniff the traffic between the victim machine and the forged IP address. In order to accomplish the required sniffing, attackers typically attempt to locate themselves on the same subnet as the victim machine. Attackers may be able to circumvent this requirement by using source routing, but source routing is disabled across much of the Internet today. In summary, IP address verification can be a useful part of an authentication scheme, but it should not be the single factor required for authentication.

▼Observed Examples
ReferenceDescription
CVE-2022-30319
S-bus functionality in a home automation product performs access control using an IP allowlist, which can be bypassed by a forged IP address.
CVE-2009-1048
VOIP product allows authentication bypass using 127.0.0.1 in the Host header.
Reference: CVE-2022-30319
Description:
S-bus functionality in a home automation product performs access control using an IP allowlist, which can be bypassed by a forged IP address.
Reference: CVE-2009-1048
Description:
VOIP product allows authentication bypass using 127.0.0.1 in the Host header.
▼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
      Relationship

      This can be resultant from insufficient verification.

      N/A

      ▼Taxonomy Mappings
      Taxonomy NameEntry IDFitEntry Name
      PLOVERN/AN/AAuthentication bypass by spoofing
      Taxonomy Name: PLOVER
      Entry ID: N/A
      Fit: N/A
      Entry Name: Authentication bypass by spoofing
      ▼Related Attack Patterns
      IDName
      CAPEC-21
      Exploitation of Trusted Identifiers
      CAPEC-22
      Exploiting Trust in Client
      CAPEC-459
      Creating a Rogue Certification Authority Certificate
      CAPEC-461
      Web Services API Signature Forgery Leveraging Hash Function Extension Weakness
      CAPEC-473
      Signature Spoof
      CAPEC-476
      Signature Spoofing by Misrepresentation
      CAPEC-59
      Session Credential Falsification through Prediction
      CAPEC-60
      Reusing Session IDs (aka Session Replay)
      CAPEC-667
      Bluetooth Impersonation AttackS (BIAS)
      CAPEC-94
      Adversary in the Middle (AiTM)
      ID: CAPEC-21
      Name: Exploitation of Trusted Identifiers
      ID: CAPEC-22
      Name: Exploiting Trust in Client
      ID: CAPEC-459
      Name: Creating a Rogue Certification Authority Certificate
      ID: CAPEC-461
      Name: Web Services API Signature Forgery Leveraging Hash Function Extension Weakness
      ID: CAPEC-473
      Name: Signature Spoof
      ID: CAPEC-476
      Name: Signature Spoofing by Misrepresentation
      ID: CAPEC-59
      Name: Session Credential Falsification through Prediction
      ID: CAPEC-60
      Name: Reusing Session IDs (aka Session Replay)
      ID: CAPEC-667
      Name: Bluetooth Impersonation AttackS (BIAS)
      ID: CAPEC-94
      Name: Adversary in the Middle (AiTM)
      ▼References
      Reference ID: REF-62
      Title: The Art of Software Security Assessment
      Author: Mark Dowd, John McDonald, Justin Schuh
      Section: Chapter 3, "Spoofing and Identification", Page 72
      Publication:
      Publisher:Addison Wesley
      Edition:1st Edition
      URL:
      URL Date:
      Day:N/A
      Month:N/A
      Year:2006
      Details not found