GHSA-r2jw-c95q-rj29: Duplicate Advisory Cocoon Reuses A Nonce, Key Vulnerability
MODERATEGHSA-r2jw-c95q-rj29 is a MODERATE (CVSS 4.5) cocoon reuses a nonce, key vulnerability (CWE-323: Reusing a Nonce, Key Pair in Encryption) affecting Duplicate Advisory libraries in the crates.io ecosystem. The issue involves cocoon reuses a nonce, key pair in encryption. Remediation is available by upgrading affected packages to version 0.4.0.
GHSA-r2jw-c95q-rj29 at a Glance
Security Impact
CVSS: 4.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N).
How to Fix GHSA-r2jw-c95q-rj29
To remediate this vulnerability, upgrade all affected Duplicate Advisory dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade cocoon to 0.4.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for cocoon
How to Check if You Are Affected
To determine whether your application is affected by GHSA-r2jw-c95q-rj29, inspect your project dependencies for Duplicate Advisory:
inspect dependencies for cocoon
Analyze the terminal output to locate any version of Duplicate Advisory in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.4.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-323: Reusing a Nonce, Key Pair in Encryption, where nonces should be used for the present occasion and only once. In Duplicate Advisory, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-r2jw-c95q-rj29 Affected Duplicate Advisory Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
cocoon
|
crates.io |
< 0.4.0
|
0.4.0
|
References
Frequently Asked Questions
What is GHSA-r2jw-c95q-rj29?
Which Duplicate Advisory versions are affected?
What version fixes GHSA-r2jw-c95q-rj29?
Is cocoon affected?
What is the CVSS score of GHSA-r2jw-c95q-rj29?
What CWE is associated with GHSA-r2jw-c95q-rj29?
How can I check crates.io dependencies for GHSA-r2jw-c95q-rj29?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-r2jw-c95q-rj29",
"modified" : "2025-12-29T22:23:36Z",
"published" : "2024-10-02T06:30:26Z",
"withdrawn" : "2025-12-29T22:23:36Z",
"aliases" : [ ],
"summary" : "Duplicate Advisory: cocoon Reuses a Nonce, Key Pair in Encryption",
"details" : "### Duplicate Advisory\nThis advisory has been withdrawn because it is a duplicate of GHSA-6878-6wc2-pf5h. This link is maintained to preserve external references.\n\n### Original Description\nVersions 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.\n\n**Note:**\nThe issue does NOT affect objects created with Cocoon::new which utilizes ThreadRng.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N"
}, {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "cocoon"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.4.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-21530"
}, {
"type" : "WEB",
"url" : "https://github.com/fadeevab/cocoon/issues/22"
}, {
"type" : "WEB",
"url" : "https://github.com/fadeevab/cocoon/commit/1b6392173ce35db4736a94b62b2d2973f9a71441"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-6878-6wc2-pf5h"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/fadeevab/cocoon"
}, {
"type" : "WEB",
"url" : "https://rustsec.org/advisories/RUSTSEC-2023-0068.html"
}, {
"type" : "WEB",
"url" : "https://security.snyk.io/vuln/SNYK-RUST-COCOON-6028364"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-323" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-10-02T17:57:49Z",
"nvd_published_at" : "2024-10-02T05:15:11Z"
}
}