
Cloud Vulnerability DB
A community-led vulnerabilities database
Only applications that call fork() and then add private (encrypted) cookies on the thread that forked, in more than one of the resulting processes. This is an uncommon way to deploy a Rust web application. In particular:
SignedJar) are not affected.
The exact conditions are listed under "Conditions" below.Private cookies are sealed with AES-256-GCM using a random 96-bit nonce. Affected versions drew the nonce from rand's thread-local generator, rand::thread_rng(). That generator hands out bytes from an internal buffer and only notices that the process has forked when the buffer is refilled. A process that forks therefore continues, in both the parent and the child, from the same buffered bytes, and the private cookies sealed first on each side of the fork use the same nonces.
Reusing a nonce under the same key breaks AES-GCM. From two private cookies that share a nonce, an attacker can:
All of the following must hold:
fork() without a subsequent exec().fork() used rand::thread_rng() at any point before the fork. Any use counts, including Key::generate(), adding a private cookie, or a call made by an unrelated crate.Key.
When they hold, at most the first 21 private cookies added on that thread in each process share nonces. After that the generator reseeds and the processes diverge.
The following are not affected:rand::thread_rng() before the fork.SignedJar), which do not use a nonce.0.12.0 through 0.13.3, and 0.11.2 and earlier, which obtained nonces from the operating system via ring.Rocket and axum were tested with cookie 0.18.2 by collecting the private cookies sent by each server process and comparing their nonces.
Rocket (0.5.4, CookieJar::add_private()) is not affected. Rocket does not fork, and it handles requests on worker threads of a runtime it creates when launched. No nonce was reused:
0.8.9, with PrivateCookieJar from axum-extra 0.12.6) is not affected as normally run. No nonce was reused:rand::thread_rng() on that thread before forking.
In that configuration, the first private cookies sent by two workers reused nonces: 19 when the parent had added one private cookie before forking, and 15 when the parent had only called Key::generate(). No nonce was reused when the parent did neither.
Other frameworks and libraries that use this crate's PrivateJar were not tested. The conditions above apply to them as well.Version 0.18.3 obtains nonces directly from the operating system's random number generator, which is not affected by fork.
If upgrading is not possible, any one of the following prevents the reuse:
rand::thread_rng(), directly or indirectly, on the forking thread before forking. In particular, create the Key with Key::from() or Key::derive_from() rather than Key::generate() before the fork.rand::thread_rng() before adding any private cookie.Key.Source: NVD
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."