Skip to main content

Ruby resolv gem CVE-2026-80213

| EUVDEUVD-2026-67139 MEDIUM
Numeric Truncation Error (CWE-197)
2026-08-27 mitre GHSA-jr95-x3fr-rcg4
4.0
CVSS 3.1 · Vendor: mitre
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Supply oversized DNS label as hostname input
  2. Delivery
    Application validates hostname string against allowlist
  3. Exploit
    Resolv truncates label length to compression-pointer byte range
  4. Execution
    Wire-format DNS query names attacker-chosen domain
  5. Persist
    Recursive resolver resolves and caches attacker's domain
  6. Impact
    Allowlist and egress controls bypassed, audit logs record attacker's domain

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Numeric truncation prevention
Exploitation Conditions

Exploitation requires that an attacker control or inject a hostname string that the vulnerable application passes to Resolv::DNS for resolution without prior per-label length validation - for example, via a user-supplied URL, webhook target, SSRF-triggering parameter, redirect destination, or externally-sourced configuration value. The application must be running a resolv gem version in the affected ranges (0.4.0-<0.7.2 or 0-<0.3.2). The attacker must craft a DNS label exceeding 63 octets with a length whose single-byte truncation lands in a range useful for exploitation (particularly 0xC0-0xFF to trigger compression pointer misparse). The CVSS AC:H rating reflects that this combination - attacker-controlled hostname reaching the DNS encoder without length sanitization, in an application using DNS checks as a security control - is not universally present. No authentication is required of the attacker (PR:N per CVSS vector). Exploitation is limited by the need for the application to both accept attacker-supplied hostnames and rely on DNS-layer controls for security decisions; applications that do not resolve externally-controlled names are not affected.

Impact

The CVSS 3.1 base score of 4.0 (Medium) with vector AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:L/A:N is consistent with the actual threat model. AC:H is accurate: exploitation requires the attacker to control or inject a hostname that the vulnerable application passes to Resolv::DNS for resolution without prior length sanitization, a condition that limits the attack surface to applications accepting user-supplied or externally-sourced hostname input as part of a security-relevant control path. The Scope:Changed (S:C) rating correctly captures that the consequences extend beyond the vulnerable process - the recursive resolver caches entries under the attacker's chosen name, and DNS audit logs record that name rather than the intended one, degrading security monitoring integrity. Integrity impact is Low (I:L) as the primary harm is allowlist and egress filter bypass rather than arbitrary data corruption. KEV status is not confirmed, EPSS is not provided in source data, and no POC has been identified - the real-world exploitation risk is therefore unquantified but structurally higher for applications that rely on DNS-based egress filtering or hostname allowlists as a security boundary. The CVSS score may understate risk for such security-critical architectures.

Exploit ScenarioDerived

An attacker submits a webhook URL or SSRF-triggering parameter containing a crafted hostname whose primary label exceeds 63 octets with a total byte length that, when truncated to a single octet, falls in the 0xC0-0xFF compression-pointer range. The application validates the full hostname string against an allowlist (e.g., asserting it ends with .trusted.example.com) and passes it to Resolv::DNS - the validating suffix appears in the string but never reaches the wire, where the truncated length byte causes a conforming resolver to follow a compression pointer to a different, attacker-controlled domain. The recursive resolver resolves and caches the attacker's chosen domain, returning a response under that name while DNS logs record the attacker's domain rather than the intended one, defeating both the allowlist check and downstream audit correlation.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Aug 27, 2026

DNS label length truncation in the Ruby resolv gem (versions before 0.7.2 and before 0.3.2) enables attacker-controlled hostnames to produce wire-format DNS queries naming a domain the attacker chose rather than the one the application intended. The flaw allows hostname allowlists and DNS egress controls to be silently bypassed - the validated string appears legitimate but the bytes transmitted to the recursive resolver describe a different name. No public exploit code has been identified at time of analysis, but the Scope:Changed CVSS rating reflects real spillover impact on DNS resolvers and audit logs beyond the vulnerable application itself.

RemediationAI

Upgrade the resolv gem to version 0.7.2 (or 0.3.2 for installations on the older branch) as documented in the vendor advisory at https://www.ruby-lang.org/en/news/2026/08/27/multiple-vulnerabilities-in-resolv/. Applications using Bundler should pin the version in their Gemfile to gem 'resolv', '>= 0.7.2' and run bundle update resolv; standalone installations should run gem update resolv and verify the installed version. As a compensating control for environments that cannot patch immediately, applications should validate that each DNS label does not exceed 63 octets and that the total hostname does not exceed 253 octets at input ingestion boundaries - before the string reaches any Resolv::DNS call - since the library itself performs no such check. Applications that use hostname allowlists or DNS-based egress controls as a security boundary should treat those controls as unreliable until the gem is upgraded, and should consider blocking resolution of externally-sourced hostnames entirely in the interim. Note that input validation at the application layer has the side effect of rejecting technically invalid but previously-accepted hostnames, which may require coordination with upstream data sources.

Affected VersionsENISA

resolv 0.4.0 <0.7.2
resolv 0 <0.3.2

Affected Packages

euvd resolv fix: 0.3.2, 0.7.2

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The affected component is Resolv::DNS::MessageEncoder in the Ruby resolv gem (CPE: cpe:2.3:a:ruby:resolv:*:*:*:*:*:*:*:*). The root cause is CWE-197 (Numeric Truncation Error): the internal method put_string invokes put_pack('C', d.length) to write the label length into a single unsigned octet, which silently truncates any value greater than 255 via modulo-256 arithmetic. RFC 1035 §2.3.4 constrains DNS labels to 63 octets and reserves the top two bits of the length octet - values 0x40-0xBF are reserved and 0xC0-0xFF signal compression pointers in conforming parsers. Neither put_label nor Resolv::DNS::Name.create performed per-label or total-name length validation, meaning an attacker-supplied label of arbitrary length reached the wire encoder unmodified. When the truncated length byte falls in the 0xC0-0xFF range, conforming DNS parsers interpret it as the start of a compression pointer, treating the following attacker-controlled byte as the pointer offset and resolving an entirely attacker-selected name.

Know when Resolv gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (mitre) PRIMARY 4.0 MEDIUM
AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:L/A:N
vuln.today AI 4.0 MEDIUM

AC:H reflects requirement for attacker-controlled hostname input reaching the encoder; S:C captures DNS resolver cache and audit log integrity impact on external systems.

3.1 AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:L/A:N
4.0 AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:L/SA:N
Red Hat 4.0 MEDIUM

Primary rating from Vendor (mitre).

CVSS VectorVendor: mitre

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Changed
Confidentiality
None
Integrity
Low
Availability
None

Lifecycle Timeline

1
Patch available
Aug 27, 2026 - 18:02 EUVD

DescriptionCVE.org

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.

Threat Intelligence Overview

EPSS Score
0.3%
Top 76% exploitable
Prevalence
Medium
bundled with Ruby stdlib, common in Ruby network applications
Data Quality
7 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

20
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +20
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy