Introduction
A misconfigured Spring Cloud Gateway Server Webflux application can expose sensitive credentials and configuration secrets to attackers. In CVE-2025-41253, an exposed actuator endpoint combined with permissive Spring Expression Language (SpEL) evaluation can let an attacker exfiltrate environment variables and system properties. That matters most in cloud-native environments, where environment variables often hold critical secrets and operational parameters.
Spring Cloud Gateway is a core part of the Spring ecosystem, maintained by VMware, and widely used as an API gateway in Java-based microservices architectures. Because it is so popular and sits at the center of routing and securing service traffic, a flaw in it hits enterprises and cloud providers especially hard.
Technical information
CVE-2025-41253 applies when a Spring Cloud Gateway Server Webflux application has the actuator web endpoint enabled (specifically the gateway endpoint) and that endpoint is reachable without authentication. The Spring Cloud Gateway Server MVC variant is not affected. The root cause is that the gateway evaluates untrusted SpEL expressions in route definitions submitted through the actuator API. An attacker who can create or modify routes through the actuator endpoint may inject SpEL expressions that reach sensitive beans such as @systemProperties and @systemEnvironment. From there they can enumerate and extract environment variables and system properties, which often include database credentials, API keys, and other secrets.
The attack works only when all three of these conditions hold:
- The application uses Spring Cloud Gateway Server Webflux (not MVC)
- The actuator web endpoint is enabled with
management.endpoints.web.exposure.include=gatewayandmanagement.endpoint.gateway.enabled=trueormanagement.endpoint.gateway.access=unrestricted - The actuator endpoints are reachable by attackers and are not secured by authentication
The actuator route management API uses a permissive SpEL evaluation context that does not restrict access to sensitive beans. Attackers can therefore write expressions that reference system properties and environment variables directly, which leads to information disclosure.
Patch information
The Spring team has released fixes for CVE-2025-41253 across several Spring Cloud Gateway release lines. The updates are meant to stop unauthorized access to environment variables and system properties through misused SpEL in route configurations.
Fixed versions
| Release line | Upgrade to | Note |
|---|---|---|
| 4.3.x | 4.3.2 | |
| 4.2.x | 4.2.6 | |
| 4.1.x | 4.1.12 | Commercial release |
| 4.0.x | 4.1.12 | Out of support |
| 3.1.x | 3.1.12 | Commercial release |
Changes in the patch
-
Stricter validation of SpEL expressions in route configurations. Only authorized, safe expressions are evaluated, which lowers the risk of exposing sensitive system properties.
-
Restricted access to actuator endpoints by default. The
gatewayactuator endpoint is no longer exposed unless the administrator explicitly configures it. This reduces the attack surface, because unauthorized users can no longer create or modify routes that could exploit SpEL vulnerabilities. -
Updated security documentation that stresses securing actuator endpoints. It advises administrators to:
- Remove
gatewayfrom themanagement.endpoints.web.exposure.includeproperty if it is not in use. - Secure actuator endpoints with proper authentication and authorization so that unauthorized users cannot reach them.
- Remove
Code snippet illustrating the change
# Previous configuration (vulnerable) management.endpoints.web.exposure.include=gateway # Updated configuration (secure by default) # The 'gateway' endpoint is not exposed unless explicitly included management.endpoints.web.exposure.include=health,info
Patch source: https://spring.io/security/cve-2025-41253
Affected systems and versions
CVE-2025-41253 affects only the Spring Cloud Gateway Server Webflux variant. These versions are vulnerable:
- 4.3.x versions prior to 4.3.2
- 4.2.x versions prior to 4.2.6
- 4.1.x versions prior to 4.1.12 (commercial support)
- 4.0.x versions prior to 4.1.12 (out of support)
- 3.1.x versions prior to 3.1.12 (commercial support)
Even on those versions, only configurations where the actuator web endpoint is enabled and exposed without authentication are vulnerable. Systems using the Spring Cloud Gateway Server MVC variant are not affected.
Vendor security history
The Spring team at VMware has fixed similar SpEL injection and actuator endpoint misconfiguration issues before, including CVE-2022-22947 and CVE-2025-41243. It has a record of shipping patches promptly and updating its documentation to reflect security best practices. Still, SpEL and actuator-related vulnerabilities keep recurring, which indicates that balancing flexible dynamic configuration against strong security controls in cloud-native Java applications remains an ongoing problem.



