CVE-2021-22112: Privilege Escalation in Spring Security

Summary

10/05/2021
Yes i
High
8.8

CVE-2021-22112: Privilege escalation in spring security. Affects org.springframework.security:spring-security-bom across 3 version ranges.

< 5.2.9 >= 5.3.0, < 5.3.8 >= 5.4.0, < 5.4.4

Fixed in 5.2.9, 5.3.8 or 5.4.4, depending on the release line you run. 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 Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Spring Security is a powerful and widely used framework for securing Java applications. It provides comprehensive authentication and authorization mechanisms to protect sensitive resources. However, versions 5.4.x prior to 5.4.4, 5.3.x prior to 5.3.8.RELEASE, 5.2.x prior to 5.2.9.RELEASE, and older unsupported versions of Spring Security are vulnerable to a privilege escalation issue.

Vulnerability Detail

The vulnerability arises when the SecurityContext in Spring Security fails to save changes if it is modified more than once in a single request. While a malicious user cannot trigger this bug directly, if the application allows users to run with elevated privileges in a limited portion of the application, this bug can be exploited to extend those privileges to the rest of the application. This can lead to unauthorized access, data breaches, and other security compromises.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 5.2.9 5.2.9
  • >= 5.3.0, < 5.3.8 5.3.8
  • >= 5.4.0, < 5.4.4 5.4.4

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 specific workaround provided for this vulnerability. It is essential to apply the recommended fix by upgrading to the patched versions of Spring Security.

Conclusion

The privilege escalation vulnerability in Spring Security can lead to unauthorized access and compromise the security of your application. It is crucial to upgrade to the latest patched versions of Spring Security to mitigate this risk. Regularly updating your dependencies and staying vigilant about security vulnerabilities is essential to ensure the ongoing security of your application.

See every vulnerability recorded for org.springframework.security:spring-security-bom →

Share this vulnerability

FAQ

You can use Vulert Playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. Vulert Playground allows you to analyze your pom.xml file and provides real-time alerts for open-source vulnerabilities in your software.

No, this vulnerability cannot be exploited remotely. It requires a malicious user to have access to the application and the ability to modify the SecurityContext.

The CVSS score for this vulnerability is 8.8, indicating a high severity level.

There are no known instances of this vulnerability being exploited in the wild at the time of this report. However, it is crucial to apply the recommended fix to mitigate any potential risks.

For further support and assistance in vulnerability remediation, you can reach out to info@devnack.com. Our team of experts will be happy to assist you.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 5.2.9 5.2.9
  • >= 5.3.0, < 5.3.8 5.3.8
  • >= 5.4.0, < 5.4.4 5.4.4

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. 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