Visit the Wiz Whimzical Shop at AWS re:Invent
Vulnerability DatabaseCVE-2026-140014

CVE-2026-140014: 
Rust vulnerability analysis and mitigation

Overview

CVE-2026-140014 is a nonce-reuse vulnerability in the cookie-rs Rust library (crate: cookie) that allows AES-256-GCM encryption to be bypassed when a Unix-like process forks without calling exec(). Affected versions are >= 0.11.3, < 0.12.0 and >= 0.14.0, < 0.18.3; the issue was disclosed on November 23, 2026, and fixed in version 0.18.3. It carries a CVSS v3.1 base score of 6.5 (Medium) (GitHub Advisory).

Technical details

The root cause is classified as CWE-323 (Reusing a Nonce, Key Pair in Encryption). PrivateJar generated 96-bit AES-256-GCM nonces using rand::thread_rng(), a thread-local PRNG that buffers its state. When a Unix process calls fork() without exec(), both the parent and child inherit identical buffered RNG state on the forking thread, causing them to produce the same sequence of nonces for subsequent private cookie encryption operations. At most the first 21 private cookies added on that thread in each resulting process (or up to ~5,400 with rand 0.10 per the fix commit notes) can share nonces before the generator reseeds. The fix replaces rand::thread_rng() with the OS-level RNG (OsRng / SysRng), which is not affected by fork (GitHub Advisory, Fix Commit).

Impact

An attacker who obtains two private cookies from different forked processes that share a nonce can recover the XOR of the two plaintexts — and thus either plaintext if the other is known — and also recover the GHASH authentication key, enabling them to forge arbitrary private cookies that the application accepts as authentic. This results in a high integrity impact (cookie forgery enabling session hijacking or privilege escalation) and a low confidentiality impact (partial plaintext recovery). Availability is not affected, and the vulnerability is limited to Unix-like systems running applications that fork worker processes and handle cookies on the forking thread (GitHub Advisory).

Exploitability

No public proof-of-concept exploit code or in-the-wild exploitation has been reported. The EPSS score is 0.0, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog. Exploitation requires a narrow set of conditions: a Unix-like deployment that forks worker processes, uses the same Key across processes, and handles private cookies on the forking thread — a configuration explicitly noted as uncommon for Rust web frameworks such as Rocket and axum (GitHub Advisory, Feedly).

Exploitation steps

  1. Identify a vulnerable deployment: Confirm the target application uses cookie-rs versions >= 0.11.3, < 0.12.0 or >= 0.14.0, < 0.18.3, runs on a Unix-like OS, forks worker processes without exec(), and handles private cookies on the forking thread with a shared Key.
  2. Collect private cookies from multiple worker processes: Interact with the application across multiple requests routed to different worker processes (e.g., by making repeated requests and observing cookie values). The nonce is the first 12 bytes of the base64-decoded cookie value.
  3. Identify nonce collisions: Decode the base64 cookie values and compare the first 12 bytes across cookies from different processes. Matching nonces indicate a collision.
  4. Recover plaintext via XOR: XOR the ciphertext portions of two cookies sharing a nonce to obtain the XOR of their plaintexts. If one plaintext is known (e.g., a predictable session field), recover the other.
  5. Recover the GHASH key and forge cookies: Using the nonce-reuse relationship and known plaintext, recover the AES-GCM GHASH authentication key. Construct a forged private cookie with an arbitrary name and value, compute a valid authentication tag, and submit it to the application as a legitimate authenticated cookie (GitHub Advisory).

Indicators of compromise

  • Network: Repeated requests to the application from the same client IP targeting endpoints that set or read private cookies, potentially probing multiple worker processes.
  • Application Logs: Unusual patterns of cookie submission where cookie values have identical first 12 bytes (nonce prefix) when base64-decoded, indicating nonce collision detection if logging is enabled.
  • Cookie Values: Two or more private cookies (base64-decoded) whose first 12 bytes are identical — a direct indicator of nonce reuse across forked processes.
  • Behavioral: Unexpected successful authentication or privilege escalation using cookies that were not legitimately issued by the application, suggesting cookie forgery (GitHub Advisory).

Mitigation and workarounds

Upgrade cookie-rs to version 0.18.3, which generates nonces using the OS-level RNG (OsRng/SysRng) instead of the thread-local PRNG, eliminating the fork-related nonce reuse. If upgrading immediately is not possible, any one of the following workarounds prevents the issue: (1) avoid using rand::thread_rng() on the forking thread before forking — use Key::from() or Key::derive_from() instead of Key::generate(); (2) in each child process immediately after forking, read and discard at least 256 bytes from rand::thread_rng() before adding any private cookie; or (3) add private cookies only on threads created after the fork. Applications that ran in an affected configuration should also rotate their encryption Key (GitHub Advisory, Release 0.18.3).

Community reactions

The advisory was authored and published by Sergio Benitez, the maintainer of cookie-rs, who provided detailed analysis of affected frameworks including Rocket and axum, confirming that both are not affected under normal deployment configurations. The advisory explicitly notes that this is an uncommon deployment pattern for Rust web applications, limiting the practical impact (GitHub Advisory).

Additional resources


Source: This report was generated using AI

Related Rust vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-w972-8m6f-772mHIGH7.5
  • Rust logoRust
  • zip
NoYesNov 30, 2026
CVE-2026-140014MEDIUM6.5
  • Rust logoRust
  • cookie
NoYesNov 30, 2026
GHSA-cqjm-xhf9-q2m4LOWN/A
  • Rust logoRust
  • reed-compiler
NoYesNov 30, 2026
GHSA-6qq4-4fc2-69v4MEDIUMN/A
  • Rust logoRust
  • reed-compiler
NoYesNov 30, 2026
GHSA-2q5f-w9jv-ghvgMEDIUMN/A
  • Rust logoRust
  • reed-compiler
NoYesNov 30, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management