CVE-2026-142447
Published:December 02, 2026
Updated:December 03, 2026
Summary "io.netty:netty-handler-ssl-ocsp"'s "OcspServerCertificateValidator" is meant to hold off application traffic until OCSP says the peer certificate is valid. CVE-2026-56822 / the parent-class change from "ChannelInboundHandlerAdapter" to "ByteToMessageDecoder" stopped "channelRead" from forwarding bytes during the query ("decode()" is a no-op that only accumulates). In the current code (4.2.18) the listener "finally" still calls "ctx.pipeline().remove(this)" unconditionally. Removal runs "ByteToMessageDecoder.handlerRemoved()", which fires the buffered "cumulation" downstream. When the status is "REVOKED" and "closeAndThrowIfNotValid=true" (default), "ctx.close()" only schedules "fireChannelInactive" on a later event-loop task ("invokeLater" → "eventLoop().execute()"), so the "fireChannelRead" of revoked-peer data happens first. ### Details The original CVE-2026-56822 issue was classic TOCTOU: "ChannelInboundHandlerAdapter.channelRead()" passed TLS-decrypted bytes through before OCSP finished. The patch made the handler a "ByteToMessageDecoder" whose "decode()" does nothing, so inbound bytes sit in "cumulation" until the handler is removed. pom.xml revapi records "java.class.nonFinalClassInheritsFromNewClass" with "superClass=io.netty.handler.codec.ByteToMessageDecoder". The remaining hole is the listener "finally" in "userEventTriggered()": it always forwards "SslHandshakeCompletionEvent" and then "ctx.pipeline().remove(this)". "ByteToMessageDecoder.handlerRemoved()" is "final"; with readable cumulation it does "ctx.fireChannelRead(buf)" then "fireChannelReadComplete()". "OcspServerCertificateValidator" does not override "handlerRemoved0()" to drop the buffer on failure. When OCSP returns REVOKED and "closeAndThrowIfNotValid" is true: 1. "ctx.close()" runs "AbstractChannel.AbstractUnsafe.close()" → "doClose0()" then "fireChannelInactiveAndDeregister()" → "deregister()" → "invokeLater()" → "eventLoop().execute(task)" so "pipeline.fireChannelInactive()" is a later cycle. 2. "ctx.close()" returns. 3. "finally" runs synchronously: "remove(this)" → "handlerRemoved()" → "fireChannelRead(buf)" of the banner / first application record from the revoked peer. 4. The next handler's "channelRead" runs in the same stack. 5. Only afterwards does "fireChannelInactive" run — too late. The patch moved the race from "use before check" to "use after check, before close". The window is smaller but still exploitable under default "closeAndThrowIfNotValid=true" / "autoRead=true". Typical triggers are protocols that send a server banner right after the handshake (SMTP / FTP / IMAP / POP3). ### Vulnerable code "src/handler-ssl-ocsp/src/main/java/io/netty/handler/ssl/ocsp/OcspServerCertificateValidator.java" (lines 157–159, 215–237) — decode only buffers; REVOKED closes asynchronously then "finally" always removes the handler: "java protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) { // Just buffer until the handler is removed which will happen once we did finish the OCSP processing. } if (status != OcspResponse.Status.VALID && closeAndThrowIfNotValid) { ctx.fireExceptionCaught(new OCSPException( "Certificate not valid. Status: " + status)); ctx.close(); } } finally { ctx.fireUserEventTriggered(evt); ctx.pipeline().remove(this); " "src/codec-base/src/main/java/io/netty/handler/codec/ByteToMessageDecoder.java" (lines 258–276) — removal flushes cumulation to the next handler: "java public final void handlerRemoved(ChannelHandlerContext ctx) throws Exception { ... ByteBuf buf = cumulation; if (buf != null) { cumulation = null; ... if (readable > 0) { ctx.fireChannelRead(buf); ctx.fireChannelReadComplete(); } else { buf.release(); } } handlerRemoved0(ctx); } " ### PoC API recipe (component library; the entry point is any TLS client that installs "OcspServerCertificateValidator" after "SslHandler"): "java // 1. Same buffering contract as OcspServerCertificateValidator.decode(): accumulate, emit nothing. static class OcspValidatorSimulator extends ByteToMessageDecoder { @Override protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) { // no-op — buffer only } } // 2. Pipeline: [validator] → [capture] EmbeddedChannel channel = new EmbeddedChannel(validator, capture); // 3. Application data that arrived while OCSP was in flight (e.g. SMTP banner from a revoked peer): channel.writeInbound(Unpooled.copiedBuffer("220 SMTP Service Ready\r\n", UTF_8)); // capture has not seen the banner yet. // 4. Simulate the finally block: ctx.pipeline().remove(this) channel.pipeline().remove(validator); // ByteToMessageDecoder.handlerRemoved() fires ctx.fireChannelRead(buf); // capture receives "220 SMTP Service Ready\r\n" — data from the revoked server. // 5. Control: in real Netty, ctx.close() on REVOKED is async (invokeLater), so this // fireChannelRead runs before pipeline.fireChannelInactive(). " ### Impact The documented OCSP fail-closed posture after CVE-2026-56822 is bypassed: a TLS server with a revoked certificate can still deliver at least the first application records (banners, early responses) into the client pipeline. That re-enables man-in-the-middle use of revoked certificates against clients that enabled "OcspServerCertificateValidator" specifically to stop that. The trigger is unauthenticated from the client's point of view — any completed handshake against a revoked peer that speaks first after TLS is enough; default "closeAndThrowIfNotValid=true" is the vulnerable configuration.
Affected Packages
https://github.com/netty/netty.git (GITHUB):
Affected version(s) >=netty-4.2.0.Alpha1 <netty-4.2.19.FinalFix Suggestion:
Update to version netty-4.2.19.Finalhttps://github.com/netty/netty.git (GITHUB):
Affected version(s) >=netty-4.1.86.Final <netty-4.1.139.FinalFix Suggestion:
Update to version netty-4.1.139.Finalio.netty:netty-handler-ssl-ocsp (JAVA):
Affected version(s) >=4.1.86.Final <4.1.139.FinalFix Suggestion:
Update to version 4.1.139.Finalio.netty:netty-handler-ssl-ocsp (JAVA):
Affected version(s) >=4.2.0.Alpha1 <4.2.19.FinalFix Suggestion:
Update to version 4.2.19.FinalRelated Resources (3)
Do you need more information?
Contact UsCVSS v4
Base Score:
8.3
Attack Vector
NETWORK
Attack Complexity
HIGH
Attack Requirements
NONE
Privileges Required
NONE
User Interaction
NONE
Vulnerable System Confidentiality
LOW
Vulnerable System Integrity
HIGH
Vulnerable System Availability
NONE
Subsequent System Confidentiality
NONE
Subsequent System Integrity
NONE
Subsequent System Availability
NONE
CVSS v3
Base Score:
6.5
Attack Vector
NETWORK
Attack Complexity
HIGH
Privileges Required
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
LOW
Integrity
HIGH
Availability
NONE
Weakness Type (CWE)
Time-of-check Time-of-use (TOCTOU) Race Condition