# 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

> An attacker can corrupt memory and disclose encryption keys in Netty OHTTP codec when Unsafe is disabled, compromising connection confidentiality and integrity.

- **Severity:** Medium 6.8 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:H/SC:N/SI:N/SA:N/E:U`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 4 Jun 2026
- **Updated:** 4 Jun 2026
- **Also known as:** GHSA-32hf-8jw3-v4qq

## What is CVE-2026-48040?

CVE-2026-48040 is a medium-severity memory corruption vulnerability in netty-incubator-codec-ohttp, published on 4 Jun 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

The netty incubator codec.bhttp is a java language binary http parser. The library implements Oblivious HTTP (RFC 9458) using BoringSSL's HPKE C library via JNI. When deriving native memory addresses for cryptographic operations versions prior to 0.0.22.Final provide a fallback path for direct ByteBufs that do not expose their memory address through `hasMemoryAddress()`. This fallback occurs when `sun.misc.Unsafe` is unavailable to Netty — for example, when the JVM is started with `-Dio.netty.noUnsafe=true`, when a SecurityManager restricts Unsafe access, or when running on non-HotSpot JVMs. In these configurations, Netty's default `PooledByteBufAllocator` returns `PooledDirectByteBuf` instances for which `hasMemoryAddress()` returns false.  Under the enabling JVM configuration, an unauthenticated network attacker can cause the OHTTP gateway to corrupt memory belonging to other concurrent connections and disclose the contents of adjacent pooled direct buffers by triggering cryptographic operations with crafted OHTTP requests. The corruption occurs regardless of whether the AEAD tag verification succeeds, as BoringSSL zeroizes the output buffer on failure. The information disclosure path provides the attacker with the encryption key needed to extract the leaked data. This violates the confidentiality and integrity of all connections sharing the same Netty buffer arena. Version 0.0.22.Final fixes the issue.

Weakness: CWE-787 (Out-of-bounds Write), CWE-125 (Out-of-bounds Read)

## Which versions are affected by CVE-2026-48040?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `io.netty.incubator:netty-incubator-codec-ohttp-hpke-native-boringssl` | Maven | All versions | 0.0.22.Final |
| `io.netty.incubator:netty-incubator-codec-ohttp-hpke-native-boringssl` | Maven | All versions | 0.0.22.Final |

Products: Netty Netty-Incubator-Codec-Ohttp.

## How do I fix CVE-2026-48040?

Upgrade io.netty.incubator:netty-incubator-codec-ohttp-hpke-native-boringssl to 0.0.22.Final or later.

## Is CVE-2026-48040 being exploited?

There is no known exploitation of CVE-2026-48040 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-2024-36121](https://insights.sbomify.com/CVE-2024-36121/): netty-incubator-codec-ohttp's BoringSSLAEADContext Repeats Nonces (medium 5.9)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-48040 and fix it if it is affected.

What it is: CVE-2026-48040 is a medium-severity memory corruption vulnerability in netty-incubator-codec-ohttp, published on 4 Jun 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 CVE-2026-48040 in the wild and no public exploit code.

Affected packages and fixed versions:
- io.netty.incubator:netty-incubator-codec-ohttp-hpke-native-boringssl (Maven): affected all versions; fixed in 0.0.22.Final
- io.netty.incubator:netty-incubator-codec-ohttp-hpke-native-boringssl (Maven): affected all versions; fixed in 0.0.22.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-2026-48040/ (Markdown: https://insights.sbomify.com/CVE-2026-48040/index.md)
```

## Sources

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

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