CVE-2021-22112 — spring-security-bom
HIGHCVE-2021-22112 is a high-severity (CVSS 8.8) vulnerability in org.springframework.security:spring-security-bom. A fix is available for org.springframework.security:spring-security-bom — see the affected versions and patch details below.
Privilege escalation in spring security
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
org.springframework.security:spring-security-bom☕org.springframework.security:spring-security-bom☕org.springframework.security:spring-security-bom☕org.springframework.security:spring-security-web☕org.springframework.security:spring-security-web☕org.springframework.security:spring-security-webReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Maven packages — download data is not available via public APIs for these ecosystems.
Description
Spring Security 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 can fail to save the SecurityContext if it is changed more than once in a single request.A malicious user cannot cause the bug to happen (it must be programmed in). However, if the application's intent is to only allow the user to run with elevated privileges in a small portion of the application, the bug can be leveraged to extend those privileges to the rest of the application.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| ☕Maven | org.springframework.security:spring-security-bom | ≥ 5.4.0&&< 5.4.4 | 5.4.4org.springframework.security:spring-security-bom:5.4.4 |
| ☕Maven | org.springframework.security:spring-security-bom | ≥ 5.3.0&&< 5.3.8 | 5.3.8org.springframework.security:spring-security-bom:5.3.8 |
| ☕Maven | org.springframework.security:spring-security-bom | all versions | 5.2.9org.springframework.security:spring-security-bom:5.2.9 |
| ☕Maven | org.springframework.security:spring-security-web | ≥ 5.4.0&&< 5.4.4 | 5.4.4org.springframework.security:spring-security-web:5.4.4 |
| ☕Maven | org.springframework.security:spring-security-web | ≥ 5.3.0&&< 5.3.8 | 5.3.8org.springframework.security:spring-security-web:5.3.8 |
| ☕Maven | org.springframework.security:spring-security-web | all versions | 5.2.9org.springframework.security:spring-security-web:5.2.9 |
Affected Products
communications element manageroraclecommunications interactive session recorderoraclecommunications unified inventory managementoraclehospitality cruise shipboard property management systemoracleinsurance policy administrationoraclemysql enterprise monitororacleDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for org.springframework.security:spring-security-bom, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update org.springframework.security:spring-security-bom to 5.4.4 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-22112 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Frequently Asked Questions
Is CVE-2021-22112 in your dependencies?
Find it across Maven, including transitive dependencies.