GHSA-8wcq-xq25-7fhm: Private cookie nonces can repeat in processes that fork
Published 2026-11-23 · Updated 2026-11-23 · Also known as RUSTSEC-2026-0594
Summary
Affected versions of the crates.io cookie crate (0.11.3 before 0.12.0, and 0.14.0 before 0.18.3) draw AES-256-GCM nonces for private cookies from rand::thread_rng(), which can repeat buffered nonces across processes after a fork(). Engineering teams running Unix-like Rust applications that fork() and seal private cookies on the forking thread in multiple processes sharing the same Key should upgrade to a fixed version or apply the documented workarounds.
Who is affected
When a Unix-like process calls fork() without exec() after rand::thread_rng() was used on the forking thread, and two or more resulting processes sharing the same Key add private cookies on that thread, up to the first 21 private cookies per process can reuse nonces. Because repeating an AES-GCM nonce under the same key breaks encryption guarantees, an attacker who obtains two such cookies from different processes (detectable via the first 12 bytes of the base64-decoded value) can recover the XOR of their plaintexts and derive the GHASH authentication key to forge arbitrary authentic private cookies. Applications that never fork (including all Windows applications), signed cookies (SignedJar), Rocket, and axum as normally run with a multi-threaded runtime are not affected.
Exploitability
Based on the CVSS 3.1 vector (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:H/A:N) and base score of 6.5 (Medium), exploitation is network-accessible without privileges or user interaction, requires high attack complexity, and results in low confidentiality impact, high integrity impact, and no availability impact. EPSS data is not yet available for this record. CISA Known Exploited Vulnerabilities status is no, so active exploitation is not indicated.
Remediation
- Upgrade the cookie crate to fixed version 0.18.3 (which reads nonces directly from the operating system random number generator), or to fixed version 0.12.0 if on the 0.11.x branch (versions 0.12.0 through 0.13.3 are unaffected).
- If upgrading is not possible, avoid calling rand::thread_rng() directly or indirectly on the forking thread before fork()-for instance, create keys with Key::from() or Key::derive_from() instead of Key::generate()-or only add private cookies on threads created after the fork.
- Alternatively, in each child process immediately after fork(), read and discard at least 256 bytes from rand::thread_rng() before adding any private cookie.
- Rotate the cookie encryption Key for any application that previously ran in an affected configuration.
How to check your project
- Check Cargo.lock and dependency manifests for the crates.io cookie package in affected ranges: >=0.11.3, <0.12.0 or >=0.14.0, <0.18.3.
- Audit Unix-like services to determine whether the process calls fork() without exec() after rand::thread_rng() was invoked on the forking thread, and subsequently adds private cookies on that same thread across multiple resulting processes using the same Key.
- For axum applications, verify whether worker processes are forked manually and executed on a current-thread runtime on the forking thread after rand::thread_rng() was used prior to forking.
Automated analysis of the published advisory data, generated 2026-11-23. Not human-reviewed; verify against the official advisory. How this works.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | Upgrade |
|---|---|---|---|---|
| crates.io | cookie |
>= 0.11.3, < 0.12.0 | 0.12.0 | cargo update -p cookie --precise 0.12.0 |
| crates.io | cookie |
>= 0.14.0, < 0.18.3 | 0.18.3 | cargo update -p cookie --precise 0.18.3 |
CVSS 3.1 vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:H/A:N
| Attack vector | Network |
|---|---|
| Attack complexity | High |
| Privileges required | None |
| User interaction | None |
| Scope | Unchanged |
| Confidentiality | Low |
| Integrity | High |
| Availability | None |
FAQ
Are Rocket and axum web applications affected?
Rocket (tested at 0.5.4) is not affected because it does not fork and handles requests on runtime worker threads created when launched. Axum (tested at 0.8.9 with axum-extra 0.12.6) is not affected when run normally on a multi-threaded runtime; it is only affected if the application forks worker processes itself, runs each on a current-thread runtime on the forking thread, and used rand::thread_rng() on that thread before forking.
Are signed cookies (SignedJar) or Windows deployments vulnerable?
No. Signed cookies (SignedJar) do not use a nonce and are unaffected, and applications on Windows-as well as any application that never calls fork()-are not affected.
Why are cookie versions 0.11.2 and earlier and 0.12.0 through 0.13.3 not affected?
Those versions obtained nonces from the operating system via ring instead of rand::thread_rng(). Fixed version 0.18.3 similarly obtains nonces directly from the operating system's random number generator, which is not affected by fork().
Original advisory description
References
- PACKAGE https://crates.io/crates/cookie
- ADVISORY https://rustsec.org/advisories/RUSTSEC-2026-0594.html
- WEB https://github.com/rwf2/cookie-rs/commit/98de6032defb10ad5e49d83fa1a9bbed1873cbe4
Source records: RUSTSEC-2026-0594 (OSV.dev).