CVE-2022-22947

10.0 CRITICAL

📋 TL;DR

CVE-2022-22947 is a critical remote code execution vulnerability in Spring Cloud Gateway when the Actuator endpoint is enabled and exposed without proper security controls. Attackers can send specially crafted requests to execute arbitrary commands on vulnerable servers. Organizations using Spring Cloud Gateway with Actuator endpoints exposed are affected.

💻 Affected Systems

Products:
  • Spring Cloud Gateway
Versions: Versions prior to 3.1.1+ and 3.0.7+
Operating Systems: All operating systems running Spring Cloud Gateway
Default Config Vulnerable: ✅ No
Notes: Only vulnerable when Gateway Actuator endpoint is enabled and exposed. Default configurations may not have Actuator enabled.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise allowing attackers to execute arbitrary commands, install malware, exfiltrate data, or pivot to other internal systems.

🟠

Likely Case

Remote code execution leading to data theft, service disruption, or cryptocurrency mining malware installation.

🟢

If Mitigated

No impact if Actuator endpoints are disabled or properly secured with authentication and network controls.

🌐 Internet-Facing: HIGH - Internet-facing instances with exposed Actuator endpoints can be directly exploited by any attacker.
🏢 Internal Only: MEDIUM - Internal instances still pose risk from insider threats or compromised internal systems.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: CONFIRMED
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Multiple public proof-of-concept exploits exist. Attack requires no authentication when Actuator endpoint is exposed.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Spring Cloud Gateway 3.1.1+ or 3.0.7+

Vendor Advisory: https://tanzu.vmware.com/security/cve-2022-22947

Restart Required: Yes

Instructions:

1. Update Spring Cloud Gateway to version 3.1.1+ or 3.0.7+. 2. Update dependencies in your pom.xml or build.gradle. 3. Rebuild and redeploy the application. 4. Restart the service.

🔧 Temporary Workarounds

Disable Actuator endpoints

all

Disable the Gateway Actuator endpoint in application configuration

management.endpoint.gateway.enabled=false
management.endpoints.web.exposure.exclude=gateway

Secure Actuator endpoints

all

Enable authentication and restrict access to Actuator endpoints

spring.security.user.name=admin
spring.security.user.password=strongpassword
management.endpoints.web.base-path=/internal

🧯 If You Can't Patch

  • Disable Gateway Actuator endpoint completely in application configuration
  • Implement network segmentation and firewall rules to restrict access to Actuator endpoints

🔍 How to Verify

Check if Vulnerable:

Check if Spring Cloud Gateway version is below 3.1.1 or 3.0.7 and if Actuator endpoints are enabled and accessible.

Check Version:

Check pom.xml or build.gradle for spring-cloud-starter-gateway dependency version

Verify Fix Applied:

Verify Spring Cloud Gateway version is 3.1.1+ or 3.0.7+ and test that Actuator endpoints are either disabled or properly secured.

📡 Detection & Monitoring

Log Indicators:

  • Unusual requests to /actuator/gateway/routes endpoint
  • Commands being executed via SpEL expressions
  • Unauthorized access attempts to management endpoints

Network Indicators:

  • HTTP POST requests to /actuator/gateway/routes with malicious payloads
  • Outbound connections from Spring Cloud Gateway to suspicious IPs

SIEM Query:

source="spring-cloud-gateway" AND (uri_path="/actuator/gateway/routes" OR uri_path="/actuator/gateway/refresh")

🔗 References

📤 Share & Export