Skip to content

Commit 37386ae

Browse files
committed
Add cve-2026-46727 and write up a 4.0.5 release post
1 parent 7a4f196 commit 37386ae

2 files changed

Lines changed: 49 additions & 1 deletion

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
layout: news_post
3+
title: "CVE-2026-46727: Use-after-free in pthread-based getaddrinfo timeout handler"
4+
author: "hsbt"
5+
translator:
6+
date: 2026-05-20 00:00:00 +0000
7+
tags: security
8+
lang: en
9+
---
10+
11+
A use-after-free vulnerability has been discovered in the pthread-based `getaddrinfo` timeout handler of Ruby. This vulnerability has been assigned the CVE identifier [CVE-2026-46727](https://www.cve.org/CVERecord?id=CVE-2026-46727). This issue has been fixed in Ruby 4.0.5. We recommend upgrading Ruby.
12+
13+
## Details
14+
15+
A race condition exists in the timeout cancellation path of `rb_getaddrinfo` used by `Addrinfo.getaddrinfo(..., timeout:)` and `Socket.tcp(..., resolv_timeout:)`. A remote attacker who can delay DNS responses near the specified timeout may cause the Ruby process to dereference freed memory and crash.
16+
17+
## Recommended action
18+
19+
Please update to Ruby 4.0.5 or later.
20+
21+
## Workaround
22+
23+
If you cannot upgrade immediately, avoid passing `timeout:` to `Addrinfo.getaddrinfo` and `resolv_timeout:` to `Socket.tcp`.
24+
25+
## Affected versions
26+
27+
* Ruby 4.0.0 through 4.0.4
28+
* Ruby 4.1.0-dev (master) before the fix
29+
30+
Ruby 3.4 series and earlier are not affected.
31+
32+
## Credits
33+
34+
Thanks to [cantina-security](https://hackerone.com/cantina-security) for discovering this issue. Also thanks to [shioimm](https://github.com/shioimm) for creating the patch.
35+
36+
## History
37+
38+
* Originally published at 2026-05-20 00:00:00 (UTC)

en/news/_posts/2026-05-20-ruby-4-0-5-released.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
---
22
layout: news_post
33
title: "Ruby 4.0.5 Released"
4-
author:
4+
author: k0kubun
55
translator:
66
date: 2026-05-20 00:12:20 +0000
77
lang: en
88
---
99

1010
Ruby 4.0.5 has been released.
1111

12+
This release only contains a security fix for
13+
[CVE-2026-46727: Use-after-free in pthread-based getaddrinfo timeout handler](/en/news/2026/05/20/getaddrinfo-cve-2026-46727/)
14+
and a build system regression under C locale ([[Bug #22065]](https://bugs.ruby-lang.org/issues/22065)).
15+
1216
Please see the [GitHub releases](https://github.com/ruby/ruby/releases/tag/v4.0.5) for further details.
1317

18+
## Release Schedule
19+
20+
We intend to release the latest stable Ruby version (currently Ruby 4.0) every two months following the most recent *regular* release. Ruby 4.0.6 will be released in July, 4.0.7 in September, and 4.0.8 in November.
21+
22+
If a change arises that significantly affects users, a release may occur earlier than planned, and the subsequent schedule may shift accordingly.
23+
1424
## Download
1525

1626
{% assign release = site.data.releases | where: "version", "4.0.5" | first %}

0 commit comments

Comments
 (0)