[fix][sec][branch-4.2] Upgrade Netty to 4.1.137 to address several CVEs and bugs - #26301
Merged
Merged
Conversation
dao-jun
approved these changes
Aug 10, 2026
nodece
pushed a commit
to ascentstream/pulsar
that referenced
this pull request
Aug 28, 2026
…Es and bugs (apache#26301) (cherry picked from commit fede2cc)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Netty 4.1.137.Final is a bug-fix and security
release, and upstream "strongly recommends" upgrading. It is the 4.1 counterpart of 4.2.17.Final,
which is being upgraded on master in #26300.
Security fixes. It resolves the same seven advisories as 4.2.17.Final — every one of them lists
<= 4.1.136.Finalas a vulnerable range, so branch-4.2 is affected by all of them. Five still havetheir CVE id pending assignment upstream, so the release notes show
CVE-2026-XXXXX:netty-handlernetty-handlerSslContextnetty-handlernetty-codec-socksnetty-codec-httpVaryheader overwritenetty-transport-sctpSctpMessageCompletionHandlernetty-codec-mqttnetty-transport-sctpandnetty-codec-mqttare not bundled in Pulsar's distributions (they don'tappear in either
LICENSE.bin.txt), so the last two are listed only for completeness.netty-handler,netty-codec-socksandnetty-codec-httpare all shipped.GHSA-p85m-gvr3-788c is the one worth calling out, with a branch-4.2 caveat. Netty's earlier
CVE-2026-50010 fix added hostname verification to a plain
X509TrustManagerby wrapping it, and onthe
SslProvider.OPENSSLpath that wrapping isUnsafe-based reflection.Unsafeis not availableby default on Java 25+, so the wrapper degrades to a no-op and an OpenSSL client configured with
a plain (non-extended)
X509TrustManagerends up doing no hostname verification.The OpenSSL half of that precondition is met by default on branch-4.2:
tlsProvideris unset inconf/broker.conf,DefaultPulsarSslFactorythen passesnulltoSslContextBuilder, and Nettyfalls back to
SslContext.defaultClientProvider(), which isOPENSSLwhenever the native engine isavailable — and it is, since Pulsar bundles
netty-tcnative-boringssl-static. The Java 25+ half isnot met by default here: branch-4.2 builds and ships on JDK 21 (
IMAGE_JDK_MAJOR_VERSION=21, andthe CI default is 21), unlike master which has moved to JDK 25 (#26070). So this only reaches
deployments that both run a 4.2 broker/client on a Java 25+ runtime and supply a plain rather than
extended trust manager via a custom
PulsarTlsFactory. Lower exposure than on master, but theupgrade removes the question either way.
Non-security fixes. 4.1.137.Final also carries several fixes in areas Pulsar leans on heavily:
maxOrderinPooledByteBufAllocator(#17095)AdaptiveByteBuf._setLongLEcalling checkedsetLongLE(#17102)SslHandler: fix possible buffer leak when an OOME is thrown during allocation (#17078)GlobalEventExecutorterminationFuture failure (#17189)HttpObjectEncoder/DefaultHttp2FrameWriter: fix buffer leak when aThrowableis thrown during header encoding (#17178)HttpServerCodec: do not consume the method queue for 1xx interim responses (#17203)AsciiString.cached(String)sanitization and the follow-up performance regression fix (#17075, #17080, #17083)Lz4FrameDecoder(#17121), fixmaxAllocationfor brotli-encoded content inHttpContentDecompressor(#17124) and prevent duplicateBrotliEncoderclose scheduling (#17193)netty-tcnative. Bumped 2.0.78.Final → 2.0.81.Final. Pulsar's
pom.xmldoes not pin tcnativeseparately — it is managed by the imported
netty-bom, which declares<tcnative.version>2.0.81.Final</tcnative.version>in 4.1.137.Final (it was 2.0.78.Final in4.1.136.Final), so the bump comes along with the
netty.versionchange.The changes across those three tcnative releases
are:
setKeyMaterial(netty-tcnative#987)SSL_CREDENTIALsupport for older BoringSSL (netty-tcnative#980)SSL.getGroupName(...), returning the named group used by the most recently completed handshake (netty-tcnative#991) — the Netty-sideOpenSslSessionaccessor built on it (netty#17058) landed on the 4.2 branch only, so on 4.1.137 this is just the tcnative bump (netty#17122)aarch_64andx86_64openssl-dynamicartifacts against OpenSSL 3.x (netty-tcnative#986, netty-tcnative#989) — not applicable to Pulsar, which bundlesnetty-tcnative-boringssl-staticModifications
pom.xml:netty.version4.1.136.Final → 4.1.137.Final. netty-tcnative moves 2.0.78.Final →2.0.81.Final transitively via the
netty-bomimport; there is no separate version property toupdate on this branch.
distribution/server/src/assemble/LICENSE.bin.txtanddistribution/shell/src/assemble/LICENSE.bin.txtto the new versionsVerifying this change
This change is already covered by existing tests. In addition to CI,
src/check-binary-license.shwas run locally against both
distribution/server/target/apache-pulsar-4.2.5-SNAPSHOT-bin.tar.gzand
distribution/shell/target/apache-pulsar-shell-4.2.5-SNAPSHOT-bin.tar.gz(both exit 0) toconfirm the
LICENSE.bin.txtentries match the jars that are actually bundled.Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Netty is upgraded from 4.1.136.Final to 4.1.137.Final and netty-tcnative from 2.0.78.Final to
2.0.81.Final.