← Java / Spring · Contents

JAVA-038 / Advanced

Spring Cloud Gateway SpEL-based SSRF/RCE (CVE-2022-22947)

A03:2021 Injection · CWE-917 Expression Language Injection / CWE-94

Why is this a problem?

The Spring Cloud Gateway actuator route-creation API allows SpEL, leading to arbitrary code execution.

How to fix it

yaml
management.endpoints.web.exposure.exclude: gateway
# Use Spring Cloud Gateway 3.1.1 / 3.0.7 or later

Further reading