CVE-2024-21530
published 2024-10-02CVE-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…
PriorityP417medium4.5CVSS 3.1
AVLACHPRNUINSCCLILAN
EPSS
0.14%
3.8th percentile
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.
Affected
2 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| apache | cocoon | >= 0 < 0.4.0 | 0.4.0 |
| apache | cocoon | >= 0.0.0-0 < 0.4.0 | 0.4.0 |
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
OSV
Duplicate Advisory: cocoon Reuses a Nonce, Key Pair in Encryption
osv·2024-10-02
CVE-2024-21530 [MEDIUM] Duplicate Advisory: cocoon Reuses a Nonce, Key Pair in Encryption
Duplicate Advisory: cocoon Reuses a Nonce, Key Pair in Encryption
### 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
Sequential calls of encryption API (`encrypt`, `wrap`, and `dump`) result in nonce reuse
ghsa·2023-10-24
CVE-2024-21530 [MEDIUM] Sequential calls of encryption API (`encrypt`, `wrap`, and `dump`) result in nonce reuse
Sequential calls of encryption API (`encrypt`, `wrap`, and `dump`) result in nonce reuse
**Problem**: Trying to create a new encrypted message with the same cocoon object generates the same ciphertext. It mostly affects `MiniCocoon` and `Cocoon` objects with custom seeds and RNGs (where `StdRng` is used under the hood).
**Note**: The issue does **NOT** affect objects created with **`Cocoon::new`** which utilizes `ThreadRng`.
**Cause**: `StdRng` produces the same nonce because `StdRng::clone` resets its state.
**Measure**: Make encryption API mutable (`encrypt`, `wrap`, and `dump`).
**Workaround**: Create a new cocoon object with a new **seed** per each encryption.
## How to Reproduce
```rust
let cocoon = MiniCocoon::from_password(b"password", &[1; 32]);
let mut data1 = "my secret da
OSV
Sequential calls of encryption API (`encrypt`, `wrap`, and `dump`) result in nonce reuse
osv·2023-10-24
CVE-2024-21530 [MEDIUM] Sequential calls of encryption API (`encrypt`, `wrap`, and `dump`) result in nonce reuse
Sequential calls of encryption API (`encrypt`, `wrap`, and `dump`) result in nonce reuse
**Problem**: Trying to create a new encrypted message with the same cocoon object generates the same ciphertext. It mostly affects `MiniCocoon` and `Cocoon` objects with custom seeds and RNGs (where `StdRng` is used under the hood).
**Note**: The issue does **NOT** affect objects created with **`Cocoon::new`** which utilizes `ThreadRng`.
**Cause**: `StdRng` produces the same nonce because `StdRng::clone` resets its state.
**Measure**: Make encryption API mutable (`encrypt`, `wrap`, and `dump`).
**Workaround**: Create a new cocoon object with a new **seed** per each encryption.
## How to Reproduce
```rust
let cocoon = MiniCocoon::from_password(b"password", &[1; 32]);
let mut data1 = "my secret da
OSV
Sequential calls of encryption API (`encrypt`, `wrap`, and `dump`) result in nonce reuse
osv·2023-10-15
CVE-2024-21530 Sequential calls of encryption API (`encrypt`, `wrap`, and `dump`) result in nonce reuse
Sequential calls of encryption API (`encrypt`, `wrap`, and `dump`) result in nonce reuse
**Problem**: Trying to create a new encrypted message with the same cocoon
object generates the same ciphertext. It mostly affects `MiniCocoon` and
`Cocoon` objects with custom seeds and RNGs (where `StdRng` is used under
the hood).
**Note**: The issue does **NOT** affect objects created with **`Cocoon::new`**
which utilizes `ThreadRng`.
**Cause**: `StdRng` produces the same nonce because `StdRng::clone` resets its
state.
**Measure**: Make encryption API mutable (`encrypt`, `wrap`, and `dump`).
**Workaround**: Create a new cocoon object with a new **seed** per each
encryption.
## How to Reproduce
```rust
let cocoon = MiniCocoon::from_password(b"password", &[1; 32]);
let mut data1 = "my secret da
No detection rules found.
No public exploits indexed.
No writeups or analysis indexed.
2024-10-02
Published