GHSA-r2jw-c95q-rj29: Duplicate Advisory Cocoon Reuses A Nonce, Key Vulnerability

MODERATE
CVSS 4.5
CWE-323
Published
Advisory Summary

GHSA-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

CVE Identifier N/A
GHSA Identifier GHSA-r2jw-c95q-rj29
Severity MODERATE
CVSS v3.1 Base Score 4.5
CWE Classification CWE-323: Reusing a Nonce, Key Pair in Encryption
Affected Product Duplicate Advisory
Package Ecosystem crates.io
Published Date
Last Updated

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).

Attack Vector Local (AV:L)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (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.

cocoon fixed: 0.4.0
Upgrade cocoon to 0.4.0
Verify Direct and Transitive Dependencies

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

### Duplicate Advisory This advisory has been withdrawn because it is a duplicate of GHSA-6878-6wc2-pf5h. This link is maintained to preserve external references. ### Original 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.

GHSA-r2jw-c95q-rj29 Affected Duplicate Advisory Versions

1 component(s)
Fixed Versions:
0.4.0
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?
GHSA-r2jw-c95q-rj29 is a security vulnerability in Duplicate Advisory involving cocoon Reuses a Nonce, Key Pair in Encryption under CWE-323: Reusing a Nonce, Key Pair in Encryption.
Which Duplicate Advisory versions are affected?
Affected versions include releases prior to 0.4.0 across affected packages: cocoon.
What version fixes GHSA-r2jw-c95q-rj29?
Upgrading to 0.4.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is cocoon affected?
Yes, cocoon is affected in releases prior to 0.4.0. Upgrade your dependency to 0.4.0 or later.
What is the CVSS score of GHSA-r2jw-c95q-rj29?
GHSA-r2jw-c95q-rj29 has a CVSS v3.1 base score of 4.5 (MODERATE) with vector string CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N.
What CWE is associated with GHSA-r2jw-c95q-rj29?
GHSA-r2jw-c95q-rj29 is classified under CWE-323: Reusing a Nonce, Key Pair in Encryption (Nonces should be used for the present occasion and only once.).
How can I check crates.io dependencies for GHSA-r2jw-c95q-rj29?
Run the dependency tree command: 'inspect dependencies for cocoon'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}