# RUSTSEC-2026-0337: Poly1305 panics or computes a wrong tag on attacker-chosen messages of 64 bytes or more

> An integer overflow in Poly1305 causes panics or incorrect tags on large messages, enabling denial of service or authentication bypass in Rust applications.

- **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:** 9 Oct 2026
- **Also known as:** GHSA-xr22-8pqp-gwfh

## What is RUSTSEC-2026-0337?

RUSTSEC-2026-0337 is a vulnerability in ic-cipher, published on 9 Oct 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

`Poly1305` in `ic-cipher` absorbs messages of 64 bytes or more four blocks at
a time, summing four products before one reduction. From 0.2.5 to 0.2.19 the
reduction kept its carries in 32-bit integers, which four summed products can
overflow when the message's bytes are large.

This affects `Poly1305` and `ChaCha20Poly1305`, and everything built on them:
the TLS and QUIC ChaCha20-Poly1305 suites in `ic-rustls`, HPKE with that
cipher in `ic-hpke`, and the re-exports in `ic-mac` and `ironcrypto`.

What happens depends on how the crate was compiled:

- With overflow checks on (any debug build, or a release profile with
  `overflow-checks = true`) the multiplication panics, and under
  `panic = "abort"` the process ends. The tag is computed over the ciphertext
  before it is compared, so this happens before authentication and without
  the key: anyone who can deliver a ChaCha20-Poly1305 ciphertext to be opened
  can trigger it.
- With overflow checks off (Cargo's default for release builds) the
  arithmetic wraps and the tag is computed wrong on the affected messages.

Ordinary data does not reach the defect. A message of `0xff` bytes does: in
one measurement against 0.2.19, 28 of 500 `ChaCha20Poly1305::open_detached`
calls on 1,024 bytes of `0xff` under random keys and nonces panicked in a
debug build. ChaCha20-Poly1305 derives a new Poly1305 key for every nonce, so
each message is a fresh attempt.

AES-GCM and AES-GCM-SIV are not affected, and neither are messages shorter
than 64 bytes.

The flaw was corrected in 0.2.20 by carrying in 64 bits.

It was found by running Project Wycheproof's ChaCha20-Poly1305 test vectors
against the library.

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

1 open source package ship an affected version, including ic-cipher.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `ic-cipher` | crates.io | From 0.2.5 | 0.2.20 |

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

Upgrade ic-cipher to 0.2.20 or later.

## Is RUSTSEC-2026-0337 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: RUSTSEC-2026-0337 is a vulnerability in ic-cipher, published on 9 Oct 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-0337 in the wild and no public exploit code.

Affected packages and fixed versions:
- ic-cipher (crates.io): affected from 0.2.5; fixed in 0.2.20

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

## Sources

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

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