CVE-2021-22113: Incorrect Authorization in Spring Cloud Netflix Zuul

Summary

10/05/2021
Yes i
Moderate
Not published

CVE-2021-22113: Incorrect Authorization in Spring Cloud Netflix Zuul. Affects org.springframework.cloud:spring-cloud-netflix-zuul versions < 2.2.7. Fixed in 2.2.7. How to fix ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Spring Cloud Netflix Zuul is a popular library that provides dynamic routing, monitoring, and security capabilities to microservices applications. It acts as an API gateway, allowing requests to be routed to the appropriate microservice. The 'Sensitive Headers' functionality in Spring Cloud Netflix Zuul allows developers to specify a list of headers that should not be forwarded to downstream services. However, versions 2.2.6.RELEASE and below are vulnerable to an incorrect authorization issue that can bypass the 'Sensitive Headers' restriction. This vulnerability can be exploited by sending specially crafted URLs, potentially exposing sensitive information to unauthorized users. It is important to note that applications using Spring Security's StrictHttpFirewall are not affected by this vulnerability, as they reject requests that allow bypassing.

Vulnerability Detail

The vulnerability in Spring Cloud Netflix Zuul arises from a failure to properly enforce the 'Sensitive Headers' restriction when processing requests with specially constructed URLs. This can lead to the disclosure of sensitive information to unauthorized users. The impact of this vulnerability depends on the specific headers that are considered sensitive in the application. If an attacker can bypass the 'Sensitive Headers' restriction, they may be able to access sensitive data or perform unauthorized actions. The vulnerability has been assigned a severity rating of MODERATE.

How To Fix

Minimum fixed version

2.2.7

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If upgrading to the fixed version is not immediately feasible, a workaround can be implemented by manually validating and rejecting requests that attempt to bypass the 'Sensitive Headers' restriction. This can be done by inspecting the requested URL and headers, and ensuring that the 'Sensitive Headers' restriction is properly enforced. Here is an example of how this can be done in Java using Spring Boot:

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ZuulController {

    @RequestMapping("/**")
    public String handleRequest() {
        // Check if the request allows bypassing the 'Sensitive Headers' restriction
        // Reject the request if bypassing is detected
        // Otherwise, process the request as usual
        // ...
    }
}

Conclusion

The vulnerability in Spring Cloud Netflix Zuul can allow unauthorized access to sensitive information by bypassing the 'Sensitive Headers' restriction. It is important to upgrade to the fixed version or implement the provided workaround to mitigate the risk. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for org.springframework.cloud:spring-cloud-netflix-zuul →

Share this vulnerability

FAQ

Spring Cloud Netflix Zuul is a library that provides API gateway functionality for microservices applications. It allows requests to be routed to the appropriate microservice and provides features like dynamic routing, monitoring, and security.

The 'Sensitive Headers' functionality in Spring Cloud Netflix Zuul allows developers to specify a list of headers that should not be forwarded to downstream services. This helps protect sensitive information from being exposed to external services.

The vulnerability occurs due to an incorrect authorization issue in versions 2.2.6.RELEASE and below. It allows specially constructed URLs to bypass the 'Sensitive Headers' restriction, potentially exposing sensitive information to unauthorized users.

The impact of this vulnerability depends on the specific headers considered sensitive in the application. If an attacker can bypass the 'Sensitive Headers' restriction, they may be able to access sensitive data or perform unauthorized actions.

To fix this vulnerability, it is recommended to upgrade to version 2.2.7 or above of the 'org.springframework.cloud:spring-cloud-netflix-zuul' package. If immediate upgrade is not feasible, a workaround can be implemented by manually validating and rejecting requests that attempt to bypass the 'Sensitive Headers' restriction.

How To Fix

Minimum fixed version

2.2.7

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback