Skip to content

RUSTSEC-2026-0228

NIP-04 parsing amplifies malformed ciphertext memory use

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

Description

The NIP-04 decryption parser split attacker-controlled content on every ?iv= separator and collected all resulting segments before checking that the message had the expected two parts. It also Base64-decoded the complete IV text before checking that it represented the required 16-byte AES-CBC IV.

A malicious sender could include a large number of separators or an oversized IV in an encrypted direct message. Applications that attempted to decrypt the message performed avoidable allocations proportional to the malformed input, with additional allocation amplification from the segment vector and Base64 output. This can consume memory and CPU in clients processing messages received through a relay. It does not weaken NIP-04 encryption or reveal plaintext or key material.

The parser now uses a single bounded split, rejects additional separators, and validates the 24-byte encoded IV length before Base64 decoding. Malformed inputs are returned as errors without allocating for every separator or decoding an arbitrarily large IV.

Affected versions

crates.io

PackageVulnerableFixed in
nostr
>= 0.0.0-0, < 0.44.7
0.44.7

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

cargo
cargo update -p nostr --precise 0.44.7

Severity breakdown

CVSS 3.1 4.3

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

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

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-0219
Remote Denial of Service via malformed NIP-04 IV
High Also affects nostr
RUSTSEC-2026-0216
Remote Denial of Service via malformed NIP‑44 v2 payload
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