# CVE-2024-36121: netty-incubator-codec-ohttp's BoringSSLAEADContext Repeats Nonces

> An integer overflow in Netty's OHTTP codec causes nonce reuse, potentially allowing attackers to decrypt or forge encrypted responses.

- **Severity:** Medium 5.9 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 4 Jun 2024
- **Updated:** 6 Aug 2024
- **Also known as:** GHSA-g762-h86w-8749

## What is CVE-2024-36121?

CVE-2024-36121 is a medium-severity vulnerability in netty-incubator-codec-ohttp, published on 4 Jun 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

netty-incubator-codec-ohttp is the OHTTP implementation for netty. BoringSSLAEADContext keeps track of how many OHTTP responses have been sent and uses this sequence number to calculate the appropriate nonce to use with the encryption algorithm. Unfortunately, two separate errors combine which would allow an attacker to cause the sequence number to overflow and thus the nonce to repeat.

Weakness: CWE-323 (Reusing a Nonce, Key Pair in Encryption), CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor), CWE-190 (Integer Overflow or Wraparound)

## Which versions are affected by CVE-2024-36121?

2 open source packages ship an affected version, including io.netty.incubator:netty-incubator-codec-ohttp. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `io.netty.incubator:netty-incubator-codec-ohttp` | Maven | From 0.0.3.Final | 0.0.11.Final |
| `io.netty.incubator:netty-incubator-codec-ohttp` | Maven | From 0.0.3.Final | 0.0.11.Final |

Products: Netty Netty-Incubator-Codec-Ohttp.

## How do I fix CVE-2024-36121?

Upgrade io.netty.incubator:netty-incubator-codec-ohttp to 0.0.11.Final or later.

## Is CVE-2024-36121 being exploited?

There is no known exploitation of CVE-2024-36121 in the wild and no public exploit code.

## Other vulnerabilities in netty-incubator-codec-ohttp

- [CVE-2024-40642](https://insights.sbomify.com/CVE-2024-40642/): Absent Input Validation in BinaryHttpParser in the netty incubator codec.bhttp (high 8.1)
- [CVE-2026-41207](https://insights.sbomify.com/CVE-2026-41207/): netty-incubator-codec-ohttp's HPKEContext operations may produce empty byte[] on failures (medium 6.9)
- [CVE-2026-48040](https://insights.sbomify.com/CVE-2026-48040/): netty-incubator-codec-ohttp's Incorrect Native Pointer Derivation in Pooled Direct ByteBuf Fallback Leads to Out-of-Bounds Native Memory Access (medium 6.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-36121 and fix it if it is affected.

What it is: CVE-2024-36121 is a medium-severity vulnerability in netty-incubator-codec-ohttp, published on 4 Jun 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2024-36121 in the wild and no public exploit code.

Affected packages and fixed versions:
- io.netty.incubator:netty-incubator-codec-ohttp (Maven): affected from 0.0.3.Final; fixed in 0.0.11.Final
- io.netty.incubator:netty-incubator-codec-ohttp (Maven): affected from 0.0.3.Final; fixed in 0.0.11.Final

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/CVE-2024-36121/ (Markdown: https://insights.sbomify.com/CVE-2024-36121/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-36121
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-36121
- OSV: https://osv.dev/vulnerability/CVE-2024-36121

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