Netty 4.2 turned hostname verification on by default for client TLS. The default lives in SslContext.defaultEndpointVerificationAlgorithm, which resolves to "HTTPS" unless the operator explicitly sets the JVM property io.netty.handler.ssl.defaultEndpointVerificationAlgorithm to "NONE". CVE-2026-50010, published June 5, 2026 and reported by Netty maintainer Chris Vest, is the disclosure that the default never reached the wire for any application using a custom TrustManagerFactory. A wrapper class committed by Trustin Lee on October 12, 2016 had been stripping hostname verification out of every trust manager the framework saw, for nine years and seven months, by extending X509ExtendedTrustManager and implementing every method by discarding the SSLEngine argument that carries the hostname.
InsecureTrustManagerFactory. The wrapper was running in reverse.
CVE-2026-50010: Netty 4.2 Turned Hostname Verification On By Default. A 2016 Wrapper Had Already Turned It Off.
vendor
pattern
cve
proof of concept
The wrapper extends the type that promises hostname verification, and discards the parameter that carries the hostname
The 2016 wrapper file is 73 lines of Java in handler/src/main/java/io/netty/handler/ssl/util/X509TrustManagerWrapper.java. The patch for CVE-2026-50010 deletes it. Reproduced verbatim from the pre-patch source at tag netty-4.2.14.Final:
final class X509TrustManagerWrapper extends X509ExtendedTrustManager {
private final X509TrustManager delegate;
X509TrustManagerWrapper(X509TrustManager delegate) {
this.delegate = checkNotNull(delegate, "delegate");
}
@Override
public void checkServerTrusted(X509Certificate[] chain, String s) throws CertificateException {
delegate.checkServerTrusted(chain, s);
}
@Override
public void checkServerTrusted(X509Certificate[] chain, String s, Socket socket)
throws CertificateException {
delegate.checkServerTrusted(chain, s);
}
@Override
public void checkServerTrusted(X509Certificate[] chain, String s, SSLEngine sslEngine)
throws CertificateException {
delegate.checkServerTrusted(chain, s);
}
// checkClientTrusted overloads identical in shape
}X509ExtendedTrustManager is the abstract class the JDK added in Java 7 to carry hostname-verification context into the trust manager's check methods. The 3-argument overloads receive a Socket or an SSLEngine, and the implementation is supposed to read the SSLSession's peer host off that argument and run the endpoint identification check. X509TrustManager is the Java 1.4 interface that predates hostname verification entirely: 2-argument methods, no transport context, no opinion about hostnames.
The wrapper extends the new class and implements every 3-argument method by calling the 2-argument variant on the wrapped delegate. The SSLEngine parameter is read once, to be discarded.
The factory that installed it lived one file over, in SimpleTrustManagerFactory:
@Override
protected TrustManager[] engineGetTrustManagers() {
TrustManager[] trustManagers = this.trustManagers;
if (trustManagers == null) {
trustManagers = parent.engineGetTrustManagers();
wrapIfNeeded(trustManagers);
this.trustManagers = trustManagers;
}
return trustManagers.clone();
}
private static void wrapIfNeeded(TrustManager[] trustManagers) {
for (int i = 0; i < trustManagers.length; i++) {
final TrustManager tm = trustManagers[i];
if (tm instanceof X509TrustManager && !(tm instanceof X509ExtendedTrustManager)) {
trustManagers[i] = new X509TrustManagerWrapper((X509TrustManager) tm);
}
}
}SimpleTrustManagerFactory is the framework base class for every custom trust manager factory in the Netty ecosystem. It is what an application supplies when it loads certs from a non-default location, uses a system trust store with a constraint, composes a verification policy on top of the system roots, or wires any non-default trust to the SSL context. The factory walks the trust managers the application returned from its engineGetTrustManagers and wraps every plain X509TrustManager into one that already looks like an X509ExtendedTrustManager to the JDK.
The JDK's reason for caring about that distinction is in sun.security.ssl.SSLContextImpl.init. The JDK calls instanceof X509ExtendedTrustManager on each trust manager it receives. If the answer is no, the JDK wraps the plain trust manager in its own internal AbstractTrustManagerWrapper, which delegates the certificate chain validation to the wrapped manager and adds the endpoint identification check on top, reading the hostname from the SSLEngine the runtime passes. The wrap is silent: no log, no warning, no exception. The application gets hostname verification for free.
Netty's wrapper passes the JDK's instanceof check. The JDK skips its own wrapping. Hostname verification is gone.
The wrap defeated the JDK's silent adapter on purpose, for the wrong population
Trustin Lee committed the wrapper at bcea25cc on October 12, 2016. The commit message names exactly what it does:
Motivation:
Since Java 7, X509TrustManager implementation is wrapped by a JDK class called AbstractTrustManagerWrapper, which performs an additional certificate validation for Socket or SSLEngine-backed connections.
This makes the TrustManager implementations provided by InsecureTrustManagerFactory and FingerprintTrustManagerFactory not insecure enough, where their certificate validation fails even when it should pass.
Modifications:
- Add X509TrustManagerWrapper which adapts an X509TrustManager into an X509ExtendedTrustManager
- Make SimpleTrustManagerFactory wrap an X509TrustManager with X509TrustManagerWrapper is the provided TrustManager does not extend X509ExtendedTrustManager
Result:
- InsecureTrustManagerFactory and FingerprintTrustManagerFactory are now insecure as expected.
- Fixes #5910
Two trust managers Netty shipped had a problem with the JDK's silent hostname check:
InsecureTrustManagerFactoryaccepts every certificate by design. It exists for development, testing, and the operator who knows they are talking to a peer with a self-signed cert whose name does not match the connect target. With the JDK silently adding hostname verification, the factory enforced the hostname even when the operator had asked for nothing to be enforced. The factory was namedInsecureand behaved asinsecure plus hostname-strict.FingerprintTrustManagerFactoryaccepts every certificate whose fingerprint matches a pinned value. The pinning is the trust decision: if the leaf's SHA matches what was pinned, the cert is trusted regardless of CA chain or hostname. With the JDK silently adding hostname verification, the fingerprint match was followed by a hostname check that the pinned cert would often fail.
The two factories share a parent: SimpleTrustManagerFactory. The fix Trustin Lee chose was to wrap at the parent. Every plain X509TrustManager returned by any subclass would be converted into an X509ExtendedTrustManager the JDK trusted to handle hostname verification itself. The wrapper handled hostname verification by skipping it.
The two factories that needed the JDK's silent wrap defeated were the two named in the commit message. The factory base class through which the defeat was applied is the parent of:
InsecureTrustManagerFactory(target of the fix)FingerprintTrustManagerFactory(target of the fix)- Every other custom trust manager factory anyone has ever written on top of Netty, including the ones that load CA bundles from operator-supplied paths, the ones that wrap the system trust store with certificate-transparency constraints, the ones that implement custom revocation logic
For nine years and seven months, every customer of SimpleTrustManagerFactory got the InsecureTrustManagerFactory treatment.
Netty 4.2 made the bug discoverable
The 4.2 client default for endpointIdentificationAlgorithm lives in SslContext.java:
private static final String DEFAULT_ENDPOINT_VERIFICATION_ALGORITHM_PROPERTY =
"io.netty.handler.ssl.defaultEndpointVerificationAlgorithm";
/**
* Endpoint verification is enabled by default from Netty 4.2 onward, but it wasn't in Netty 4.1 and earlier.
* ...
*/
protected static final String defaultEndpointVerificationAlgorithm;
static {
String defaultEndpointVerification = SystemPropertyUtil.get(DEFAULT_ENDPOINT_VERIFICATION_ALGORITHM_PROPERTY);
if ("LDAP".equalsIgnoreCase(defaultEndpointVerification)) {
defaultEndpointVerificationAlgorithm = "LDAP";
} else if ("NONE".equalsIgnoreCase(defaultEndpointVerification)) {
logger.info("Default SSL endpoint verification has been disabled: -D{}=\"{}\"",
DEFAULT_ENDPOINT_VERIFICATION_ALGORITHM_PROPERTY, defaultEndpointVerification);
defaultEndpointVerificationAlgorithm = null;
} else {
if (defaultEndpointVerification != null && !"HTTPS".equalsIgnoreCase(defaultEndpointVerification)) {
logger.warn("Unknown default SSL endpoint verification algorithm: -D{}=\"{}\", " +
"will use \"HTTPS\" instead.",
DEFAULT_ENDPOINT_VERIFICATION_ALGORITHM_PROPERTY, defaultEndpointVerification);
}
defaultEndpointVerificationAlgorithm = "HTTPS";
}
}Two lines below, SslContextBuilder's client constructor copies the resolved default onto the builder's instance field:
private SslContextBuilder(boolean forServer) {
this.forServer = forServer;
if (!forServer) {
endpointIdentificationAlgorithm = SslContext.defaultEndpointVerificationAlgorithm;
}
serverNames = forServer ? null : new ArrayList<>(2);
}The Netty 4.2 release was the security upgrade most consumers were waiting for. The 4.1 default of null meant client connections accepted any valid cert chain from any server until the application remembered to call endpointIdentificationAlgorithm("HTTPS") on the builder. The 4.2 default of "HTTPS" flipped it: clients verify hostnames by default, and the operator who wants the 4.1 behavior has to set a JVM property whose name contains the word Default and pass it the string "NONE". Operators upgrading from 4.1 to 4.2 read the change in the release notes and got the upgrade they had been promised, except not for any application that had ever extended SimpleTrustManagerFactory.
The CVE-2026-50010 record's affected range names both branches: >= 4.2.0.Final < 4.2.15.Final and <= 4.1.134.Final. The 4.1 row affects the operator who explicitly opted into hostname verification on the builder. The 4.2 row affects the operator who did nothing.
The fix is two parts in one commit, both load-bearing
The June 1, 2026 patch (commit 3a023c0) deletes the wrapper class and removes the wrapIfNeeded loop. It also adds a 25-line block inside InsecureTrustManagerFactory that makes that factory's own trust manager extend X509ExtendedTrustManager directly:
// This needs to be X509ExtendedTrustManager so hostname verification is skipped as well.
// Otherwise the JDK will internally wrap it with AbstractTrustManagerWrapper and add hostname verification
// by itself.
private static final TrustManager tm = new X509ExtendedTrustManager() {
@Override
public void checkServerTrusted(X509Certificate[] chain, String authType, SSLEngine engine) {
checkServerTrusted(chain, authType);
}
// ... five other methods, same shapeThe comment above the block is the 2016 motivation, restated nine years later. The maintainers always knew what the JDK does. The fix moves the JDK-bypass behavior to the place that needs it (the insecure factory's own trust manager, scoped to that one trust manager) and removes it from the place where it never should have lived (the shared base class for every custom factory).
The new SimpleTrustManagerFactoryTest declares the new contract by assertion:
TrustManager[] tms = factory.getTrustManagers();
assertEquals(1, tms.length);
assertSame(tm, tms[0]);A trust manager passed in is returned unchanged. The factory no longer transforms its callers' trust managers. Whatever the application supplied, the JDK sees, and the JDK adds the silent hostname-verification wrapper to plain X509TrustManager instances as it has done since Java 7.
The fix's first half restores the security property the framework's hero documentation had been advertising. The fix's second half preserves the insecurity that one named factory always meant to provide. Both are necessary because the original 2016 fix had scoped its workaround to the wrong layer.
The setting was advisory at the layer below the operator
This is setting-was-advisory expressed at the trust-manager layer rather than the configuration-flag layer. Netty's endpointIdentificationAlgorithm("HTTPS") is the SSLParameters knob the JDK reads to decide whether to invoke the 3-argument checkServerTrusted and pass an SSLEngine carrying the peer hostname. The flag reached the SSLEngine correctly. The SSLEngine invoked checkServerTrusted(chain, authType, sslEngine) on the trust manager correctly. The trust manager was Netty's wrapper. The wrapper called delegate.checkServerTrusted(chain, authType), the 2-argument variant on the user's plain X509TrustManager, which by interface contract does not check hostnames. The SSLEngine was discarded one method call before its argument would have mattered.
The catalog has named this shape via SGLang's trust_remote_code=False (SGLang Treated trust_remote_code=False As a Suggestion) and vm2's require: false (vm2 3.11.1 Rejects One Configuration. The README Is the Patch for the Rest.). In those exhibits a wrapper layer flipped the caller's flag inside itself, because the underlying framework returned a generic fallback type for the flag's documented setting. Netty's variant is the same shape from a different direction: the wrapper does not flip the flag, it discards the parameter that the flag's enforcement reads. The flag has the API surface of an enforced control. The runtime behavior is whatever the trust manager does with the SSLEngine argument. Netty's wrapper did nothing with it.
The bypass had been in the source since October 2016 and existed by design. The design was correct for one population (InsecureTrustManagerFactory, FingerprintTrustManagerFactory) whose trust managers were supposed to be insecure. The placement of the design at SimpleTrustManagerFactory applied it to a population that included every other trust manager factory in the ecosystem. The maintainers reading the 2016 motivation in the commit message had named both populations explicitly, in the same paragraph, without noticing they were applying a fix for the first to the second as well.
PoC: GHSA-c653-97m9-rcg9
The patch removes the wrapper from every other trust manager and adds it back inside InsecureTrustManagerFactory. The wrapper was running in reverse.