CVE-2026-80213
Deferred Deferred - Pending Action

DNS Label Length Spoofing in Ruby Resolv Gem

Vulnerability report for CVE-2026-80213, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-08-27

Last updated on: 2026-09-09

Assigner: MITRE

Description

An issue was discovered in the resolv gem before 0.7.2 for Ruby. Resolv::DNS::MessageEncoder wrote a DNS label's length into a single octet without checking its range. A label longer than 255 octets had its length stored modulo 256 but the label data was written unchanged, and thus the bytes on the wire described a different name than the one the application asked to encode. RFC 1035 section 2.3.4 limits a label to 63 octets, and the two high bits of the length octet are reserved for compression pointers. put_string packed the length with put_pack("C", d.length) and put_label used it for labels, and thus any value from 0 to 255 could end up as a label length octet, including the reserved 0x40-0xBF range and the 0xC0-0xFF pointer range. Resolv::DNS::Name.create did not check per-label or total name length either, and thus an attacker-controlled hostname reached the encoder unchanged. An application that resolves an attacker-controlled hostname sends a query whose wire bytes name a domain the attacker chose. A hostname suffix that the application validates against an allowlist becomes padding that never appears on the wire, and thus allowlist and egress checks can be bypassed. The recursive resolver caches the response under the attacker's name, and DNS logs record that name rather than the one the application asked for. A label length whose low octet lands in the 0xC0-0xFF range produces a length octet that conforming parsers read as the start of a compression pointer, with the following attacker-controlled byte as the offset.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-08-27
Last Modified
2026-09-09
Generated
2026-09-17
AI Q&A
2026-08-27
EPSS Evaluated
2026-09-15
NVD
EUVD

Affected Vendors & Products

Showing 7 associated CPEs
Vendor Product Version / Range
ruby resolv 0.4.0
ruby resolv 0.5.0
ruby resolv 0.6.0
ruby resolv 0.7.1
ruby resolv 0.3.1
ruby resolv From 0.4.0 (inc) to 0.7.2 (exc)
ruby resolv 0.3.2

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-197 Truncation errors occur when a primitive is cast to a primitive of a smaller size and data is lost in the conversion.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability in the Ruby resolv gem before 0.7.2 allows an attacker to bypass hostname validation by exploiting DNS length limits. When encoding a DNS label longer than 255 octets, the gem incorrectly stores the length modulo 256 but writes the label data unchanged. This causes the DNS query to represent a different domain than the one validated by the application, enabling unauthorized connections.

Detection Guidance

Check if your Ruby application uses the resolv gem version 0.4.0 through 0.7.1 or 0.3.1 and earlier. Run gem list resolv to verify the installed version. If vulnerable, update to resolv 0.7.2 or 0.3.2 for Ruby 3.3.

Impact Analysis

An attacker could trick your application into resolving and connecting to a malicious domain instead of the intended one, even if your code validates hostnames against an allowlist. This could lead to data leaks, unauthorized access, or bypassing security controls. Only applications using the resolv gem for DNS resolution are affected.

Compliance Impact

This vulnerability could lead to unauthorized data access or exfiltration by bypassing hostname validation, potentially violating GDPR's data protection requirements or HIPAA's access controls. Organizations must ensure DNS resolution is secure to maintain compliance with these standards.

Mitigation Strategies

Update the resolv gem to version 0.7.2. For Ruby 3.3 users, update to 0.3.2. Ruby 3.2 users should install resolv 0.7.2. Verify the update with gem list resolv and restart affected applications.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-80213. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart