MODERATE

CVE-2026-59428

Spring Cloud Gateway WebSocket Routing Filter Does Not Enforce Same-Origin by Default

Description

Spring Cloud Gateway's WebsocketRoutingFilter accepts WebSocket handshakes without checking the Origin header. Browsers do not apply the same-origin policy or CORS to WebSocket handshakes. They only send the Origin header and rely on the server to accept or reject the request. Because the gateway does not reject cross-origin handshakes by default, a malicious web page can cause a victim's browser to open a WebSocket connection through the gateway to a backend service, using any credentials the browser attaches automatically, such as cookies.

Applications are affected only if they expose a route with a ws or wss URI through the gateway. Spring Cloud Gateway now rejects cross-origin WebSocket handshakes by default with a 403 Forbidden response, and provides the spring.cloud.gateway.server.webflux.websocket.allowed-origins and spring.cloud.gateway.server.webflux.websocket.allowed-origin-patterns properties (spring.cloud.gateway.websocket.* for the 4.x and 3.1.x lines) to allow specific origins.

Affected Maven artifacts (1)

ArtifactAffected versionsFixed in
org.springframework.cloud » spring-cloud-gateway-server
>= 3.1.0, <= 3.1.14>= 4.2.0, <= 4.2.10>= 4.3.0, <= 4.3.6>= 5.0.0, < 5.0.5
5.0.5

Blast radius

1affected artifacts
25affected versions
44dependent artifacts (est.)
422dependent versions

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

DepthDependent versions
Direct
142
2 hops
185
3 hops
39
4 hops
56

Most used dependents

Computed from the dependency graph of build 20261127.1117 (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.