MODERATE 6.5

CVE-2026-56746

Netty: Security Control Bypass via CORS Short-Circuit Failure

Description

Summary

Netty's CorsHandler provides a shortCircuit() configuration designed to reject unauthorized cross-origin requests immediately, acting as a security control before requests reach the application. However, due to a logical operator error in the origin evaluation process, this protection can be entirely bypassed. An attacker can bypass the short-circuit mechanism by sending a request with an Origin: null header. This failure forwards unauthorized requests to the backend application, bypassing intended access controls.

Details

In io.netty.handler.codec.http.cors.CorsHandler#channelRead, the short-circuit logic relies on the configuration returned by getForOrigin(origin) to determine if an origin is authorized. If getForOrigin returns a configuration object, the short-circuit check (!(origin == null || config != null)) is bypassed, and the request proceeds to the backend.

The vulnerability is located in the getForOrigin method:

 if (corsConfig.isNullOriginAllowed() || NULL_ORIGIN.equals(requestOrigin)) {
return corsConfig;
}

If an attacker sends Origin: null, NULL_ORIGIN.equals(requestOrigin) evaluates to true. The method returns the configuration object regardless of whether isNullOriginAllowed() was configured by the developer. The short-circuit is bypassed.

Impact

Applications relying on CorsHandler's short-circuit feature to prevent unauthorized cross-origin requests from reaching their backend logic are completely exposed. The framework fails to enforce the developer's intended access controls, allowing unauthorized requests to be processed.

Affected Maven artifacts (1)

ArtifactAffected versionsFixed in
io.netty » netty-codec-http
< 4.1.136.Final>= 4.2.0.Final, < 4.2.16.Final
4.1.136.Final, 4.2.16.Final

Blast radius

1affected artifacts
345affected versions
40,216dependent artifacts (est.)
1,840,154dependent versions

69% of the dependent artifacts (28,006) still pull an affected version in their latest release.

DepthDependent versions
Direct
49,955
2 hops
285,691
3 hops
569,332
4 hops
449,977
5 hops
306,582
6 hops
178,617

Most used dependents

Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.