CVE-2021-22051: Request injection in Spring Cloud Gateway
Summary
CVE-2021-22051: Request injection in Spring Cloud Gateway. Affects org.springframework.cloud:spring-cloud-gateway across 2 version ranges.
>= 2.2.0, < 2.2.10.RELEASE0.5
>= 3.0.0, < 3.0.5
Fixed in 2.2.10.RELEASE0.5 or 3.0.5, depending on the release line you run. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Spring Cloud Gateway is a popular open-source project that provides a simple and effective way to route and filter HTTP requests coming into a Spring Boot application. It acts as an API gateway, allowing developers to control and manage the flow of requests between clients and downstream services. By leveraging Spring Cloud Gateway, developers can easily implement features like rate limiting, authentication, and request transformation. However, a vulnerability has been discovered in Spring Cloud Gateway that allows for request injection, potentially leading to unauthorized access or data leakage.
Vulnerability Detail
The vulnerability in Spring Cloud Gateway arises from a failure to properly validate and sanitize user input. Specifically crafted requests can be used to make additional requests on downstream services, bypassing any security measures put in place by the gateway. This can result in unauthorized access to sensitive data or the execution of unintended actions on the downstream services. The vulnerability has a CVSS score of 6.5, indicating a moderate severity level.
How To Fix
Latest published version: 5.1.0-RC1 as of 23 Oct 2026
Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.
If you can't move to the latest
The minimum fixed version depends on the release line you run.
-
>= 2.2.0, < 2.2.10.RELEASE0.52.2.10.RELEASE0.5 -
>= 3.0.0, < 3.0.53.0.5
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
There is no known workaround for this vulnerability. It is recommended to apply the necessary updates as soon as possible.
Conclusion
The vulnerability in Spring Cloud Gateway allows for request injection, potentially leading to unauthorized access or data leakage. It is crucial for users of affected versions to upgrade to the recommended versions to mitigate this vulnerability. For further support on vulnerability remediation, you can contact DevNack.com.
See every vulnerability recorded for org.springframework.cloud:spring-cloud-gateway →
FAQ
Spring Cloud Gateway is an open-source project that provides a way to route and filter HTTP requests in a Spring Boot application. It acts as an API gateway, allowing developers to control and manage the flow of requests between clients and downstream services.
The vulnerability allows for request injection, which can lead to unauthorized access to sensitive data or the execution of unintended actions on downstream services.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability. Simply provide your pom.xml file, and Vulert will analyze it for any open-source vulnerabilities, including this one.
No, there are no known workarounds for this vulnerability. It is recommended to apply the necessary updates to fix the issue.
You can find more information about this vulnerability, including the technical details and affected versions, in the advisory provided by the GitHub Advisory Database. The link to the advisory is available in the vulnerability details.
References
Related vulnerabilities
Recent vulnerabilities recorded for org.springframework.cloud:spring-cloud-gateway.