rustsec-2026-0216
Vulnerability from osv_rustsec
Published
2026-07-25 12:00
Modified
2026-07-27 14:44
Summary
Remote Denial of Service via malformed NIP‑44 v2 payload
Details

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 (info@mhd-shekho.com, mhd-shekho.com).


{
  "affected": [
    {
      "database_specific": {
        "categories": [
          "denial-of-service"
        ],
        "cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
        "informational": null
      },
      "ecosystem_specific": {
        "affected_functions": null,
        "affects": {
          "arch": [],
          "functions": [
            "nostr::nips::nip44::decrypt",
            "nostr::nips::nip44::decrypt_to_bytes",
            "nostr::nips::nip44::v2::decrypt_to_bytes"
          ],
          "os": []
        }
      },
      "package": {
        "ecosystem": "crates.io",
        "name": "nostr",
        "purl": "pkg:cargo/nostr"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0.0.0-0"
            },
            {
              "fixed": "0.44.5"
            },
            {
              "introduced": "0.45.0-alpha.1"
            },
            {
              "fixed": "0.45.0-alpha.5"
            }
          ],
          "type": "SEMVER"
        }
      ],
      "versions": []
    }
  ],
  "aliases": [],
  "database_specific": {
    "license": "CC0-1.0"
  },
  "details": "The NIP-44 v2 decryption path in the `nostr` crate contains a reachable panic\nwhen processing a short or empty ciphertext. After the HMAC check passes and the\nciphertext is decrypted via ChaCha20, the code reads a 2\u2011byte unpadded\u2011length\nprefix via `buffer[0..2]` without first verifying that the decrypted buffer\ncontains at least 2 bytes. A malicious sender who holds the symmetric\nconversation key (e.g., a direct\u2011message sender) can craft a payload that\nproduces a 0 or 1\u2011byte decrypted buffer, causing an index\u2011out\u2011of\u2011bounds panic.\nThis can be triggered remotely through any relay that delivers the crafted\nevent to the victim\u0027s client, resulting in a denial of service. No key material,\nplaintext, or memory corruption occurs.\n\nThe vulnerability is present in all versions from `0.26.0` up to `0.44.4`\n(inclusive) and in the alpha releases `0.45.0\u2011alpha.1` through `0.45.0\u2011alpha.4`.\nVersions `0.44.5` and `0.45.0\u2011alpha.5` contain the fix.\n\n## Credit\n\nDiscovered and responsibly disclosed by **Muhammed Shekho** (info@mhd-shekho.com, [mhd-shekho.com](https://mhd-shekho.com)).",
  "id": "RUSTSEC-2026-0216",
  "modified": "2026-07-27T14:44:28Z",
  "published": "2026-07-25T12:00:00Z",
  "references": [
    {
      "type": "PACKAGE",
      "url": "https://crates.io/crates/nostr"
    },
    {
      "type": "ADVISORY",
      "url": "https://rustsec.org/advisories/RUSTSEC-2026-0216.html"
    },
    {
      "type": "WEB",
      "url": "https://github.com/nostrdevkit/nostr/commit/73bdd677b872641d57a2ebcc5afc23ee0e5f0d2d"
    }
  ],
  "related": [],
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Remote Denial of Service via malformed NIP\u201144 v2 payload"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…

Loading…