# GHSA-xg7c-246g-6qpv: Remote Denial of Service via malformed NIP-04 IV

- Severity: High 7.5 (CVSS:3.1, scored by RustSec Advisory Database) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2026-07-26T12:00:00.000Z
- Modified: 2026-08-01T11:45:04.785Z
- Also known as: RUSTSEC-2026-0219

## Description

The `nostr` crate did not validate the length of the initialization vector
decoded from the `?iv=` portion of a NIP-04 encrypted message.

The decoded IV was converted from a byte slice to the 16-byte AES-CBC IV type
using a conversion that asserts the slice length. As a result, an IV whose
decoded length was not exactly 16 bytes caused a panic before ciphertext
decryption. For example, `?iv=AAAA` decodes to a three-byte IV and triggers the
panic.

Applications that decrypt untrusted NIP-04 content are affected. The issue is
also reachable through NIP-47 (Nostr Wallet Connect), where response and
notification events from a malicious or compromised wallet service are passed
to NIP-04 decryption. If the panic is not isolated, a crafted event can terminate
the application or disrupt message processing, causing a denial of service.

The issue does not affect confidentiality or integrity.

The flaw was corrected by converting the decoded IV to `[u8; 16]` using a
checked conversion. Invalid IV lengths now return a `Malformed` error instead of
panicking.

## Credit

Discovered and responsibly disclosed by **Muhammed Shekho** ([mhd-shekho.com](https://mhd-shekho.com)).

(As written by RustSec Advisory Database.)

## Affected

- nostr (crates.io): from 0.0.0-0 before 0.44.6; from 0.45.0-alpha.1 before 0.45.0-alpha.6

## References

- <https://crates.io/crates/nostr> (package)
- <https://rustsec.org/advisories/RUSTSEC-2026-0219.html> (advisory)
- <https://github.com/nostrdevkit/nostr/commit/b24619346f666d08ef7fefe27f033b8bc871697f> (web)

## Sources

- RustSec Advisory Database: [RUSTSEC-2026-0219](https://rustsec.org/advisories/RUSTSEC-2026-0219.html), CC0-1.0, modified 2026-08-01

---

Page: https://cve.day/GHSA-xg7c-246g-6qpv · Whole record: https://cve.day/GHSA-xg7c-246g-6qpv.json · Rebuilt by cve.day 2026-11-25T22:56:43.386Z
