CVE-2026-140014: cookie: Private cookie nonces can repeat in processes that fork
cookie is an HTTP cookie parsing and cookie jar management library for Rust. From 0.11.3 until 0.12.0 and from 0.14.0 until 0.18.3, PrivateJar generates AES-256-GCM nonces with rand::threadrng(), whose buffered state can be duplicated when a Unix-like process calls fork() without exec(). The forking thread must have used the thread-local generator before the fork, and two resulting processes must add private cookies on that same thread with a shared Key; applications that do not fork, create cookies only on post-fork threads, use SignedJar, or run on Windows are not affected. At most the first 21 private cookies added on that thread in each resulting process can reuse nonces before the generator reseeds and the processes diverge. An attacker must obtain two cookies from different resulting processes that share a nonce to recover plaintext relationships and forge private cookies accepted by the application. This issue is fixed in version 0.18.3.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 0.18.3
Event History
Frequently Asked Questions
Which deployments are affected?
Affected deployments run a vulnerable cookie release, fork on a Unix-like platform without exec(), and have the forking thread use the thread-local random generator before the fork. The resulting processes must then add private cookies on that same thread using a shared Key.
What does an attacker need to exploit this issue?
An attacker must obtain two private cookies from different post-fork processes that reused a nonce. With those cookies, the attacker can recover plaintext relationships and forge private cookies that the application accepts.
Are there configurations that are not affected?
Applications that do not fork, create cookies only on threads created after the fork, use SignedJar instead of PrivateJar, or run on Windows are not affected.
What can be done before upgrading?
Avoid the affected fork pattern: do not add private cookies on the pre-fork thread in both resulting processes, or create cookies only on post-fork threads. Upgrading to version 0.18.3 fixes the issue.
How many cookies may be exposed after a fork?
At most the first 21 private cookies added on the affected thread in each resulting process can reuse nonces. The random generator then reseeds and the processes diverge.