Intel

AIKIDO-2026-611773

nostr is vulnerable to Denial of Service (DoS)

Denial of Service (DoS)GHSA-hrqp-8w79-gwgw Published 6 days ago

75

High Risk

This Affects:

RUSTnostr
0.26.0 - 0.44.4
Fixed in 0.44.5
Are you affected? Scan for Free

TL;DR

The NIP-44 v2 decryption path in the nostr crate reads a two-byte padding-length prefix from the decrypted buffer without first checking that the payload and decrypted buffer are large enough. A sender who shares the conversation key, including anyone who crafts a gift-wrapped event addressed to the victim's public key, can produce a short payload with a valid HMAC whose decrypted buffer holds zero or one byte. When decrypt or decrypt_to_bytes processes such a payload it performs an out-of-bounds slice access and panics, aborting the operation and potentially crashing the client that decrypts the event. The fix rejects payloads below the minimum NIP-44 v2 size and replaces the unchecked slice indexing with bounds-checked reads.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and your application decrypts NIP-44 v2 payloads from untrusted senders, such as NIP-17 direct messages or NIP-59 gift wraps.

Background info

nostr is vulnerable to Denial of Service (DoS) in versions 0.26.0 - 0.44.4.

How to fix this

Upgrade the nostr library to the patch version.