Automated Threat Modeling

Brief Summary: Spring Cloud Gateway CVE-2026-59425, a JsonToGrpc gRPC Channel Leak Leading to Denial of Service (with Patch Review)

A brief summary of CVE-2026-59425, a High-severity denial-of-service flaw in which Spring Cloud Gateway's JsonToGrpc filter opened a new gRPC ManagedChannel per request and never shut it down. Includes affected versions and a short review of the fix shipped in 5.0.5.

CVE Analysis

10 min read

Gaurav Sarraf
Gaurav Sarraf

2026-12-02

Brief Summary: Spring Cloud Gateway CVE-2026-59425, a JsonToGrpc gRPC Channel Leak Leading to Denial of Service (with Patch Review)

Introduction

Every Spring Cloud Gateway route that translated JSON into gRPC through the JsonToGrpc filter opened a brand-new gRPC channel for each request it served and never closed it. Reaching such a route requires no credentials, so an unauthenticated client sending repeated requests can make the gateway accumulate open sockets and channel resources until availability suffers. That is why the issue carries a CVSS v3.1 score of 7.5 (High) despite having no confidentiality or integrity impact.

Spring Cloud Gateway is the Spring project's set of libraries for building an API gateway on Spring Framework. It provides routing to APIs along with security, monitoring, metrics, and resiliency capabilities. It sits within the broader Spring and Java ecosystem that Broadcom says is relied on by over half of Fortune 500 companies (a claim about the ecosystem, not Gateway install counts). Exposure is conditional. Only applications that expose a route configured with the JsonToGrpc filter are affected, so running Spring Cloud Gateway is not enough on its own.

Technical Information

What JsonToGrpc does

Spring documents JsonToGrpc as a filter that converts a JSON payload into a gRPC request. Its configuration names the target service, method, and protoDescriptor, the last of which supplies the protocol description used for conversion. Spring's reference documentation shows a route at /json/hello that transforms the request using hello.proto, sends it to HelloService/hello, and converts the response back into JSON. The exposure condition for this CVE is the use of this filter on a reachable route. The advisory does not describe other ways of talking to a gRPC backend, and an exposed Gateway Actuator endpoint is not required.

Root cause: a channel per exchange, never shut down

Before the fix, the gRPC channel was built inside GRPCResponseDecorator, an object created again for every exchange. The original author left a comment questioning exactly this design:

// We are creating this on every call, should optimize? private ManagedChannel createChannelChannel(String host, int port) { NettyChannelBuilder nettyChannelBuilder = NettyChannelBuilder.forAddress(host, port);

The per-request path resolved the route URI from the exchange and handed it to that builder:

Channel channel = createChannel(); ... private ManagedChannel createChannel() { Route route = (Route) exchange.getAttributes().get(ServerWebExchangeUtils.GATEWAY_ROUTE_ATTR); URI requestURI = Objects.requireNonNull(route, "Route not found in exchange attributes").getUri(); return createChannelChannel(requestURI.getHost(), requestURI.getPort()); }

A gRPC ManagedChannel is a heavyweight object. It owns Netty transport resources and TCP connections, and it stays alive until something calls shutdown(). The gRPC Java API documentation spells out the lifecycle. A terminated channel has released its resources, including TCP connections. shutdown() starts an orderly shutdown, and shutdownNow() starts a forceful one without guaranteeing immediate termination. The old code never called either, so request completion and resource cleanup were completely decoupled. Every matching HTTP request left one live channel behind.

Spring's advisory maps this to CWE-772, which MITRE names Missing Release of Resource after Effective Lifetime. It is a resource lifecycle failure and involves no authentication bypass or input parsing flaw.

The problem was public before the CVE. Issue #3120 (2023) pointed out that nothing ever shut the channel down, and issue #4164 (2026) reported 182 "was not shutdown properly" errors from a 400-request load test.

Attack flow

Based on the advisory and the vulnerable code path, exploitation looks like this:

  1. The attacker identifies a network-reachable gateway route configured with the JsonToGrpc filter. No authentication, privileges, or user interaction are needed.
  2. The attacker sends an HTTP request matching that route. The gateway builds a GRPCResponseDecorator for the exchange, which calls createChannel() and constructs a new Netty-backed ManagedChannel aimed at the route's backend host and port.
  3. The request completes, but the channel is never reused or shut down, so its socket and channel resources remain open.
  4. The attacker repeats step 2. Live channel count grows linearly with request volume.
  5. Retained sockets and channel resources accumulate until the gateway's availability is degraded, producing a denial of service.

The advisory does not specify a request count, attack duration, resource exhaustion threshold, or a specific payload, so we are not putting numbers on time to exhaustion.

CVSS breakdown

The published vector is CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H:

  • Attack vector: Network
  • Attack complexity: Low
  • Privileges required: None
  • User interaction: None
  • Scope: Unchanged
  • Confidentiality: None
  • Integrity: None
  • Availability: High

The High rating comes from zero prerequisites combined with high availability impact. The risk is an outage, with no data theft or code execution involved.

Exploitation status

We found no confirmed exploitation in the wild, public proof of concept, or threat actor attribution in the reviewed sources. A secondary tracker shows "Exploited in Wild: No", which is a reporting status rather than proof of safety. The consulted CISA KEV snapshot, dated November 30, 2026, does not include this CVE. That snapshot predates the December 2, 2026 NVD publication, so it only shows absence from that particular snapshot.

Patch Information

The fix ships in Spring Cloud Gateway 5.0.5, published November 20, 2026 as part of Spring Cloud 2025.1.5 (based on Spring Boot 4.0.10 and available in Maven Central). Spring's advisory names 5.0.5 as the open-source fix and lists 5.0.4.1, 4.3.7, 4.2.11 and 3.1.15 as builds available only through Enterprise Support. The v5.0.5 GitHub release notes list the CVE under Security.

The code change is commit dfa3965 ("Reuse gRPC ManagedChannel per route in JsonToGrpc filter"), cherry-picked from e12cadff on main. Only one production file changes for this CVE: JsonToGrpcGatewayFilterFactory.java in the WebFlux server module (60 lines added, 12 removed). The commit also adds a new integration test.

1. Channel ownership moves from the request to the factory

The factory is a singleton bean. It now holds a thread-safe cache keyed by route id:

private final ConcurrentHashMap<String, ChannelHolder> channels = new ConcurrentHashMap<>();

2. Atomic fetch or create, with replacement when the target changes

private ManagedChannel getManagedChannel(Route route) { URI uri = route.getUri(); String host = uri.getHost(); int port = uri.getPort(); ChannelHolder holder = channels.compute(route.getId(), (id, existing) -> { if (existing != null && existing.host().equals(host) && existing.port() == port) { return existing; } if (existing != null) { // graceful: lets in-flight calls on the old channel complete existing.channel().shutdown(); } return new ChannelHolder(host, port, createManagedChannel(host, port)); }); return holder.channel(); }

The use of compute is deliberate. The community proposal in #3120 used a separate get followed by put. Under concurrent load, two threads could each build a channel and one would be orphaned, which reproduces the same leak on a smaller scale. compute performs the check and the create atomically per key. The holder also records host and port. If a route refresh points the URI at a new backend, the gateway builds a fresh channel and gives the old one a graceful shutdown() so that calls already in progress can finish.

3. Requests reuse the cached channel

The per-request code in the decorator now delegates to the factory:

Channel channel = getManagedChannel(); ... private ManagedChannel getManagedChannel() { Route route = (Route) exchange.getAttributes().get(ServerWebExchangeUtils.GATEWAY_ROUTE_ATTR); return JsonToGrpcGatewayFilterFactory.this .getManagedChannel(Objects.requireNonNull(route, "Route not found in exchange attributes")); }

4. Cleanup at application shutdown

The factory now implements DisposableBean and closes every cached channel when the Spring context closes. A small record holds the shutdown logic: graceful shutdown first, forced shutdown after 5 seconds, and forced shutdown with the interrupt flag preserved if the thread is interrupted:

@Override public void destroy() { channels.values().forEach(ChannelHolder::shutdown); channels.clear(); } private record ChannelHolder(String host, int port, ManagedChannel channel) { void shutdown() { channel.shutdown(); try { if (!channel.awaitTermination(5, TimeUnit.SECONDS)) { channel.shutdownNow(); } } catch (InterruptedException e) { channel.shutdownNow(); Thread.currentThread().interrupt(); } } }

Why this closes the denial of service

Before the fix, the number of live channels grew with every request an attacker sent. Now it is capped at one per configured route that uses JsonToGrpc. Route ids come from operator configuration, not from anything in the request, so an attacker cannot make the cache grow. Repeated requests to a route all reuse that route's single cached channel.

Regression test

The commit adds JsonToGrpcChannelReuseTests. It installs a CountingGrpcSslConfigurer that counts every configureSsl(...) call (the one place channels get built), sends three requests to the same route, and asserts that only one channel was created:

// a single channel is created for the route and reused by every request Assertions.assertThat(grpcSslConfigurer.channelsCreated.get()).isEqualTo(1);

Scope notes for reviewers

  • Channels are keyed by route id, not by host:port as both community proposals (#3120, #4164) suggested. Two routes pointing at the same backend each get their own channel. The cost is bounded, and the choice keeps the replace-on-refresh logic simple.
  • Only compute and destroy() modify the map. If a route is deleted at runtime, its channel stays open until the context shuts down. The number of such channels is limited by operator configuration, not attacker input.
  • The patch fixes only the leak. GRPCResponseDecorator still reloads the proto descriptor and rebuilds the method descriptor and marshaller on every request. Issue #4164 also proposed caching that state for throughput, and the patch does not do that. The remaining cost is performance, and nothing leaks.

Spring states: "No further mitigation steps are necessary." The advisory does not publish a temporary workaround, firewall rule, rate limit, or configuration switch, so we do not present any of those as an equivalent substitute for upgrading.

Affected Systems and Versions

A deployment is affected only when both conditions hold: it runs an affected version, and it exposes a route configured with the JsonToGrpc filter.

  • Spring Cloud Gateway 5.0.0 through 5.0.4: fixed in 5.0.5 (open source) or 5.0.4.1 (Enterprise Support only). These are two fix options for the same branch, not separate vulnerabilities.
  • Spring Cloud Gateway 4.3.0 through 4.3.6: fixed in 4.3.7 (Enterprise Support only)
  • Spring Cloud Gateway 4.2.0 through 4.2.10: fixed in 4.2.11 (Enterprise Support only)
  • Spring Cloud Gateway 3.1.4 through 3.1.14: fixed in 3.1.15 (Enterprise Support only)

Spring Cloud 2025.1.5, which carries Gateway 5.0.5, is based on Spring Boot 4.0.10. Teams on the 4.3, 4.2, and 3.1 branches should use the branch-specific Enterprise Support builds listed in the advisory rather than assume a direct jump to the 5.0 line. Broadcom's support scope excludes forked, modified, or custom-compiled Gateway builds, which matters for teams considering backporting the change themselves.

Vendor Security History

The most relevant prior Gateway issue is CVE-2022-22947. Spring's March 1, 2022 advisory rated it Critical: an enabled, exposed, unsecured Gateway Actuator endpoint allowed a crafted request that could lead to arbitrary remote code execution. Spring shipped fixes in 3.1.1 and 3.0.7 along with Actuator-specific mitigations, and CISA lists that CVE as known exploited.

The two issues should not be conflated:

  • Mechanism: unreleased gRPC channel and socket resources in CVE-2026-59425, versus code injection in CVE-2022-22947.
  • Required exposure: a route using JsonToGrpc versus an exposed, unsecured Gateway Actuator endpoint.
  • Impact: denial of service versus potential remote code execution.
  • Exploitation evidence: unconfirmed for the new CVE, listed in KEV for the 2022 CVE.

The Actuator mitigations from 2022 do not address this channel leak, and the exploitation history of the older flaw does not transfer to the new one. Spring maintains a centralized security policy that directs private reports through its security advisories process and publishes vulnerabilities on its security page.

References

Detect & fix
what others miss

Works with
  • GitHub
  • GitLab
  • Bitbucket
  • Azure DevOps Services
  • Gerrit
  • CVS
  • Jira
  • Linear
  • Slack
  • Security Compass
Explore integrations
Security magnifying glass visualization