CVE-2026-80212
massMemory-exhaustion DoS in Ruby's resolv DNS gem via leaked generated classes
The resolv gem before 0.7.2 (a default gem bundled with Ruby) has an unbounded memory-growth flaw: each time DNS decoding encounters an unknown resource-record (type, class) pair or an unknown SvcParamKey, Resolv::DNS::Resource.get_class and the related Generic.create methods generate a new class and permanently register it as a constant and in the ClassHash lookup table, so the garbage collector can never reclaim it (CWE-770). An attacker who can influence the DNS responses an application decodes — via a spoofed response or a malicious or hijacked upstream DNS server — can send tens of thousands of distinct unknown types, and a single response of a few hundred kilobytes can grow process memory by tens of megabytes. Repeated responses accumulate without bound, eventually exhausting process or host memory and causing denial of service; confidentiality and integrity are unaffected. Any Ruby code path that calls Resolv::DNS::Message.decode on attacker-influenced DNS responses is affected, and because resolv is a default gem this is reachable from a plain Ruby installation with no additional dependencies. No public proof-of-concept, in-the-wild exploitation, or CISA KEV listing is known; EPSS estimates a 0.6% probability of exploitation within 30 days.
What to do: Upgrade the resolv gem to 0.7.2 or later (install/require resolv >= 0.7.2 and ensure the default gem bundled with your Ruby release is updated). Audit applications and dependencies for code paths that call Resolv::DNS::Message.decode on untrusted DNS responses; until patched, restrict decoding to responses from trusted resolvers, limit DNS response sizes, and consider periodically restarting long-running processes that perform such decoding. Monitor the Ruby security team for bundled-gem updates covering your Ruby version.
| Ruby core / resolv gem maintainers (ruby-lang.org) resolv gem | all versions before 0.7.2 (fixed in 0.7.2) |
| Ruby installations (resolv is a default gem bundled with Ruby) | any Ruby release whose bundled resolv is older than 0.7.2 (exact per-release Ruby version ranges not specified in available data) |
Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.
An issue was discovered in the resolv gem before 0.7.2 for Ruby. Resolv::DNS::Resource.get_class, Resolv::DNS::Resource::Generic.create, and Resolv::DNS::SvcParam::Generic.create generate a new class for each unknown DNS resource record (type, class) pair, or each unknown SvcParamKey, encountered while decoding a response. Each generated class was permanently registered both as a constant on Resource (or SvcParam::Generic) and as an entry in a class-lookup hash (ClassHash), and thus the class remained reachable through that constant after the response was discarded. Type and class are each 16-bit values, and thus an attacker controlling DNS responses (a spoofed response, or a malicious or hijacked upstream DNS server) has roughly 2^32 distinct (type, class) pairs to choose from. A single response of a few hundred kilobytes carrying tens of thousands of distinct unknown types permanently grows process memory by tens of megabytes; repeated responses accumulate without bound and are never reclaimed by garbage collection, because the constant keeps each class alive. Any code path that calls Resolv::DNS::Message.decode on attacker-influenced DNS responses is affected. resolv is a default gem, and thus this is reachable from a plain Ruby installation without any additional dependency.
- Weakness
- CWE-770
- Vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
In the news0 stories
No ingested article mentions this CVE yet.