# RUSTSEC-2026-0216: Remote Denial of Service via malformed NIP‑44 v2 payload

> A remote attacker with a conversation key can cause a denial of service in the nostr crate by sending a malformed NIP-44 v2 payload that triggers a panic.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 25 Jul 2026
- **Also known as:** GHSA-hrqp-8w79-gwgw

## What is RUSTSEC-2026-0216?

RUSTSEC-2026-0216 is a denial of service vulnerability in nostr, published on 25 Jul 2026. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

The NIP-44 v2 decryption path in the `nostr` crate contains a reachable panic
when processing a short or empty ciphertext. After the HMAC check passes and the
ciphertext is decrypted via ChaCha20, the code reads a 2‑byte unpadded‑length
prefix via `buffer[0..2]` without first verifying that the decrypted buffer
contains at least 2 bytes. A malicious sender who holds the symmetric
conversation key (e.g., a direct‑message sender) can craft a payload that
produces a 0 or 1‑byte decrypted buffer, causing an index‑out‑of‑bounds panic.
This can be triggered remotely through any relay that delivers the crafted
event to the victim's client, resulting in a denial of service. No key material,
plaintext, or memory corruption occurs.

The vulnerability is present in all versions from `0.26.0` up to `0.44.4`
(inclusive) and in the alpha releases `0.45.0‑alpha.1` through `0.45.0‑alpha.4`.
Versions `0.44.5` and `0.45.0‑alpha.5` contain the fix.

## Credit

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

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

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.5, 0.45.0-alpha.5 |

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

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

## Is RUSTSEC-2026-0216 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: RUSTSEC-2026-0216 is a denial of service vulnerability in nostr, published on 25 Jul 2026. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of RUSTSEC-2026-0216 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.5, 0.45.0-alpha.5

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-0216/ (Markdown: https://insights.sbomify.com/RUSTSEC-2026-0216/index.md)
```

## Sources

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

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