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.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| ruby-lang | Ruby | 4.0.0 – < 4.0.5 | 4.0.5 |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | jruby +1 | No fix yet | — |
| Ubuntu 26.04 LTS | jruby +1 | No fix yet | — |
| Ubuntu 25.10 | jruby +1 | No fix yet | — |
| Ubuntu 24.04 LTS | jruby +1 | No fix yet | — |
| Ubuntu 22.04 LTS | ruby3.0 | No fix yet | — |
Show 7 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 20.04 LTS | jruby | No fix yet | — |
| Ubuntu 18.04 LTS | jruby | No fix yet | — |
| Ubuntu 16.04 LTS | jruby | No fix yet | — |
| Ubuntu Pro 20.04 LTS | ruby2.7 | No fix yet | — |
| Ubuntu Pro 18.04 LTS | ruby2.5 | No fix yet | — |
| Ubuntu Pro 16.04 LTS | ruby2.3 | No fix yet | — |
| Ubuntu Pro 14.04 LTS | jruby | No fix yet | — |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | ruby4.0 | 4.0.5-1.1 | openSUSE-SU-2026:10839-1 |
Advisories 2
- WID-SEC-2026-1590 Ruby: Schwachstelle ermöglicht Denial of Service BSI CERT-Bund (WID) · May 25, 2026
- openSUSE-SU-2026:10839-1 libruby4_0-4_0-4.0.5-1.1 on GA media SUSE / openSUSE Security Updates · May 22, 2026