Vulnerability HighRUSTSEC-2026-0216 · nostr
RUSTSEC-2026-0216: Remote Denial of Service via malformed NIP‑44 v2 payload
Short answerA security vulnerability in the nostr crate: Remote Denial of Service via malformed NIP‑44 v2 payload. High severity (CVSS 7.5). Fixed in 0.44.5, 0.45.0-alpha.5: update to a fixed version.
| Crate | nostr |
|---|---|
| Type | Vulnerability (denial-of-service) |
| Affected versions | Before 0.44.5; from 0.45.0-alpha.1 before 0.45.0-alpha.5. |
| Fixed in | 0.44.5, 0.45.0-alpha.5 |
| 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-25 |
| Last changed | 2026-08-01 |
| Also known as | GHSA-hrqp-8w79-gwgw |
| Affected functions | nostr::nips::nip44::decrypt, nostr::nips::nip44::decrypt_to_bytes, nostr::nips::nip44::v2::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.5") 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 NIP-44 v2 decryption path in the nostr crate contains a reachable panic when processing a short or empty ciphertext. After the HMAC check passes and the ciphertext is decrypted via ChaCha20, the code reads a 2‑byte unpadded‑length prefix via buffer[0..2] without first verifying that the decrypted buffer contains at least 2 bytes. A malicious sender who holds the symmetric conversation key (e.g., a direct‑message sender) can craft a payload that produces a 0 or 1‑byte decrypted buffer, causing an index‑out‑of‑bounds panic. This can be triggered remotely through any relay that delivers the crafted event to the victim's client, resulting in a denial of service. No key material, plaintext, or memory corruption occurs.
The vulnerability is present in all versions from 0.26.0 up to 0.44.4 (inclusive) and in the alpha releases 0.45.0‑alpha.1 through 0.45.0‑alpha.4. Versions 0.44.5 and 0.45.0‑alpha.5 contain the fix.
Credit
Discovered and responsibly disclosed by **Muhammed Shekho** (mhd-shekho.com).
References
- Package: crates.io/crates/nostr
- Advisory: rustsec.org/advisories/RUSTSEC-2026-0216.html
- Web: github.com/nostrdevkit/nostr/commit/73bdd677b872641d57a2ebcc5afc23ee0e5f0d2d
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-0219 · 2026-07-26Remote Denial of Service via malformed NIP-04 IV
- 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?