Skip to content

RUSTSEC-2026-0216 GHSA-hrqp-8w79-gwgw

Remote Denial of Service via malformed NIP‑44 v2 payload

High crates.io
Severity
7.5 / 10
High · CVSS 3.1
Exploit chance (EPSS)
—
No score published
Known exploited
No
Not in CISA's catalog
Weakness
—
Not classified
Fix
0.45.0-alpha.5
Upgrade nostr to this version or later

Description

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

Affected versions

crates.io

PackageVulnerableFixed in
nostr
>= 0.0.0-0, < 0.44.5
>= 0.45.0-alpha.1, < 0.45.0-alpha.5
0.44.5
0.45.0-alpha.5

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

nostr crates.io → 0.45.0-alpha.5

cargo
cargo update -p nostr --precise 0.45.0-alpha.5

Severity breakdown

CVSS 3.1 7.5

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

References

Timeline

  1. Published
  2. Last updated by the source
AdvisorySeverityWhy it's related
RUSTSEC-2026-0230
Empty NIP-50 search filters can panic
High Also affects nostr
RUSTSEC-2026-0229
NIP-98 authorization parsing permits resource exhaustion
High Also affects nostr
RUSTSEC-2026-0226
Wallet event parsers accept unauthenticated events
High Also affects nostr
RUSTSEC-2026-0227
NIP-44 v2 decryption permits resource exhaustion
High Also affects nostr
RUSTSEC-2026-0225
Debug output exposes NIP-46 and NIP-60 credentials
Medium Also affects nostr
RUSTSEC-2026-0228
NIP-04 parsing amplifies malformed ciphertext memory use
Medium Also affects nostr
RUSTSEC-2026-0219
Remote Denial of Service via malformed NIP-04 IV
High Also affects nostr
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor