Home / cocoon / cocoon / CVE-2024-21530
CVE-2024-21530: is it exploited, and which versions of cocoon are affected and fixed?
CVE-2024-21530 is a reusing a Nonce, Key Pair in Encryption vulnerability in cocoon. It is not known to be exploited: it is not in CISA's Known Exploited Vulnerabilities catalog (catalog 2026.11.30, read December 3, 2026, 16:39 UTC). Affected: cocoon before 0.4.0 (GitHub advisory GHSA-6878-6wc2-pf5h). Fixed in 0.4.0 (GitHub advisory GHSA-6878-6wc2-pf5h). Severity: Medium (4.5, CVSS 3.1, from snyk).
Data checked December 3, 2026: last read CISA KEV December 3, 2026, 16:39 UTC, CVE record November 19, 2026, 07:11 UTC and NVD November 19, 2026, 07:26 UTC.
What is CVE-2024-21530?
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.
From the CVE record by snyk, last updated October 2, 2024, 13:42 UTC.
Which versions are affected, and which fix it?
| Vendor | Product | Affected | Fixed or not affected from |
|---|---|---|---|
| cocoon | before 0.4.0 | 0.4.0 |
As the CVE record by snyk states it, last updated October 2, 2024. Version ranges are the CNA's; a version the record calls not affected is usually the fix.
Which packages are affected, and in which version is each fixed?
| Ecosystem | Package | Affected | Fixed in | Advisory |
|---|---|---|---|---|
| crates.io | cocoon | < 0.4.0 | 0.4.0 | GHSA-6878-6wc2-pf5h |
GitHub Advisory Database, reviewed advisories (CC BY 4.0); advisory updated December 29, 2025. Summary: Sequential calls of encryption API (`encrypt`, `wrap`, and `dump`) result in nonce reuse.
How severe is CVE-2024-21530?
| Score | Version | Vector | Source |
|---|---|---|---|
| Medium 4.5 | CVSS 3.1 | CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N/E:P | snyk |
Each score is shown as its source gave it: the CNA that wrote the record, CISA's ADP (vulnrichment) and the NVD. They can differ.
What the ratings mean: in CVSS 3 and 4, scores run from 0 to 10, with Low 0.1 to 3.9, Medium 4.0 to 6.9, High 7.0 to 8.9 and Critical 9.0 to 10.0. CVSS 2 has no Critical band: its High runs from 7.0 to 10.0. The vector lists how the flaw is reached (network, local), what an attacker needs (privileges, a user's click) and what it can harm.
Is CVE-2024-21530 exploited in the wild?
- CISA KEV
- Not listed (catalog 2026.11.30)
- CISA SSVC
- Exploitation: poc; automatable: no; technical impact: partial (CISA ADP, October 2, 2024)
- EPSS
- 0.14% probability of exploitation activity in the next 30 days, percentile 3.6 (FIRST EPSS, scores of December 3, 2026)
What kind of flaw is it?
- CWE-323 Reusing a Nonce, Key Pair in Encryption
Where are the vendor advisories and references?
- https://security.snyk.io/vuln/SNYK-RUST-COCOON-6028364
- https://github.com/fadeevab/cocoon/issues/22
- https://github.com/fadeevab/cocoon/commit/1b6392173ce35db4736a94b62b2d2973f9a71441
- https://rustsec.org/advisories/RUSTSEC-2023-0068.html
- https://github.com/advisories/GHSA-6878-6wc2-pf5h
Who found and reported it?
- Kyle Petryszak (finder)
As published in the CVE record; contact details are removed.
When was it published, and where is the official record?
- Reserved
- December 22, 2023
- Published
- October 2, 2024, 05:00 UTC
- CVE record updated
- October 2, 2024, 13:42 UTC by snyk
- NVD
- Deferred, last modified June 17, 2026, 07:09 UTC
- Last checked
- CVE list November 19, 2026, 07:11 UTC; NVD November 19, 2026, 07:26 UTC; KEV December 3, 2026, 16:39 UTC; EPSS December 3, 2026
- Official record
- cve.org · NVD
Questions about CVE-2024-21530
Is CVE-2024-21530 exploited in the wild?
Not as far as CISA knows: it is not in the Known Exploited Vulnerabilities catalog, read December 3, 2026, 16:39 UTC. FIRST's EPSS gives it a 0.14% chance of exploitation activity in the next 30 days (scores of December 3, 2026).
Which versions of cocoon are affected by CVE-2024-21530?
cocoon before 0.4.0, per the GitHub advisory GHSA-6878-6wc2-pf5h. The tables above give every range the sources list.
Which version fixes CVE-2024-21530?
0.4.0, per the GitHub advisory GHSA-6878-6wc2-pf5h. Check the vendor's advisory before you rely on it.
How severe is CVE-2024-21530?
Medium (4.5, CVSS 3.1, from snyk). The severity table above shows each score with its source.
Where is the official record of CVE-2024-21530?
The CVE Program's record is at cve.org and the NVD's at nvd.nist.gov. For a fix, the vendor's own advisory is the one to follow.