Vulnerability HighRUSTSEC-2026-0219 · nostr
RUSTSEC-2026-0219: Remote Denial of Service via malformed NIP-04 IV
Short answerA security vulnerability in the nostr crate: Remote Denial of Service via malformed NIP-04 IV. High severity (CVSS 7.5). Fixed in 0.44.6, 0.45.0-alpha.6: update to a fixed version.
| Crate | nostr |
|---|---|
| Type | Vulnerability (denial-of-service) |
| Affected versions | Before 0.44.6; from 0.45.0-alpha.1 before 0.45.0-alpha.6. |
| Fixed in | 0.44.6, 0.45.0-alpha.6 |
| Severity | High, CVSS 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| Published | 2026-07-26 |
| Last changed | 2026-08-01 |
| Also known as | GHSA-xg7c-246g-6qpv |
| Affected functions | nostr::nips::nip04::decrypt, nostr::nips::nip04::decrypt_to_bytes |
What to do
- See which version you have:
cargo tree -i nostr(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p nostr. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for examplenostr = "0.45.0-alpha.6") or update the dependency that pulls it in. - Check again with
cargo audit, or paste your Cargo.lock into our Cargo.toml checker.
Details from the advisory
The nostr crate did not validate the length of the initialization vector decoded from the ?iv= portion of a NIP-04 encrypted message.
The decoded IV was converted from a byte slice to the 16-byte AES-CBC IV type using a conversion that asserts the slice length. As a result, an IV whose decoded length was not exactly 16 bytes caused a panic before ciphertext decryption. For example, ?iv=AAAA decodes to a three-byte IV and triggers the panic.
Applications that decrypt untrusted NIP-04 content are affected. The issue is also reachable through NIP-47 (Nostr Wallet Connect), where response and notification events from a malicious or compromised wallet service are passed to NIP-04 decryption. If the panic is not isolated, a crafted event can terminate the application or disrupt message processing, causing a denial of service.
The issue does not affect confidentiality or integrity.
The flaw was corrected by converting the decoded IV to [u8; 16] using a checked conversion. Invalid IV lengths now return a Malformed error instead of panicking.
Credit
Discovered and responsibly disclosed by **Muhammed Shekho** (mhd-shekho.com).
References
- Package: crates.io/crates/nostr
- Advisory: rustsec.org/advisories/RUSTSEC-2026-0219.html
- Web: github.com/nostrdevkit/nostr/commit/b24619346f666d08ef7fefe27f033b8bc871697f
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Other advisories for nostr
- Vulnerability HighRUSTSEC-2026-0216 · 2026-07-25Remote Denial of Service via malformed NIP‑44 v2 payload
- Vulnerability MediumRUSTSEC-2026-0225 · 2026-08-01Debug output exposes NIP-46 and NIP-60 credentials
- Vulnerability HighRUSTSEC-2026-0226 · 2026-08-01Wallet event parsers accept unauthenticated events
- Vulnerability HighRUSTSEC-2026-0227 · 2026-08-01NIP-44 v2 decryption permits resource exhaustion
- Vulnerability MediumRUSTSEC-2026-0228 · 2026-08-01NIP-04 parsing amplifies malformed ciphertext memory use
- Vulnerability HighRUSTSEC-2026-0229 · 2026-08-01NIP-98 authorization parsing permits resource exhaustion
- Vulnerability HighRUSTSEC-2026-0230 · 2026-08-01Empty NIP-50 search filters can panic
Up next
Same cratenostr: security historyEvery advisory for this crate, and whether it is safe to use today.Read it next →Did this answer your question?