Ruby 4 <4.0.5: UAF in getaddrinfo Timeout Handler
CVE-2026-46727 Published on May 22, 2026
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.
Vulnerability Analysis
CVE-2026-46727 can be exploited with network access, and does not require authorization privileges or user interaction. This vulnerability is consided to have a high level of attack complexity. The potential impact of an exploit of this vulnerability is considered to be very high.
Weakness Type
What is a Race Condition Vulnerability?
The program contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently.
CVE-2026-46727 has been classified to as a Race Condition vulnerability or weakness.
Products Associated with CVE-2026-46727
Want to know whenever a new CVE is published for Ruby Programming Language Ruby Language? stack.watch will email you.
Affected Versions
ruby-lang Ruby:- Version 4.0.0 and below 4.0.5 is affected.