CVE-2026-59426
Patch Available.
This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.
Overview
Spring Cloud Gateway is a library for building an API gateway on top of Spring. It aims to provide a simple, yet effective way to route to APIs and to apply cross-cutting concerns to them, such as security, monitoring/metrics, and resiliency.
An information exposure vulnerability (CVE-2026-59426) has been identified in the global LocalResponseCache filter of Spring Cloud Gateway, which allows attackers to receive cached responses that were stored for a different route. An unauthenticated caller who matches only a public route can be served a response cached for a restricted route that matches the same request URI, without the request reaching either upstream.
Per OWASP: Access control enforces policy such that users cannot act outside of their intended permissions. Failures typically lead to unauthorized information disclosure, modification, or destruction of all data or performing a business function outside the user's limits.
This issue affects multiple versions of Spring Cloud Gateway.
Details
Module Info
- Product: Spring Cloud Gateway
- Affected packages:
org.springframework.cloud:spring-cloud-gateway-server,org.springframework.cloud:spring-cloud-gateway-server-webflux - Affected versions:
org.springframework.cloud:spring-cloud-gateway-server: >=4.0.0 <=4.2.10, >=4.3.0 <=4.3.6org.springframework.cloud:spring-cloud-gateway-server-webflux: >=5.0.0 <=5.0.4- GitHub repository: https://github.com/spring-cloud/spring-cloud-gateway
- Published packages: https://central.sonatype.com/artifact/org.springframework.cloud/spring-cloud-gateway-server, https://central.sonatype.com/artifact/org.springframework.cloud/spring-cloud-gateway-server-webflux
- Package manager: Maven
- Fixed in:
- OSS Spring Cloud Gateway 5.0.5
- NES for Spring Cloud Gateway
Vulnerability Info
This High-severity vulnerability is found in the org.springframework.cloud:spring-cloud-gateway-server and org.springframework.cloud:spring-cloud-gateway-server-webflux packages in multiple versions of Spring Cloud Gateway. It carries a CVSS 3.1 base score of 7.5 (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N) and is classified as CWE-524, Use of Cache Containing Sensitive Information.
When the global LocalResponseCache is enabled, every route that does not configure the route-level LocalResponseCache filter stores its responses in one shared cache. Entries in that cache are looked up by a key that CacheKeyGenerator builds only from values taken from the incoming ServerHttpRequest:
static final List<KeyValueGenerator> DEFAULT_KEY_VALUE_GENERATORS = List.of(
new UriKeyValueGenerator(), new HeaderKeyValueGenerator(HttpHeaders.AUTHORIZATION, KEY_SEPARATOR),
new CookiesKeyValueGenerator(KEY_SEPARATOR));The request URI, the Authorization header and the request cookies are combined with any request headers named in the cached response's Vary header, and the result is hashed into the cache key. ResponseCacheManager passes only the request to the key generator, so the route that the gateway matched for the exchange never reaches the key:
public String resolveKey(ServerWebExchange exchange, List<String> varyOnHeaders) {
return cacheKeyGenerator.generateKey(exchange.getRequest(), varyOnHeaders);
}Spring Cloud Gateway routes are commonly told apart by predicates that do not feed this key, such as RemoteAddr, Host, Header, Cookie, Query or custom predicates, while still matching the same request URI and forwarding to different upstreams. When a response from one such route is cached, a later request that matches only another route but produces the same key is answered from the cache with the first route's response. For example, a response cached for a route restricted to an internal address range can be returned to an external caller that only matches a public route for the same path. The cached response is served without the request reaching either upstream, so no upstream authorization check runs.
Applications are affected only when the global LocalResponseCache is enabled and at least two routes that use it match the same request URI but are separated by predicates that do not influence the cache key. Routes that configure the route-level LocalResponseCache filter use their own per-route cache and are not affected.
Mitigation
Only recent versions of Spring Cloud Gateway receive community support. Older lines are End-of-Life and will not receive public updates to address this issue.
Until an upgrade is possible, the global LocalResponseCache can be disabled and the route-level LocalResponseCache filter configured on the routes that need caching, since each route-level filter uses its own cache. On 4.3.x and 5.0.x the global cache is disabled with:
spring.cloud.gateway.server.webflux.global-filter.local-response-cache.enabled=falseOn 4.2.x and earlier the property is spring.cloud.gateway.global-filter.local-response-cache.enabled=false.
Users of the affected components should apply one of the following mitigations:
- Upgrade to a currently supported version of Spring Cloud Gateway.
- Leverage a commercial support partner like HeroDevs for post-EOL security support.
Credits
- husss (finder)