14 vulnerabilities classified as CWE-350 (不恰当地信任反向DNS). AI Chinese analysis included.
CWE-350 represents a critical authentication weakness where software relies on reverse DNS resolution to verify an entity’s identity for security-critical actions. Attackers typically exploit this by spoofing DNS responses or manipulating local DNS caches, allowing them to impersonate trusted hosts without possessing the corresponding IP address. Because DNS records are mutable and often lack robust cryptographic verification, an adversary can easily associate a malicious hostname with a legitimate IP, bypassing access controls. To mitigate this risk, developers must avoid using DNS names as sole authentication factors. Instead, they should implement mutual TLS with certificate validation, use static IP allowlists, or employ other cryptographic mechanisms that provide verifiable identity assurance, ensuring that security decisions are based on immutable credentials rather than easily manipulated network metadata.
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; }String ip = request.getRemoteAddr(); InetAddress addr = InetAddress.getByName(ip); if (addr.getCanonicalHostName().endsWith("trustme.com")) { trusted = true; }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); }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); } }Vulnerabilities classified as CWE-350 (不恰当地信任反向DNS) represent 14 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.