---
title: "CWE-350: Reliance on Reverse DNS Resolution for a Security-Critical Action"
url: https://radicalnotion.ai/cwe/cwe-350
type: cwe
description: "The product performs reverse DNS resolution on an IP address to obtain the hostname and make a security decision, but it does not properly ensure that the IP address is truly associated with the hostname."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-350: Reliance on Reverse DNS Resolution for a Security-Critical Action

- **Abstraction:** Variant
- **Structure:** Simple
- **Status:** Draft
- **CVEs with this as primary weakness:** 31
- **Of those, in CISA KEV:** 0
- **New in 2026:** 17
- **CWE catalog version:** 4.21

## Description

The product performs reverse DNS resolution on an IP address to obtain the hostname and make a security decision, but it does not properly ensure that the IP address is truly associated with the hostname.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Architecture and Design | - |

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Access Control | Gain Privileges or Assume Identity, Bypass Protection Mechanism | Attackers can spoof DNS names by either (1) compromising a DNS server and modifying its records (sometimes called DNS cache poisoning), or (2) having legitimate control over a DNS server associated with their IP address. It may be difficult for the product to detect if a trusted DNS server has been compromised. When the product performs a reverse DNS resolution for an IP address, if an attacker controls the DNS server for that IP address, then the attacker can cause the server to return an arbitrary hostname. As a result, the attacker may be able to bypass authentication, cause the wrong hostname to be recorded in log files to hide activities, or perform other attacks. |

## Potential mitigations

### Architecture and Design

Use other means of identity verification that cannot be simply spoofed. Possibilities include a username/password or certificate.

### Implementation

Perform proper forward and reverse DNS lookups to detect DNS spoofing.

## Detection methods

### Automated Static Analysis

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.)

Effectiveness: High

## Demonstrative examples

### Example 1

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.

Bad code:

```c
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;
}
```

Bad code:

```java
String ip = request.getRemoteAddr();
InetAddress addr = InetAddress.getByName(ip);
if (addr.getCanonicalHostName().endsWith("trustme.com")) {
    trusted = true;
}
```

Bad code:

```c#
IPAddress hostIPAddress = IPAddress.Parse(RemoteIpAddress);
IPHostEntry hostInfo = Dns.GetHostByAddress(hostIPAddress);
if (hostInfo.HostName.EndsWith("trustme.com")) {
    trusted = true;
}
```

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.

### Example 2

In these examples, a connection is established if a request is made by a trusted host.

Bad code:

```c
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);
    h=gethostbyname(inet_ntoa(cliAddr.sin_addr));
    if (h->h_name==...) n = recvfrom(sd, msg, MAX_MSG, 0, (struct sockaddr *) & cli, &clilen);
}
```

Bad code:

```java
while(true) {
    DatagramPacket rp=new DatagramPacket(rData,rData.length);
    outSock.receive(rp);
    String in = new String(p.getData(),0, rp.getLength());
    InetAddress IPAddress = rp.getAddress();
    int port = rp.getPort();
    if ((rp.getHostName()==...) & (in==...)) {

        out = secret.getBytes();
        DatagramPacket sp =new DatagramPacket(out,out.length, IPAddress, port);
        outSock.send(sp);
    }
}
```

These examples check if a request is from a trusted host before responding to a request, but the code only verifies the hostname as stored in the request packet. An attacker can spoof the hostname, thus impersonating a trusted client.

## Observed examples

| CVE | Description |
| --- | --- |
| CVE-2001-1488 | Does not do double-reverse lookup to prevent DNS spoofing. |
| CVE-2001-1500 | Does not verify reverse-resolved hostnames in DNS. |
| CVE-2000-1221 | Authentication bypass using spoofed reverse-resolved DNS hostnames. |
| CVE-2002-0804 | Authentication bypass using spoofed reverse-resolved DNS hostnames. |
| CVE-2001-1155 | Filter does not properly check the result of a reverse DNS lookup, which could allow remote attackers to bypass intended access restrictions via DNS spoofing. |
| CVE-2004-0892 | Reverse DNS lookup used to spoof trusted content in intermediary. |
| CVE-2003-0981 | Product records the reverse DNS name of a visitor in the logs, allowing spoofing and resultant XSS. |

## Real CVEs with this weakness (sample of 12 of 31)

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2026-1490 | Spam protection, Honeypot, Anti-Spam by CleanTalk \<= 6.71 - Authorization Bypass via Reverse DNS (PTR record) Spoofing to Unauthenticated Arbitrary Plugin Installation | critical | 9.8 | - | No | 2026-02-15 |
| CVE-2026-61568 | @zereight/mcp-gitlab: DNS rebinding reaches local Streamable HTTP MCP transport | critical | 9.6 | - | No | 2026-09-15 |
| CVE-2026-77359 | Jupyter MCP Server: Browser DNS rebinding can hijack the Jupyter backend through management routes | critical | 9.3 | - | No | 2026-11-19 |
| CVE-2026-77283 | obsidian-sync-mcp: Missing Host/Origin validation lets a public website drive a victim's Obsidian vault via DNS rebinding (no-auth mode) | high | 8.8 | - | No | 2026-11-18 |
| CVE-2023-52235 | - | high | 8.8 | - | No | 2024-04-05 |
| CVE-2021-34561 | A vulnerability in WirelessHART-Gateway \<= 3.0.8 allows to bypass any IP or firewall based access restrictions through DNS rebinding | high | 8.8 | - | No | 2021-08-31 |
| CVE-2018-7160 | nodejs: Inspector DNS rebinding vulnerability | high | 8.8 | - | No | 2018-05-17 |
| CVE-2026-56709 | Grav before 3.9.2 Host Header Injection via sendInvitationEmail | high | 8.7 | - | No | 2026-08-25 |
| CVE-2026-55526 | PraisonAI: SSRF protection bypass in \`spider\_tools.\_host\_is\_blocked()\` via DNS-resolved hostnames (\`127.0.0.1.nip.io\`) | high | 8.5 | - | No | 2026-08-25 |
| CVE-2026-97875 | DNS rebinding vulnerability in rojo serve HTTP API | high | 8.1 | - | No | 2026-09-25 |
| CVE-2025-8036 | DNS rebinding circumvents CORS | high | 8.1 | - | No | 2025-07-22 |
| CVE-2017-0902 | RubyGems has Origin Validation Error vulnerability | high | 8.1 | - | No | 2017-08-31 |

## Related attack patterns (CAPEC)

- [CAPEC-142](https://radicalnotion.ai/capec/capec-142): DNS Cache Poisoning
- [CAPEC-275](https://radicalnotion.ai/capec/capec-275): DNS Rebinding
- [CAPEC-73](https://radicalnotion.ai/capec/capec-73): User-Controlled Filename
- [CAPEC-89](https://radicalnotion.ai/capec/capec-89): Pharming

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-290](https://radicalnotion.ai/cwe/cwe-290) | Authentication Bypass by Spoofing |
| Parent | [CWE-807](https://radicalnotion.ai/cwe/cwe-807) | Reliance on Untrusted Inputs in a Security Decision |
| Can precede | [CWE-923](https://radicalnotion.ai/cwe/cwe-923) | Improper Restriction of Communication Channel to Intended Endpoints |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| PLOVER | Improperly Trusted Reverse DNS | - | - |
| CLASP | Trusting self-reported DNS name | - | - |
| Software Fault Patterns | Faulty endpoint authentication | SFP29 | - |

## Frequently asked questions

### What is CWE-350?

The product performs reverse DNS resolution on an IP address to obtain the hostname and make a security decision, but it does not properly ensure that the IP address is truly associated with the hostname.

### What CVEs are caused by CWE-350?

31 recorded CVEs are attributed to CWE-350, including CVE-2026-1490, CVE-2026-61568 and CVE-2026-77359.

### How do you prevent CWE-350?

Use other means of identity verification that cannot be simply spoofed. Possibilities include a username/password or certificate.

### How is CWE-350 detected?

Automated Static Analysis: 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.)

### What are the consequences of CWE-350?

Exploiting CWE-350 can lead to: Gain Privileges or Assume Identity, Bypass Protection Mechanism.

### Is CWE-350 actively exploited?

31 recorded CVEs are caused by CWE-350; none are currently in CISA's KEV catalog of actively exploited flaws.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/350.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-350). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
