CVE-2025-24294
Description
The attack vector is a potential Denial of Service (DoS). The vulnerability is caused by an insufficient check on the length of a decompressed domain name within a DNS packet.
An attacker can craft a malicious DNS packet containing a highly compressed domain name. When the resolv library parses such a packet, the name decompression process consumes a large amount of CPU resources, as the library does not limit the resulting length of the name.
This resource consumption can cause the application thread to become unresponsive, resulting in a Denial of Service condition.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
resolvRubyGems | < 0.2.3 | 0.2.3 |
resolvRubyGems | >= 0.4.0, < 0.6.2 | 0.6.2 |
resolvRubyGems | >= 0.3.0, < 0.3.1 | 0.3.1 |
Affected products
1Patches
14c2f71b5e808Limit decompressed name length
2 files changed · +12 −1
lib/resolv.rb+5 −1 modified@@ -1679,6 +1679,7 @@ def get_labels prev_index = @index save_index = nil d = [] + size = -1 while true raise DecodeError.new("limit exceeded") if @limit <= @index case @data.getbyte(@index) @@ -1699,7 +1700,10 @@ def get_labels end @index = idx else - d << self.get_label + l = self.get_label + d << l + size += 1 + l.string.bytesize + raise DecodeError.new("name label data exceed 255 octets") if size > 255 end end end
test/resolv/test_dns.rb+7 −0 modified@@ -627,6 +627,13 @@ def test_too_big_label_address assert_operator(2**14, :<, m.to_s.length) end + def test_too_long_address + too_long_address_message = [0, 0, 1, 0, 0, 0].pack("n*") + "\x01x" * 129 + [0, 0, 0].pack("cnn") + assert_raise_with_message(Resolv::DNS::DecodeError, /name label data exceed 255 octets/) do + Resolv::DNS::Message.decode too_long_address_message + end + end + def assert_no_fd_leak socket = assert_throw(self) do |tag| Resolv::DNS.stub(:bind_random_port, ->(s, *) {throw(tag, s)}) do
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
6- github.com/advisories/GHSA-xh69-987w-hrp8ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2025-24294ghsaADVISORY
- github.com/ruby/resolv/commit/4c2f71b5e80826506f78417d85b38481c058fb25ghsaWEB
- github.com/rubysec/ruby-advisory-db/blob/master/gems/resolv/CVE-2025-24294.ymlghsaWEB
- www.ruby-lang.org/en/news/2025/07/08/dos-resolv-cve-2025-24294ghsaWEB
- www.ruby-lang.org/en/news/2025/07/08/dos-resolv-cve-2025-24294/nvd
News mentions
0No linked articles in our index yet.