Intel

AIKIDO-2026-161594

nostr-sdk is vulnerable to Uncontrolled Resource Consumption

Uncontrolled Resource ConsumptionGHSA-cjpx-rp36-fj8r Published 2 days ago

43

Medium Risk

This Affects:

PYTHONnostr-sdk
0.32.1 - 0.44.7
Fixed in 0.44.8
Are you affected? Scan for Free

TL;DR

The NIP-04 decryption parser splits attacker-controlled content on every ?iv= separator and collects all resulting segments before checking that the message has exactly two parts, and Base64-decodes the entire IV text before validating the required 16-byte length. A malicious sender can include many separators or an oversized IV in an encrypted direct message, forcing allocations proportional to the malformed input with additional amplification from the segment vector and Base64 output. This consumes memory and CPU in clients that attempt to decrypt messages received through a relay. The fix uses a single bounded split, rejects extra separators, and validates the encoded IV length before Base64 decoding.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and your application decrypts NIP-04 direct messages received through a relay.

Background info

nostr-sdk is vulnerable to Uncontrolled Resource Consumption in versions 0.32.1 - 0.44.7.

How to fix this

Upgrade the nostr-sdk library to the patch version.