rustsec-2026-0228
Vulnerability from osv_rustsec
The NIP-04 decryption parser split attacker-controlled content on every ?iv=
separator and collected all resulting segments before checking that the message had
the expected two parts. It also Base64-decoded the complete IV text before checking
that it represented the required 16-byte AES-CBC IV.
A malicious sender could include a large number of separators or an oversized IV in an encrypted direct message. Applications that attempted to decrypt the message performed avoidable allocations proportional to the malformed input, with additional allocation amplification from the segment vector and Base64 output. This can consume memory and CPU in clients processing messages received through a relay. It does not weaken NIP-04 encryption or reveal plaintext or key material.
The parser now uses a single bounded split, rejects additional separators, and validates the 24-byte encoded IV length before Base64 decoding. Malformed inputs are returned as errors without allocating for every separator or decoding an arbitrarily large IV.
{
"affected": [
{
"database_specific": {
"categories": [
"denial-of-service"
],
"cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L",
"informational": null
},
"ecosystem_specific": {
"affected_functions": null,
"affects": {
"arch": [],
"functions": [],
"os": []
}
},
"package": {
"ecosystem": "crates.io",
"name": "nostr",
"purl": "pkg:cargo/nostr"
},
"ranges": [
{
"events": [
{
"introduced": "0.0.0-0"
},
{
"fixed": "0.44.7"
}
],
"type": "SEMVER"
}
],
"versions": []
}
],
"aliases": [],
"database_specific": {
"license": "CC0-1.0"
},
"details": "The NIP-04 decryption parser split attacker-controlled content on every `?iv=`\nseparator and collected all resulting segments before checking that the message had\nthe expected two parts. It also Base64-decoded the complete IV text before checking\nthat it represented the required 16-byte AES-CBC IV.\n\nA malicious sender could include a large number of separators or an oversized IV in\nan encrypted direct message. Applications that attempted to decrypt the message\nperformed avoidable allocations proportional to the malformed input, with additional\nallocation amplification from the segment vector and Base64 output. This can consume\nmemory and CPU in clients processing messages received through a relay. It does not\nweaken NIP-04 encryption or reveal plaintext or key material.\n\nThe parser now uses a single bounded split, rejects additional separators, and\nvalidates the 24-byte encoded IV length before Base64 decoding. Malformed inputs are\nreturned as errors without allocating for every separator or decoding an arbitrarily\nlarge IV.",
"id": "RUSTSEC-2026-0228",
"modified": "2026-08-02T17:56:20Z",
"published": "2026-08-01T12:00:00Z",
"references": [
{
"type": "PACKAGE",
"url": "https://crates.io/crates/nostr"
},
{
"type": "ADVISORY",
"url": "https://rustsec.org/advisories/RUSTSEC-2026-0228.html"
},
{
"type": "WEB",
"url": "https://github.com/nostrdevkit/nostr/commit/25e4e9ce66a533d9d7f5071f6c1dae992476cf83"
}
],
"related": [],
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L",
"type": "CVSS_V3"
}
],
"summary": "NIP-04 parsing amplifies malformed ciphertext memory use"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.