CVE-2026-56822: Netty Remote Code Execution Vulnerability
HIGHCVE-2026-56822 is a HIGH (CVSS 7.4) remote code execution vulnerability (CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition) affecting Netty libraries in the Maven ecosystem. The issue involves toctou in ocspservercertificatevalidator. Remediation is available by upgrading affected packages to version 4.2.16.Final, 4.1.136.Final.
CVE-2026-56822 at a Glance
Security Impact
CVSS: 7.4
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N).
How to Fix CVE-2026-56822
To remediate this vulnerability, upgrade all affected Netty dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler-ssl-ocsp</artifactId>
<version>4.2.16.Final</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler-ssl-ocsp</artifactId>
<version>4.1.136.Final</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=io.netty
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2026-56822, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=io.netty
Analyze the terminal output to locate any version of Netty in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.2.16.Final), your application is affected.
Note: The mvn dependency:tree -Dincludes=io.netty command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition, where the product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check. In Netty, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-56822 Affected Netty Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
io.netty:netty-handler-ssl-ocsp
|
Maven |
≥ 4.2.0.Final
< 4.2.16.Final
|
4.2.16.Final
|
|
io.netty:netty-handler-ssl-ocsp
|
Maven |
< 4.1.136.Final
|
4.1.136.Final
|
References
Frequently Asked Questions
What is CVE-2026-56822?
Which Netty versions are affected?
What version fixes CVE-2026-56822?
Is netty-handler-ssl-ocsp affected?
What is the CVSS score of CVE-2026-56822?
What CWE is associated with CVE-2026-56822?
How can I check Maven dependencies for CVE-2026-56822?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-wc96-39fc-566f",
"modified" : "2026-07-22T21:47:41Z",
"published" : "2026-07-22T21:47:41Z",
"aliases" : [ "CVE-2026-56822" ],
"summary" : "Netty: TOCTOU in OcspServerCertificateValidator",
"details" : "### Summary\nNetty's OcspServerCertificateValidator forwards the SslHandshakeCompletionEvent before the asynchronous OCSP validation completes. This allows the client's downstream handlers to send sensitive application data (e.g., HTTP requests) to a revoked server before the channel is closed by the OCSP check.\n\n### Details\nIn `io.netty.handler.ssl.ocsp.OcspServerCertificateValidator#userEventTriggered`, when an `SslHandshakeCompletionEvent` is received, the validator immediately calls `ctx.fireUserEventTriggered(evt)`. It then initiates an asynchronous OCSP query using `OcspClient.query`.\n\nBecause the handshake completion event is forwarded immediately, downstream handlers in the client's pipeline are notified that the TLS handshake is successful. They may then begin reading and processing incoming application data or sending outgoing data. If the OCSP response later indicates the server's certificate is REVOKED, the validator closes the channel, but by this time, the client may have already leaked sensitive data to a revoked server or processed malicious responses from it.\n\n### PoC\n\n```java\n @Test\n public void test() throws Exception {\n EventLoopGroup group = new MultiThreadIoEventLoopGroup(NioIoHandler.newFactory());\n try {\n OCSPRespBuilder respBuilder = new OCSPRespBuilder();\n OCSPResp response = respBuilder.build(OCSPRespBuilder.INTERNAL_ERROR, null);\n byte[] responseEncoded = response.getEncoded();\n\n IoTransport mockTransport = IoTransport.create(group.next(), () -> {\n NioSocketChannel channel = new NioSocketChannel();\n channel.pipeline().addFirst(new ChannelOutboundHandlerAdapter() {\n @Override\n public void connect(ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise) {\n promise.setSuccess();\n\n ctx.executor().schedule(() -> {\n ctx.pipeline().fireChannelActive();\n\n DefaultFullHttpResponse httpResponse = new DefaultFullHttpResponse(\n HttpVersion.HTTP_1_1, HttpResponseStatus.OK, Unpooled.wrappedBuffer(responseEncoded));\n httpResponse.headers().set(HttpHeaderNames.CONTENT_TYPE, \"application/ocsp-response\");\n httpResponse.headers().set(HttpHeaderNames.CONTENT_LENGTH, httpResponse.content().readableBytes());\n\n ctx.pipeline().fireChannelRead(httpResponse);\n }, 500, TimeUnit.MILLISECONDS);\n }\n });\n return channel;\n }, NioDatagramChannel::new);\n\n X509Bundle caRoot = new CertificateBuilder()\n .algorithm(CertificateBuilder.Algorithm.rsa2048)\n .subject(\"CN=TrustedRootCA\")\n .setIsCertificateAuthority(true)\n .buildSelfSigned();\n\n GeneralName ocspName = new GeneralName(GeneralName.uniformResourceIdentifier, \"http://localhost/\");\n AuthorityInformationAccess aia = new AuthorityInformationAccess(new AccessDescription(AccessDescription.id_ad_ocsp, ocspName));\n X509Bundle targetCert = new CertificateBuilder()\n .algorithm(CertificateBuilder.Algorithm.rsa2048)\n .subject(\"CN=TargetServer\")\n .addExtensionOctetString(\"1.3.6.1.5.5.7.1.1\", false, aia.getEncoded())\n .buildIssuedBy(caRoot);\n\n SslContext serverSslCtx = SslContextBuilder.forServer(targetCert.getKeyPair().getPrivate(), targetCert.getCertificate()).build();\n\n CopyOnWriteArrayList<String> receivedData = new CopyOnWriteArrayList<>();\n CountDownLatch dataReceivedLatch = new CountDownLatch(1);\n\n new ServerBootstrap()\n .group(group)\n .channel(NioServerSocketChannel.class)\n .childHandler(new ChannelInitializer<SocketChannel>() {\n @Override\n protected void initChannel(SocketChannel ch) {\n ch.pipeline().addLast(serverSslCtx.newHandler(ch.alloc()));\n ch.pipeline().addLast(new SimpleChannelInboundHandler<ByteBuf>() {\n @Override\n protected void channelRead0(ChannelHandlerContext ctx, ByteBuf msg) {\n receivedData.add(msg.toString(CharsetUtil.UTF_8));\n dataReceivedLatch.countDown();\n }\n });\n }\n })\n .bind(8080)\n .sync()\n .channel();\n\n SslContext clientSslCtx = SslContextBuilder.forClient()\n .trustManager(InsecureTrustManagerFactory.INSTANCE)\n .build();\n\n DnsNameResolver resolver = OcspServerCertificateValidator.createDefaultResolver(mockTransport);\n Channel clientChannel = new Bootstrap()\n .group(group)\n .channel(NioSocketChannel.class)\n .handler(new ChannelInitializer<SocketChannel>() {\n @Override\n protected void initChannel(SocketChannel ch) {\n ch.pipeline().addLast(clientSslCtx.newHandler(ch.alloc(), \"127.0.0.1\", 8080));\n ch.pipeline().addLast(new OcspServerCertificateValidator(true, false, mockTransport, resolver));\n ch.pipeline().addLast(new ChannelInboundHandlerAdapter() {\n @Override\n public void userEventTriggered(ChannelHandlerContext ctx, Object evt) {\n if (evt instanceof SslHandshakeCompletionEvent) {\n SslHandshakeCompletionEvent sslEvent = (SslHandshakeCompletionEvent) evt;\n if (sslEvent.isSuccess()) {\n ctx.writeAndFlush(Unpooled.copiedBuffer(\"SECRET_DATA\", CharsetUtil.UTF_8));\n }\n }\n ctx.fireUserEventTriggered(evt);\n }\n });\n }\n })\n .connect(\"127.0.0.1\", 8080)\n .sync()\n .channel();\n\n assertTrue(clientChannel.closeFuture().await(5, TimeUnit.SECONDS));\n\n Thread.sleep(200);\n\n assertFalse(receivedData.contains(\"SECRET_DATA\"), \"Server should not receive the data.\");\n } finally {\n group.shutdownGracefully();\n }\n }\n```\n\n### Impact\nTOCTOU. Client applications relying on OcspServerCertificateValidator to enforce server certificate revocation are impacted. A malicious server with a revoked certificate can successfully establish a TLS connection and receive sensitive application data from the client (or send malicious data to it) during the window between the TLS handshake completing and the asynchronous OCSP check failing.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "io.netty:netty-handler-ssl-ocsp"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.2.0.Final"
}, {
"fixed" : "4.2.16.Final"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "io.netty:netty-handler-ssl-ocsp"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.1.136.Final"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/netty/netty/security/advisories/GHSA-wc96-39fc-566f"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/netty/netty"
}, {
"type" : "WEB",
"url" : "https://github.com/netty/netty/releases/tag/netty-4.1.136.Final"
}, {
"type" : "WEB",
"url" : "https://github.com/netty/netty/releases/tag/netty-4.2.16.Final"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-367" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-07-22T21:47:41Z",
"nvd_published_at" : null
}
}