# RUSTSEC-2026-0219: Remote Denial of Service via malformed NIP-04 IV

> A remote attacker can cause a denial of service in applications using the nostr crate by sending malformed NIP-04 initialization vectors that trigger a panic.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 26 Jul 2026
- **Also known as:** GHSA-xg7c-246g-6qpv

## What is RUSTSEC-2026-0219?

RUSTSEC-2026-0219 is a denial of service vulnerability in nostr, published on 26 Jul 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

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

## Which versions are affected by RUSTSEC-2026-0219?

1 open source package ship an affected version, including nostr.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `nostr` | crates.io | From 0.0.0-0 | 0.44.6, 0.45.0-alpha.6 |

## How do I fix RUSTSEC-2026-0219?

Upgrade nostr to a fixed version for your release line: 0.44.6 or 0.45.0-alpha.6.

## Is RUSTSEC-2026-0219 being exploited?

There is no known exploitation of RUSTSEC-2026-0219 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for RUSTSEC-2026-0219 and fix it if it is affected.

What it is: RUSTSEC-2026-0219 is a denial of service vulnerability in nostr, published on 26 Jul 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of RUSTSEC-2026-0219 in the wild and no public exploit code.

Affected packages and fixed versions:
- nostr (crates.io): affected from 0.0.0-0; fixed in 0.44.6, 0.45.0-alpha.6

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/RUSTSEC-2026-0219/ (Markdown: https://insights.sbomify.com/RUSTSEC-2026-0219/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/RUSTSEC-2026-0219

---
From sbomify Insights: https://insights.sbomify.com/RUSTSEC-2026-0219/
Summaries are generated and may contain mistakes; the official description above is the record.
