Vulnerability GHSA-cg26-4c6j-2x8h

Medium Risk
MEDIUM RISK
CVSS Score: 5.3
Score Range: 4.0–6.9
Medium severity vulnerabilities (CVSS 4.0–6.9). Important issues that meaningfully reduce security confidence.
1 day ago
November 20, 2026 at 04:22 PM UTC
netty-incubator-codec-ohttp: OHTTP codecs retain consumed outer cumulation buffers after completed exchanges
0.0.20.Final and 0.0.21.Final and 0.0.22.Final and 0.0.23.Final and 0.0.24.Final and 0.0.25.Final and 0.0.26.Final
0.0.20.Final and 0.0.21.Final and 0.0.22.Final and 0.0.23.Final and 0.0.24.Final and 0.0.25.Final and 0.0.26.Final

Summary

netty-incubator-codec-ohttp: OHTTP codecs retain consumed outer cumulation buffers after completed exchanges

Details

Summary:

OHttpClientCodec and OHttpServerCodec retain the encrypted outer HttpContent in a handler-level cumulationBuffer. After a valid OHTTP exchange completes, the OHTTP request/response context is destroyed, but the outer cumulationBuffer is not released or reset. It remains referenced by the codec until a later inbound content frame replaces it or the handler is removed/channel is closed.

This can pin attacker-influenced pooled/direct buffer capacity on idle keep-alive channels. Across many long-lived idle connections, this can create availability pressure.

Affected components:

  • codec-ohttp/src/main/java/io/netty/incubator/codec/ohttp/OHttpClientCodec.java
  • codec-ohttp/src/main/java/io/netty/incubator/codec/ohttp/OHttpServerCodec.java
  • codec-ohttp/src/main/java/io/netty/incubator/codec/ohttp/OHttpRequestResponseContext.java

Root cause:

OHttpClientCodec retains inbound content into a handler-level cumulationBuffer. On LastHttpContent, it destroys only the OHttpRequestResponseContextHolder. The cumulationBuffer is released in handlerRemoved(), not immediately after successful exchange completion.

OHttpServerCodec follows the same pattern: it retains inbound content into a handler-level cumulationBuffer, and on completed request/response it destroys the OHttpRequestResponseContext. The outer cumulationBuffer remains owned by the codec and is released only when the handler is removed.

OHttpRequestResponseContext.parse() consumes bytes from the caller-provided outer cumulation buffer, but its destroy() path releases only the inner binary HTTP cumulation, not the codec-level outer cumulationBuffer.

PoC:

A local test only:

codec-ohttp/src/test/java/io/netty/incubator/codec/ohttp/OHttpCumulationBufferRetentionTest.java

The test reuses existing OHTTP test helpers and BouncyCastle crypto provider to perform valid completed OHTTP exchanges over EmbeddedChannel pairs. It sends both a small and a large request/response exchange, confirms completion, then reflects the private cumulationBuffer field from both OHttpClientCodec and OHttpServerCodec.

Command:

./mvnw -pl codec-ohttp -Dtest=OHttpCumulationBufferRetentionTest -DfailIfNoTests=false test

Observed output:

small client after completion: refCnt=1 capacity=1064 readerIndex=1064 writerIndex=1064 readableBytes=0
small server after completion: refCnt=1 capacity=1110 readerIndex=1110 writerIndex=1110 readableBytes=0
large client after completion: refCnt=1 capacity=262144 readerIndex=131114 writerIndex=131114 readableBytes=0
large server after completion: refCnt=1 capacity=262144 readerIndex=131160 writerIndex=131160 readableBytes=0
small after close: clientOldRefCnt=0 serverOldRefCnt=0
large after close: clientOldRefCnt=0 serverOldRefCnt=0
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
BUILD SUCCESS

Interpretation:

After completion, both the client and server cumulationBuffer objects have:

  • refCnt=1
  • readableBytes=0
  • large retained capacity for the large exchange
  • channel still open/active
  • OHTTP context completed/destroyed

After channel close/handler removal, the previously retained buffers are released and their old refCnt values become 0.

Impact:

A peer can complete a large valid OHTTP request/response and keep the connection open. The codec retains the high-water outer cumulation buffer for the lifetime of the idle keep-alive channel, or until a later inbound content frame replaces it. Across many idle keep-alive channels, this can pin pooled/direct memory and create availability pressure.

This is not unbounded growth per exchange on a single channel. The more precise impact is connection-lifetime retention of the current consumed high-water outer cumulation buffer.

Suggested fix:

After successful LastHttpContent processing, release and reset the codec-level outer cumulationBuffer once parsing has consumed the complete message and no unread bytes remain.

Care is needed not to release the buffer if unread bytes remain for pipelined data. A safe fix would release/reset the outer cumulationBuffer in the completed-exchange path only when the parse consumed the full outer body.

Test environment:

  • WSL Ubuntu
  • Java 11
  • Current main branch / 0.0.24.Final-SNAPSHOT
  • PoC test used BouncyCastleOHttpCryptoProvider and existing OHttpCodecsTest helpers

Affected version testing:

The issue was reproduced on the following release tags:

  • netty-incubator-codec-parent-ohttp-0.0.20.Final
  • netty-incubator-codec-parent-ohttp-0.0.21.Final
  • netty-incubator-codec-parent-ohttp-0.0.22.Final
  • netty-incubator-codec-parent-ohttp-0.0.23.Final

It was also reproduced on main / 0.0.24.Final-SNAPSHOT.

For 0.0.20.Final through 0.0.23.Final, the PoC output consistently showed:

  • large client after completion: refCnt=1 capacity=262144 ... readableBytes=0
  • large server after completion: refCnt=1 capacity=262144 ... readableBytes=0
  • large after close: clientOldRefCnt=0 serverOldRefCnt=0
  • BUILD SUCCESS

This confirms that completed exchanges leave the consumed outer cumulation buffer retained until channel/handler close in these versions.

Related Vulnerabilities

Other vulnerabilities affecting the same packages

High Risk
3 months ago
netty-incubator-codec-ohttp: [OHttpServerCodec] Native Direct-Memory Leak on AEAD Decryption Failure Leads to Gateway Denial of Service
0.0.1.Final and 0.0.2.Final and 0.0.3.Final and 0.0.4.Final and 0.0.5.Final and 0.0.6.Final and 0.0.7.Final and 0.0.8.Final and 0.0.9.Final and 0.0.10.Final and 0.0.11.Final and 0.0.12.Final and 0.0.13.Final and 0.0.14.Final and 0.0.15.Final and 0.0.16.Final and 0.0.17.Final and 0.0.18.Final and 0.0.19.Final and 0.0.20.Final and 0.0.21.Final and 0.0.22.Final GHSA-vmr9-j6wf-pmh2
0.0.1.Final and 0.0.2.Final and 0.0.3.Final and 0.0.4.Final and 0.0.5.Final and 0.0.6.Final and 0.0.7.Final and 0.0.8.Final and 0.0.9.Final and 0.0.10.Final and 0.0.11.Final and 0.0.12.Final and 0.0.13.Final and 0.0.14.Final and 0.0.15.Final and 0.0.16.Final and 0.0.17.Final and 0.0.18.Final and 0.0.19.Final and 0.0.20.Final and 0.0.21.Final and 0.0.22.Final GHSA-vmr9-j6wf-pmh2
Medium Risk
5 months ago
OHttpVersionChunkDraft: Missing Final-Chunk Enforcement Leads to Undetected Stream Truncation
0.0.1.Final and 0.0.2.Final and 0.0.3.Final and 0.0.4.Final and 0.0.5.Final and 0.0.6.Final and 0.0.7.Final and 0.0.8.Final and 0.0.9.Final and 0.0.10.Final and 0.0.11.Final and 0.0.12.Final and 0.0.13.Final and 0.0.14.Final and 0.0.15.Final and 0.0.16.Final and 0.0.17.Final and 0.0.18.Final and 0.0.19.Final and 0.0.20.Final and 0.0.21.Final GHSA-r6fj-869h-4f6q
0.0.1.Final and 0.0.2.Final and 0.0.3.Final and 0.0.4.Final and 0.0.5.Final and 0.0.6.Final and 0.0.7.Final and 0.0.8.Final and 0.0.9.Final and 0.0.10.Final and 0.0.11.Final and 0.0.12.Final and 0.0.13.Final and 0.0.14.Final and 0.0.15.Final and 0.0.16.Final and 0.0.17.Final and 0.0.18.Final and 0.0.19.Final and 0.0.20.Final and 0.0.21.Final GHSA-r6fj-869h-4f6q
Medium Risk
5 months ago
netty-incubator-codec-ohttp's HPKEContext operations may produce empty byte[] on failures
0.0.1.Final and 0.0.2.Final and 0.0.3.Final and 0.0.4.Final and 0.0.5.Final and 0.0.6.Final and 0.0.7.Final and 0.0.8.Final and 0.0.9.Final and 0.0.10.Final and 0.0.11.Final and 0.0.12.Final and 0.0.13.Final and 0.0.14.Final and 0.0.15.Final and 0.0.16.Final and 0.0.17.Final and 0.0.18.Final and 0.0.19.Final and 0.0.20.Final GHSA-f659-372h-6x3x
0.0.1.Final and 0.0.2.Final and 0.0.3.Final and 0.0.4.Final and 0.0.5.Final and 0.0.6.Final and 0.0.7.Final and 0.0.8.Final and 0.0.9.Final and 0.0.10.Final and 0.0.11.Final and 0.0.12.Final and 0.0.13.Final and 0.0.14.Final and 0.0.15.Final and 0.0.16.Final and 0.0.17.Final and 0.0.18.Final and 0.0.19.Final and 0.0.20.Final GHSA-f659-372h-6x3x
Medium Risk
2 years ago
BoringSSLAEADContext in Netty Repeats Nonces
0.0.3.Final and 0.0.4.Final and 0.0.5.Final and 0.0.6.Final and 0.0.7.Final and 0.0.8.Final and 0.0.9.Final and 0.0.10.Final GHSA-g762-h86w-8749
0.0.3.Final and 0.0.4.Final and 0.0.5.Final and 0.0.6.Final and 0.0.7.Final and 0.0.8.Final and 0.0.9.Final and 0.0.10.Final GHSA-g762-h86w-8749
View all vulnerabilities for these packages

Timeline

Published
1 day ago
November 20, 2026 at 04:22 PM UTC
Fixed (0.0.27.Final)
Unknown
Unknown
Last Modified
1 day ago
November 20, 2026 at 04:30 PM UTC