{"id":"DHI-u4kl-ioaw-mxqb-nbw7","summary":"### Summary","details":"### Summary\n\nA remote, unauthenticated peer can leak one direct `ByteBuf` per HTTP/2 `DATA` frame in\napplications that enable HTTP/2 content decompression via `DelegatingDecompressorFrameListener`.\nWhen a `DATA` frame is processed for a stream whose decompressor has already been closed,\n`Http2Decompressor.decompress(...)` retains the frame buffer but never releases it on the error\npath, so its reference count never returns to zero. Repeating this over a long-lived HTTP/2\nconnection exhausts direct memory and crashes the JVM with `OutOfMemoryError` — a denial of service.\n\n### Details\n\nIn `codec-http2/src/main/java/io/netty/handler/codec/http2/DelegatingDecompressorFrameListener.java`,\n`Http2Decompressor.decompress(...)` does:\n\n```java\n// around line 433\ndecompressor.writeInbound(data.retain());\n```\n\nThe argument `data.retain()` is evaluated **before** `writeInbound(...)` executes, incrementing the\nbuffer's reference count (`refCnt: 1 -\u003e 2`). The very first statement of\n`EmbeddedChannel.writeInbound(...)` is `ensureOpen()` (`EmbeddedChannel.java:360`), which throws\n`ClosedChannelException` when the decompressor's internal `EmbeddedChannel` has already been closed.\n\nWhen that happens:\n- the `DATA` payload has been `retain()`ed but never entered the pipeline, so the decoder's\n  `finally { release() }` never runs;\n- the surrounding `catch (Throwable t)` block in `decompress(...)` (around line 451) does **not**\n  release the extra reference;\n- the input buffer therefore can never reach refCnt 0, and its (typically direct) memory is leaked.\n\nThe decompressor channel is closed on a reachable path:\n`Http2Connection` `onStreamRemoved` → `Http2Decompressor.cleanup()` →\n`EmbeddedChannel.finishAndReleaseAll()`\n(`DelegatingDecompressorFrameListener.java:125-133` and `418-420`).\n\nA peer that sends `DATA` frames for a stream whose decompressor has already been cleaned up (e.g.\ncontinuing to send `DATA` after `END_STREAM` / stream removal) thus leaks one direct `ByteBuf` per\nframe.\n\n**Affected code**: `DelegatingDecompressorFrameListener.java`, method `Http2Decompressor.decompress(...)`\n— the `decompressor.writeInbound(data.retain())` call (line ~433) and its `catch (Throwable t)`\nblock (line ~451), which lacks a `data.release()` rollback.\n\n**Suggested fix**: track whether `writeInbound` succeeded and roll back the extra `retain()` only when\nthe data never entered the pipeline:\n\n```java\nboolean writeSucceeded = false;\ntry {\n    decompressor.writeInbound(data.retain());\n    writeSucceeded = true;            // pipeline now owns the release\n    if (endOfStream) {\n        decompressor.finish();\n    }\n    return 0;\n} catch (Throwable t) {\n    if (!writeSucceeded) {\n        data.release();               // roll back the extra retain(); data never entered pipeline\n    }\n    if (t instanceof Http2Exception) {\n        throw (Http2Exception) t;\n    }\n    throw streamError(stream.id(), INTERNAL_ERROR, t, ...);\n}\n```\n\n| Case | writeSucceeded | catch action | Reason |\n|------|:---:|---|---|\n| `ensureOpen()` throws (this bug) | `false` | `data.release()` | data never entered pipeline |\n| handler throws internally | `true` | no release | decoder `finally` already released |\n| `finish()` throws | `true` | no release | `writeInbound` already succeeded |\n\n### PoC\n\nReproduced against the official, unmodified `netty-codec-http2-4.2.15.Final.jar` from Maven Central,\nusing real netty classes and measuring `ByteBuf.refCnt()` directly (the leaking logic is not mocked).\n\nReproduction steps:\n\n1. Download the official artifacts and their dependencies from Maven Central (version `4.2.15.Final`):\n   `netty-common`, `netty-buffer`, `netty-transport`, `netty-resolver`, `netty-handler`,\n   `netty-codec-base`, `netty-codec`, `netty-codec-http`, `netty-codec-http2`,\n   `netty-codec-compression`.\n2. Build a real `Http2Decompressor` wrapping a real gzip decoder `EmbeddedChannel`\n   (`ZlibCodecFactory.newZlibDecoder(ZlibWrapper.GZIP)`).\n3. Close the internal decompressor channel (equivalent to the end state of\n   `cleanup()` / `finishAndReleaseAll()`).\n4. Encode a real gzip `DATA` payload with `ZlibCodecFactory.newZlibEncoder(GZIP)` (`refCnt = 1`).\n5. Call `decompress(...)` on the closed channel.\n6. Observe: `writeInbound(...)` throws `ClosedChannelException` at its `ensureOpen()` entry\n   (`EmbeddedChannel.java:360`), reached from `DelegatingDecompressorFrameListener.java:433`;\n   `data.refCnt()` is now `2`.\n7. Release once as the frame reader would; `refCnt` stays at `1` (`release()` returns `false`) → leaked.\n\nObserved reference-count trace:\n\n```\ngzipData initial refCnt = 1\ndecompress -\u003e data.retain()        -\u003e refCnt = 2   (retain applied, never rolled back)\ncaller releases once               -\u003e refCnt = 1   (release() returns false; not deallocated)\n=\u003e buffer never reaches 0 -\u003e direct memory leaked\n```\n\nObserved exception stack (confirms the leak point):\n\n```\njava.nio.channels.ClosedChannelException\n    at io.netty.channel.embedded.EmbeddedChannel.checkOpen(EmbeddedChannel.java:959)\n    at io.netty.channel.embedded.EmbeddedChannel.ensureOpen(EmbeddedChannel.java:979)\n    at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:360)\n    at io.netty.handler.codec.http2.DelegatingDecompressorFrameListener$Http2Decompressor\n            .decompress(DelegatingDecompressorFrameListener.java:433)\n```\n\nTwo notes on the harness (they do not affect the leak mechanism):\n- The internal channel is closed directly via `close()` rather than through `cleanup()`. The end\n  state is identical (channel closed → `writeInbound` throws at `ensureOpen()`); the bug depends on\n  \"channel closed → retain not rolled back\", not on *how* the channel was closed.\n- In the isolated harness the rethrown `StreamException`'s root cause shows as `NullPointerException`\n  because the harness does not initialise an `Http2LocalFlowController` (a secondary exception\n  reported during channel close). The leak is already sealed at the `ClosedChannelException` thrown\n  by `writeInbound`'s `ensureOpen()` (line 360); in a real server with the flow controller\n  initialised, the triggering exception is the `ClosedChannelException` itself.\n\nA complete self-contained PoC (`Verify02DecompressLeak.java`, ~150 lines, no test framework) plus the\nexact `javac` / `java` commands can be attached on request.\n\n### Impact\n\n- **Vulnerability type**: uncontrolled resource consumption / memory leak (CWE-401), leading to\n  denial of service. Each crafted `DATA` frame leaks one (typically direct/off-heap) `ByteBuf`.\n- **Who is impacted**: any server (or client) that enables HTTP/2 content decompression by installing\n  `DelegatingDecompressorFrameListener` in its HTTP/2 pipeline.\n- **Attacker requirements**: remote, unauthenticated. The attacker only needs to send HTTP/2 `DATA`\n  frames for a stream whose decompressor has been cleaned up (e.g. continue sending `DATA` after\n  `END_STREAM`). No special server configuration beyond decompression being enabled.\n- **Result**: sustained triggering over a long-lived connection exhausts direct memory and crashes\n  the JVM with `OutOfMemoryError`.","modified":"2026-11-21T14:30:45.842268455Z","published":"2026-11-10T05:59:26Z","upstream":["CVE-2026-56819"],"references":[{"type":"ADVISORY","url":"https://scout.docker.com/v/DHI-u4kl-ioaw-mxqb-nbw7"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-93wv-jw9v-4972"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-56819"},{"type":"ADVISORY","url":"https://github.com/netty/netty/security/advisories/GHSA-93wv-jw9v-4972"},{"type":"FIX","url":"https://github.com/netty/netty/commit/bb2ff68a1fb71cb4b0eb9a9e17b66c52aff680c6"},{"type":"FIX","url":"https://github.com/netty/netty/commit/5b68c61f37aa4a3045cba624cbea239655c9003b"},{"type":"WEB","url":"https://github.com/netty/netty/releases/tag/netty-4.2.16.Final"},{"type":"WEB","url":"https://github.com/netty/netty/releases/tag/netty-4.1.136.Final"},{"type":"ADVISORY","url":"https://security-tracker.debian.org/tracker/CVE-2026-56819"},{"type":"ADVISORY","url":"https://ubuntu.com/security/CVE-2026-56819"},{"type":"ADVISORY","url":"http://people.ubuntu.com/~ubuntu-security/cve/CVE-2026-56819"}],"affected":[{"package":{"name":"janusgraph-1.0","ecosystem":"Docker Hardened Images:Alpine:3.24","purl":"pkg:apk/dhi/janusgraph-1.0"},"versions":["1.0.1-r0","1.0.1-r1","1.0.1-r10","1.0.1-r11","1.0.1-r2","1.0.1-r3","1.0.1-r4","1.0.1-r5","1.0.1-r6","1.0.1-r7","1.0.1-r8","1.0.1-r9"],"database_specific":{"source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-u4kl-ioaw-mxqb-nbw7.json","owner_kind":"HSP"}},{"package":{"name":"janusgraph-1.1","ecosystem":"Docker Hardened Images:Alpine:3.24","purl":"pkg:apk/dhi/janusgraph-1.1"},"versions":["1.1.0-r0","1.1.0-r1","1.1.0-r10","1.1.0-r11","1.1.0-r12","1.1.0-r13","1.1.0-r17","1.1.0-r18","1.1.0-r2","1.1.0-r3","1.1.0-r4","1.1.0-r5","1.1.0-r6","1.1.0-r7","1.1.0-r8","1.1.0-r9"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-u4kl-ioaw-mxqb-nbw7.json"}},{"package":{"name":"janusgraph-1.2","ecosystem":"Docker Hardened Images:Alpine:3.24","purl":"pkg:apk/dhi/janusgraph-1.2"},"versions":["1.2.0-r0","1.2.0-r1","1.2.0-r10","1.2.0-r2","1.2.0-r3","1.2.0-r4","1.2.0-r9"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-u4kl-ioaw-mxqb-nbw7.json"}},{"package":{"name":"cloud-sdk-emulators","ecosystem":"Docker Hardened Images:Debian:13","purl":"pkg:deb/dhi/cloud-sdk-emulators"},"versions":["578.0.0-0","578.0.0-1","579.0.0-0","580.0.0-2","581.0.0-0","581.0.0-1","581.0.0-2","582.0.0-0","582.0.0-1","583.0.0-0","583.0.0-1","583.0.0-2","584.0.0-0","584.0.0-1","584.0.0-2","585.0.0-0","586.0.0-0","586.0.0-1","587.0.0-0","587.0.0-1","588.0.0-0","588.0.0-1","588.0.0-2","589.0.0-0","590.0.0-0","590.0.1-0","591.0.0-0","591.0.0-1","591.0.0-2","592.0.0-0","593.0.0-0","593.0.0-1","593.0.0-10","593.0.0-11","593.0.0-12","593.0.0-13","593.0.0-2","593.0.0-3","593.0.0-4","593.0.0-5","593.0.0-6","593.0.0-7","593.0.0-8","593.0.0-9","594.0.0-1","594.0.0-2","594.0.0-3"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-u4kl-ioaw-mxqb-nbw7.json"}},{"package":{"name":"janusgraph-1.0","ecosystem":"Docker Hardened Images:Debian:13","purl":"pkg:deb/dhi/janusgraph-1.0"},"versions":["1.0.1-0","1.0.1-1","1.0.1-10","1.0.1-11","1.0.1-12","1.0.1-13","1.0.1-2","1.0.1-3","1.0.1-4","1.0.1-5","1.0.1-6","1.0.1-7","1.0.1-8","1.0.1-9"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-u4kl-ioaw-mxqb-nbw7.json"}},{"package":{"name":"janusgraph-1.1","ecosystem":"Docker Hardened Images:Debian:13","purl":"pkg:deb/dhi/janusgraph-1.1"},"versions":["1.1.0-0","1.1.0-1","1.1.0-10","1.1.0-11","1.1.0-12","1.1.0-13","1.1.0-14","1.1.0-15","1.1.0-16","1.1.0-17","1.1.0-18","1.1.0-2","1.1.0-3","1.1.0-4","1.1.0-5","1.1.0-6","1.1.0-7","1.1.0-8","1.1.0-9"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-u4kl-ioaw-mxqb-nbw7.json"}},{"package":{"name":"janusgraph-1.2","ecosystem":"Docker Hardened Images:Debian:13","purl":"pkg:deb/dhi/janusgraph-1.2"},"versions":["1.2.0-0","1.2.0-1","1.2.0-10","1.2.0-2","1.2.0-3","1.2.0-4","1.2.0-5","1.2.0-6","1.2.0-7","1.2.0-8","1.2.0-9"],"database_specific":{"source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-u4kl-ioaw-mxqb-nbw7.json","owner_kind":"HSP"}},{"package":{"name":"kafka-ui","ecosystem":"Docker Hardened Images:Debian:13","purl":"pkg:deb/dhi/kafka-ui"},"versions":["0.7.2-0","0.7.2-1","0.7.2-10","0.7.2-11","0.7.2-12","0.7.2-13","0.7.2-14","0.7.2-15","0.7.2-16","0.7.2-17","0.7.2-18","0.7.2-19","0.7.2-2","0.7.2-20","0.7.2-3","0.7.2-4","0.7.2-5","0.7.2-6","0.7.2-7","0.7.2-8","0.7.2-9"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-u4kl-ioaw-mxqb-nbw7.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"}]}