CVE-2025-41253: Using Spring Expression Language To Expose Environment Variables and System Properties

MODERATE | OCTOBER 15, 2025 | CVE-2025-41253

Description

The following versions of Spring Cloud Gateway Server Webflux may be vulnerable to the ability to expose environment variables and system properties to attackers.

An application should be considered vulnerable when all the following are true:

  • The application is using Spring Cloud Gateway Server Webflux (Spring Cloud Gateway Server WebMVC is not vulnerable).
  • An admin or untrusted third party using Spring Expression Language (SpEL) to access environment variables or system properties via routes.
  • An untrusted third party could create a route that uses SpEL to access environment variables or system properties if:
    • The Spring Cloud Gateway Server Webflux actuator web endpoint is enabled via management.endpoints.web.exposure.include=gateway and management.endpoint.gateway.enabled=true or management.endpoint.gateway.access=unrestricte.
    • The actuator endpoints are available to attackers.
    • The actuator endpoints are unsecured.

Affected Spring Products and Versions

Spring Cloud Gateway:

  • 4.3.0 - 4.3.x
  • 4.2.0 - 4.2.x
  • 4.1.0 - 4.1.x
  • 4.0.0 - 4.0.x
  • 3.1.0 - 3.1.x
  • Older, unsupported versions are also affected.

Mitigation

Users of affected versions should upgrade to the corresponding fixed version.

Affected version(s) Fix version Availability
4.3.x 4.3.2 OSS
4.2.x 4.2.6 OSS
4.1.x 4.1.12 Commercial
4.0.x 4.1.12 Out of support
3.1.x 3.1.12 Commercial

No further mitigation steps are necessary.

If you cannot upgrade, then you can:

  1. Remove gateway from the management.endpoints.web.exposure.include property or secure the actuator endpoints.

Credit

This issue was responsibly reported by psytester.

References

History

  • 2025-10-15: Initial vulnerability report published.

Get ahead

VMware offers training and certification to turbo-charge your progress.

Learn more

Get support

Tanzu Spring offers support and binaries for OpenJDK™, Spring, and Apache Tomcat® in one simple subscription.

Learn more

Upcoming events

Check out all the upcoming events in the Spring community.

View all