|
| 1 | +--- |
| 2 | +gem: concurrent-ruby |
| 3 | +cve: 2026-54904 |
| 4 | +ghsa: h8w8-99g7-qmvj |
| 5 | +url: https://www.cve.org/CVERecord/SearchResults?query=CVE-2026-54904 |
| 6 | +title: Concurrent Ruby - `AtomicReference#update` livelocks when the |
| 7 | + stored value is `Float::NAN` |
| 8 | +date: 2026-06-19 |
| 9 | +description: | |
| 10 | + ### Summary |
| 11 | +
|
| 12 | + `Concurrent::AtomicReference#update` can enter a permanent busy retry |
| 13 | + loop when the current value is `Float::NAN`. |
| 14 | +
|
| 15 | + The issue is caused by the interaction between: |
| 16 | + - `AtomicReference#update`, which retries until `compare_and_set(old_value, |
| 17 | + new_value)` succeeds. |
| 18 | + - Numeric `compare_and_set`, which checks `old == old_value` before |
| 19 | + attempting the underlying atomic swap. |
| 20 | + - Ruby NaN semantics, where `Float::NAN == Float::NAN` is always `false`. |
| 21 | +
|
| 22 | + As a result, once an `AtomicReference` contains `Float::NAN`, calling |
| 23 | + `#update` repeatedly evaluates the caller's block and never returns. |
| 24 | + In services that store externally derived numeric values in an |
| 25 | + `AtomicReference`, this can cause CPU exhaustion or permanent |
| 26 | + request/job hangs. |
| 27 | +
|
| 28 | + ### Impact |
| 29 | +
|
| 30 | + This is an application-level denial of service issue. If an application |
| 31 | + stores externally derived numeric data in a `Concurrent::AtomicReference`, |
| 32 | + an attacker or faulty upstream data source may be able to cause the |
| 33 | + stored value to become `Float::NAN`. Any later call to |
| 34 | + `AtomicReference#update` on that reference will spin indefinitely, |
| 35 | + repeatedly executing the update block and consuming CPU. |
| 36 | +
|
| 37 | + ### Credit |
| 38 | +
|
| 39 | + Pranjali Thakur - depthfirst ([depthfirst.com](<http://depthfirst.com>)) |
| 40 | +cvss_v4: 8.2 |
| 41 | +patched_versions: |
| 42 | + - ">= 1.3.7" |
| 43 | +related: |
| 44 | + url: |
| 45 | + - https://www.cve.org/CVERecord/SearchResults?query=CVE-2026-54904 |
| 46 | + - https://rubygems.org/gems/concurrent-ruby/versions/1.3.7 |
| 47 | + - https://github.com/ruby-concurrency/concurrent-ruby/releases/tag/v1.3.7 |
| 48 | + - https://advisories.gitlab.com/gem/concurrent-ruby/CVE-2026-54904 |
| 49 | + - https://github.com/ruby-concurrency/concurrent-ruby/security/advisories/GHSA-h8w8-99g7-qmvj |
| 50 | + - https://github.com/advisories/GHSA-h8w8-99g7-qmvj |
| 51 | +notes: | |
| 52 | + - cvss_v4 from GHSA |
| 53 | + - CVE is reserved, but not published. |
| 54 | + - Not on nvd.nist.gov so no cvss_v2 or cvss_v3. |
0 commit comments