CVE-2026-56821: Netty: Out-of-date OCSP Responses Accepted by OcspServerCertificateValidator

Published Jul 22, 2026
·
Updated

Summary OcspServerCertificateValidator flags an out-of-date OCSP response but does not stop processing it, so an expired GOOD response is still reported as VALID, letting an on-path attacker replay a stale GOOD response to bypass revocation of a since-revoked certificate.

Details In io.netty.handler.ssl.ocsp.OcspServerCertificateValidator#userEventTriggered the freshness check has no return, so execution falls through and a VALID OcspValidationEvent is still fired:

java if (!(current.after(response.getThisUpdate()) && current.before(response.getNextUpdate()))) { ctx.fireExceptionCaught(new IllegalStateException("OCSP Response is out-of-date")); }

Nonce validation is optional and off by default, so freshness is the only replay defense — and it is not enforced. Additionally getNextUpdate() may be null, making current.before(null) throw NullPointerException.

https://datatracker.ietf.org/doc/html/rfc6960#section-3.2

5. The time at which the status being indicated is known to be correct (thisUpdate) is sufficiently recent;

6. When available, the time at or before which newer information will be available about the status of the certificate (nextUpdate) is greater than the current time.

PoC

Add the test below to io.netty.handler.ssl.ocsp.OcspServerCertificateValidatorTest

java @Test void staleOcspResponseIsRejected() throws Exception { X509Bundle caRoot = new CertificateBuilder() .algorithm(CertificateBuilder.Algorithm.rsa2048) .subject("CN=TrustedRootCA") .setIsCertificateAuthority(true) .buildSelfSigned();

GeneralName ocspName = new GeneralName(GeneralName.uniformResourceIdentifier, "http://localhost/"); AuthorityInformationAccess aia = new AuthorityInformationAccess( new AccessDescription(AccessDescription.idadocsp, ocspName)); X509Bundle targetCert = new CertificateBuilder() .algorithm(CertificateBuilder.Algorithm.rsa2048) .subject("CN=TargetServer") .addExtensionOctetString("1.3.6.1.5.5.7.1.1", false, aia.getEncoded()) .buildIssuedBy(caRoot);

Date past = new Date(System.currentTimeMillis() - TimeUnit.DAYS.toMillis(7)); CertificateID certId = new CertificateID( new JcaDigestCalculatorProviderBuilder().build().get(CertificateID.HASHSHA1), new JcaX509CertificateHolder(caRoot.getCertificate()), targetCert.getCertificate().getSerialNumber()); BasicOCSPRespBuilder respBuilder = new BasicOCSPRespBuilder( new RespID(new JcaX509CertificateHolder(caRoot.getCertificate()).getSubject())); respBuilder.addResponse(certId, CertificateStatus.GOOD, past, past); BasicOCSPResp expiredBasicResp = respBuilder.build( new JcaContentSignerBuilder("SHA256withRSA").build(caRoot.getKeyPair().getPrivate()), new X509CertificateHolder[0], past); final byte[] responseEncoded = new OCSPRespBuilder() .build(OCSPRespBuilder.SUCCESSFUL, expiredBasicResp).getEncoded();

IoTransport defaultTransport = createDefaultTransport(); IoTransport mockTransport = IoTransport.create(defaultTransport.eventLoop(), () -> { NioSocketChannel channel = new NioSocketChannel(); channel.pipeline().addFirst(new ChannelOutboundHandlerAdapter() { @Override public void connect(ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise) { promise.setSuccess(); ctx.executor().execute(() -> { ctx.pipeline().fireChannelActive(); DefaultFullHttpResponse httpResponse = new DefaultFullHttpResponse( HttpVersion.HTTP11, HttpResponseStatus.OK, Unpooled.wrappedBuffer(responseEncoded)); httpResponse.headers().set(HttpHeaderNames.CONTENTTYPE, "application/ocsp-response"); httpResponse.headers().set(HttpHeaderNames.CONTENTLENGTH, httpResponse.content().readableBytes()); ctx.pipeline().fireChannelRead(httpResponse); }); } }); return channel; }, defaultTransport.datagramChannel());

SslContext serverSslCtx = SslContextBuilder .forServer(targetCert.getKeyPair().getPrivate(), targetCert.getCertificate(), caRoot.getCertificate()) .build(); Channel serverChannel = new ServerBootstrap() .group(defaultTransport.eventLoop()) .channel(NioServerSocketChannel.class) .childHandler(new ChannelInitializer<SocketChannel>() { @Override protected void initChannel(SocketChannel ch) { ch.pipeline().addLast(serverSslCtx.newHandler(ch.alloc())); } }) .bind(0).sync().channel();

int serverPort = ((InetSocketAddress) serverChannel.localAddress()).getPort();

AtomicBoolean validEventFired = new AtomicBoolean(); AtomicReference<Throwable> caughtException = new AtomicReference<>(); CountDownLatch latch = new CountDownLatch(1);

DnsNameResolver resolver = OcspServerCertificateValidator.createDefaultResolver(mockTransport); SslContext clientSslCtx = SslContextBuilder.forClient() .trustManager(InsecureTrustManagerFactory.INSTANCE) .build(); new Bootstrap() .group(defaultTransport.eventLoop()) .channel(NioSocketChannel.class) .handler(new ChannelInitializer<SocketChannel>() { @Override protected void initChannel(SocketChannel ch) { ch.pipeline().addLast(clientSslCtx.newHandler(ch.alloc(), "127.0.0.1", serverPort)); ch.pipeline().addLast( new OcspServerCertificateValidator(true, false, mockTransport, resolver)); ch.pipeline().addLast(new ChannelInboundHandlerAdapter() { @Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) { if (evt instanceof OcspValidationEvent && ((OcspValidationEvent) evt).response().status() == OcspResponse.Status.VALID) { validEventFired.set(true); } ctx.fireUserEventTriggered(evt); }

@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { caughtException.compareAndSet(null, cause); ctx.channel().close(); latch.countDown(); } }); } }) .connect("127.0.0.1", serverPort).sync();

assertTrue(latch.await(5, TimeUnit.SECONDS)); assertFalse(validEventFired.get(), "OcspValidationEvent(VALID) must not be emitted for a stale OCSP response"); assertNotNull(caughtException.get()); assertInstanceOf(IllegalStateException.class, caughtException.get());

serverChannel.close().sync(); resolver.close(); } Impact Certificate revocation bypass via replay of an expired OCSP response. Any application using OcspServerCertificateValidator is affected; a revoked certificate can be accepted.

Other sources

Netty is an asynchronous, event-driven network application framework. Prior to versions 4.1.136.Final and 4.2.16.Final, the OcspServerCertificateValidator flags an out-of-date OCSP response but does not stop processing it, so an expired GOOD response is still reported as VALID, letting an on-path attacker replay a stale GOOD response to bypass revocation of a since-revoked certificate. Exploitation can lead to certificate revocation bypass via replay of an expired OCSP response. Any application using OcspServerCertificateValidator is affected; a revoked certificate can be accepted. This issue has been fixed in versions 4.1.136.Final and 4.2.16.Final.

MITRE

Affected Software

4 affected componentsFixes available
maven/io.netty:netty-handler-ssl-ocsp<4.1.136.Final
4.1.136.Final
maven/io.netty:netty-handler-ssl-ocsp>=4.2.0.Final<4.2.16.Final
4.2.16.Final
Netty Netty<4.1.136
Netty Netty>=4.2.0<4.2.16

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade maven/io.netty:netty-handler-ssl-ocsp to a version that resolves this vulnerability.

    Fixed in 4.1.136.Final
  2. Upgrade

    Upgrade maven/io.netty:netty-handler-ssl-ocsp to a version that resolves this vulnerability.

    Fixed in 4.2.16.Final
  3. Upgrade

    Upgrade io.netty:netty-handler (OcspServerCertificateValidator) to a version that resolves this vulnerability.

    Fixed in 4.1.136.Final
  4. Upgrade

    Upgrade io.netty:netty-handler (OcspServerCertificateValidator) to a version that resolves this vulnerability.

    Fixed in 4.2.16.Final
  5. Configuration

    In OcspServerCertificateValidator#userEventTriggered, ensure the freshness check has a return so execution does not fall through and still fires a VALID OcspValidationEvent for an out-of-date OCSP response.

    io.netty.handler.ssl.ocsp.OcspServerCertificateValidator#userEventTriggered freshness check return behavior = return after firing exception (do not fall through)

Event History

Jul 22, 2026
Advisory Published
via GitHub·09:46 PM
Data Sourced
via GitHub·09:46 PM
DescriptionSeverityWeaknessAffected Software
Jul 28, 2026
CVE Published
via MITRE·11:07 PM
Data Sourced
via MITRE·11:07 PM
DescriptionSeverityWeakness
Jul 29, 2026
Data Sourced
via NVD·12:16 AM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-56821?

The severity of CVE-2026-56821 is high, with a score of 7.4.

2

How do I fix CVE-2026-56821?

To fix CVE-2026-56821, upgrade to the latest version of the Netty library that includes the security patch.

3

What are the risks associated with CVE-2026-56821?

CVE-2026-56821 allows an attacker to bypass certificate revocation checks by replaying a stale OCSP response.

4

Which software is affected by CVE-2026-56821?

CVE-2026-56821 affects the Maven library io.netty:netty-handler-ssl-ocsp.

5

When was CVE-2026-56821 published?

CVE-2026-56821 was published on July 22, 2026.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203