CVE-2024-21530
MEDIUM 4.5CVSS 3.1Sequential calls of encryption API (`encrypt`, `wrap`, and `dump`) result in nonce reuse
Versions of the package cocoon before 0.4.0 are vulnerable to Reusing a Nonce, Key Pair in Encryption when the encrypt, wrap, and dump functions are sequentially called. An attacker can generate the same ciphertext by creating a new encrypted message with the same cocoon object.
Note:
The issue does NOT affect objects created with Cocoon::new which utilizes ThreadRng.
- Published
- 2 Oct 2024
- Last modified
- 17 Jun 2026
- Assigned by
- report@snyk.io
- NVD status
- Deferred
- Weakness
- CWE-323
- Also known as
- GHSA-6878-6wc2-pf5hGHSA-r2jw-c95q-rj29RUSTSEC-2023-0068
- Sources
- NVDJSONOSV GHSA-6878-6wc2-pf5hJSONOSV GHSA-r2jw-c95q-rj29JSONOSV RUSTSEC-2023-0068JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| OSV | GitHub | CVSS 4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N | |
| NVD | report@snyk.io (Secondary) | CVSS 3.1 | MEDIUM 4.5 | CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N |
| OSV | GitHub | CVSS 3.1 | MEDIUM 4.5 | CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N |
| OSV | RustSec | CVSS 3.1 | MEDIUM 4.5 | CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| OSV | crates.io | cocoon | < 0.4.0 | 0.4.0 |
| OSV | crates.io | cocoon | >= 0.0.0-0, < 0.4.0 | 0.4.0 |
References
- https://github.com/advisories/GHSA-6878-6wc2-pf5h · ADVISORY
- https://github.com/fadeevab/cocoon/commit/1b6392173ce35db4736a94b62b2d2973f9a71441 · WEB
- https://github.com/fadeevab/cocoon/issues/22 · WEB, REPORT
- https://rustsec.org/advisories/RUSTSEC-2023-0068.html · WEB, ADVISORY
- https://security.snyk.io/vuln/SNYK-RUST-COCOON-6028364 · WEB
- https://nvd.nist.gov/vuln/detail/CVE-2024-21530 · ADVISORY
- https://github.com/fadeevab/cocoon/commit · PACKAGE
- https://github.com/fadeevab/cocoon · PACKAGE
- https://crates.io/crates/cocoon · PACKAGE
History
- 25 Nov 2026 20:56 UTC · NVD: first stored (published 2 Oct 2024)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 15 Oct 2023)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 2 Oct 2024)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 24 Oct 2023)