{"id":"RUSTSEC-2026-0227","summary":"NIP-44 v2 decryption permits resource exhaustion","details":"The NIP-44 decryption entry point Base64-decoded the complete attacker-controlled\npayload before determining its version or enforcing any size limit. For v2 payloads,\nthe decoded buffer was then authenticated with HMAC even when it was much larger than\nthe maximum payload supported by the crate's current v2 codec.\n\nA malicious relay or event author could deliver an oversized value to an application\nthat decrypts NIP-44 content. The value caused memory allocation and Base64 and HMAC\nwork proportional to its size before authentication failed; knowledge of the\nconversation key was not required to consume those initial resources. Repeated\npayloads could exhaust memory or CPU and make the receiving application unavailable.\nThe issue does not disclose plaintext or key material and does not bypass message\nauthentication.\n\nDecryption now reads only the encoded version prefix first, derives the bound from\nthe largest payload the current v2 encoder can emit, and rejects oversized encoded\nand decoded payloads before full allocation or HMAC processing. The limit remains in\nthe v2 implementation so a future codec with a different length format can define its\nown bound.","modified":"2026-08-02T18:00:03.502118069Z","published":"2026-08-01T12:00:00Z","database_specific":{"license":"CC0-1.0"},"references":[{"type":"PACKAGE","url":"https://crates.io/crates/nostr"},{"type":"ADVISORY","url":"https://rustsec.org/advisories/RUSTSEC-2026-0227.html"},{"type":"WEB","url":"https://github.com/nostrdevkit/nostr/commit/89dc1a77eaa774174588c5a38b6324c502948830"}],"affected":[{"package":{"name":"nostr","ecosystem":"crates.io","purl":"pkg:cargo/nostr"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"0.44.7"}]}],"ecosystem_specific":{"affects":{"functions":[],"arch":[],"os":[]},"affected_functions":null},"database_specific":{"source":"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0227.json","cvss":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","informational":null,"categories":["denial-of-service"]}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"}]}