CVE-2026-46727 Details
Description
An issue was discovered in Ruby 4 before 4.0.5. A race condition leading to a use-after-free in the pthread-based getaddrinfo timeout handler (rb_getaddrinfo in ext/socket/raddrinfo.c) allows a remote attacker who can delay DNS responses near the user-specified timeout to crash a Ruby process that calls Addrinfo.getaddrinfo(..., timeout:) or Socket.tcp(..., resolv_timeout:). Memory-corruption-based exploitation is theoretically possible. The attack could, for example, be carried out through a crafted authoritative DNS server or recursive resolver.
A race condition leading to a use-after-free vulnerability has been identified in Ruby versions 4.0.0 prior to 4.0.5 and in Ruby 4.1.0-dev (master) before the fix. The issue arises in the pthread-based getaddrinfo timeout handler, rb_getaddrinfo, located in ext/socket/raddrinfo.c. This vulnerability allows a remote attacker who can delay DNS responses close to the user-specified timeout to crash a Ruby process that uses Addrinfo.getaddrinfo(..., timeout:) or Socket.tcp(..., resolv_timeout:). While the primary consequence is a crash, memory-corruption-based exploitation is theoretically possible, potentially through a crafted authoritative DNS server or recursive resolver.
Users are advised to upgrade to Ruby 4.0.5 or later. If an immediate upgrade is not possible, avoid using the timeout parameter with Addrinfo.getaddrinfo and the resolv_timeout parameter with Socket.tcp.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed May 22, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://hackerone.com/reports/3607434 | [email protected] | Permissions Required |
| https://www.ruby-lang.org/en/news/2026/05/20/getaddrinfo-cve-2026-46727/ | [email protected] | Vendor Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-362 | Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| ruby-lang ruby | >= 4.0.0, < 4.0.5 |
CPE
Remediation
| |
Change History
5 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jul 23, 2026 | CVE Translated | [email protected] |
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| May 26, 2026 | Initial Analysis | [email protected] |
| May 22, 2026 | New CVE Received | [email protected] |