{"id":"RUSTSEC-2026-0337","revision":"4dfdb8fa85ea441c93eab1e6a19861e4","records":[{"revision":"4dfdb8fa85ea441c93eab1e6a19861e4","observedAt":"2026-10-24T13:19:54.901+00:00","statement":{"source":"osv","id":"RUSTSEC-2026-0337","aliases":["GHSA-xr22-8pqp-gwfh"],"title":"Poly1305 panics or computes a wrong tag on attacker-chosen messages of 64 bytes or more","description":"`Poly1305` in `ic-cipher` absorbs messages of 64 bytes or more four blocks at\na time, summing four products before one reduction. From 0.2.5 to 0.2.19 the\nreduction kept its carries in 32-bit integers, which four summed products can\noverflow when the message's bytes are large.\n\nThis affects `Poly1305` and `ChaCha20Poly1305`, and everything built on them:\nthe TLS and QUIC ChaCha20-Poly1305 suites in `ic-rustls`, HPKE with that\ncipher in `ic-hpke`, and the re-exports in `ic-mac` and `ironcrypto`.\n\nWhat happens depends on how the crate was compiled:\n\n- With overflow checks on (any debug build, or a release profile with\n  `overflow-checks = true`) the multiplication panics, and under\n  `panic = \"abort\"` the process ends. The tag is computed over the ciphertext\n  before it is compared, so this happens before authentication and without\n  the key: anyone who can deliver a ChaCha20-Poly1305 ciphertext to be opened\n  can trigger it.\n- With overflow checks off (Cargo's default for release builds) the\n  arithmetic wraps and the tag is computed wrong on the affected messages.\n\nOrdinary data does not reach the defect. A message of `0xff` bytes does: in\none measurement against 0.2.19, 28 of 500 `ChaCha20Poly1305::open_detached`\ncalls on 1,024 bytes of `0xff` under random keys and nonces panicked in a\ndebug build. ChaCha20-Poly1305 derives a new Poly1305 key for every nonce, so\neach message is a fresh attempt.\n\nAES-GCM and AES-GCM-SIV are not affected, and neither are messages shorter\nthan 64 bytes.\n\nThe flaw was corrected in 0.2.20 by carrying in 64 bits.\n\nIt was found by running Project Wycheproof's ChaCha20-Poly1305 test vectors\nagainst the library.","state":0,"publishedAt":"2026-10-09T12:00:00+00:00","modifiedAt":"2026-10-12T18:15:01.9740784+00:00","affected":[{"ecosystem":"crates.io","name":"ic-cipher","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0.2.5"},{"kind":"fixed","version":"0.2.20"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":null,"severity":null}],"references":["https://crates.io/crates/ic-cipher","https://rustsec.org/advisories/RUSTSEC-2026-0337.html","https://github.com/nervosys/IronCrypto/commit/a8160a18b5c66288f05dc62f5ea2159c687b9416"],"sourceUrl":"https://osv.dev/vulnerability/RUSTSEC-2026-0337","license":"OSV · upstream source license applies","key":"osv:RUSTSEC-2026-0337","identifiers":["RUSTSEC-2026-0337","GHSA-xr22-8pqp-gwfh"]},"retained":false,"historicalAffected":[]}],"coverage":[]}