# CVE-2024-21530: Sequential calls of encryption API (`encrypt`, `wrap`, and `dump`) result in nonce reuse

- Severity: Medium 4.5 (CVSS:3.1, scored by snyk) `CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N/E:P`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.14%, higher than 3% of CVEs (2026-12-01)
- Published: 2023-10-15T12:00:00.000Z
- Modified: 2026-06-17T07:09:41.230Z
- Also known as: GHSA-6878-6wc2-pf5h, GHSA-r2jw-c95q-rj29, RUSTSEC-2023-0068
- Weaknesses: CWE-323
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: snyk

## Description

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.

(As written by CVE List.)

## Affected

- cocoon: before 0.4.0
- cocoon cocoon: before 0.4.0
- cocoon (crates.io): before 0.4.0; from 0.0.0-0 before 0.4.0

## Every score

- snyk: CVSS:3.1 4.5 Medium `CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N/E:P`
- GitHub: CVSS:3.1 4.5 Medium `CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N`
- GitHub: CVSS:4.0 Medium `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`
- RustSec Advisory Database: CVSS:3.1 4.5 Medium `CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N`

## References

- <https://security.snyk.io/vuln/SNYK-RUST-COCOON-6028364> (web)
- <https://github.com/fadeevab/cocoon/issues/22> (report, web)
- <https://github.com/fadeevab/cocoon/commit/1b6392173ce35db4736a94b62b2d2973f9a71441> (web)
- <https://rustsec.org/advisories/RUSTSEC-2023-0068.html> (advisory, web)
- <https://github.com/advisories/GHSA-6878-6wc2-pf5h> (advisory)
- <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)

## Sources

- CVE List: [CVE-2024-21530](https://www.cve.org/CVERecord?id=CVE-2024-21530), CVE Terms of Use, modified 2024-10-02
- GitHub Advisory Database: [GHSA-6878-6wc2-pf5h](https://github.com/advisories/GHSA-6878-6wc2-pf5h), CC-BY-4.0, modified 2025-12-29
- GitHub Advisory Database: [GHSA-r2jw-c95q-rj29](https://github.com/advisories/GHSA-r2jw-c95q-rj29), CC-BY-4.0, modified 2025-12-29
- RustSec Advisory Database: [RUSTSEC-2023-0068](https://rustsec.org/advisories/RUSTSEC-2023-0068.html), CC0-1.0, modified 2025-10-28
- NVD: [CVE-2024-21530](https://nvd.nist.gov/vuln/detail/CVE-2024-21530), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-21530 · Whole record: https://cve.day/CVE-2024-21530.json · Rebuilt by cve.day 2026-11-25T22:58:45.949Z
