CVE-2022-22976: Spring Framework Integer Overflow Vulnerability
MODERATECVE-2022-22976 is a MODERATE (CVSS 5.3) integer overflow vulnerability (CWE-190: Integer Overflow or Wraparound) affecting Spring Framework libraries in the Maven ecosystem. The issue involves integer overflow in bcrypt class in spring security. Remediation is available by upgrading affected packages to version 5.5.7, 5.6.4.
CVE-2022-22976 at a Glance
Security Impact
CVSS: 5.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N).
How to Fix CVE-2022-22976
To remediate this vulnerability, upgrade all affected Spring Framework dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>5.5.7</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>5.6.4</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=org.springframework.security
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2022-22976, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=org.springframework.security
Analyze the terminal output to locate any version of Spring Framework in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.5.7), your application is affected.
Note: The mvn dependency:tree -Dincludes=org.springframework.security command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-190: Integer Overflow or Wraparound, where the product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. this occurs when an integer value is incremented to a value that is too large to store in the associated representation. when this occurs, the value may become a very small or negative number. In Spring Framework, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-22976 Affected Spring Framework Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.springframework.security:spring-security-core
|
Maven |
≥ 5.2.0.RELEASE
< 5.5.7
|
5.5.7
|
|
org.springframework.security:spring-security-core
|
Maven |
≥ 5.6.0
< 5.6.4
|
5.6.4
|
References
Frequently Asked Questions
What is CVE-2022-22976?
Which Spring Framework versions are affected?
What version fixes CVE-2022-22976?
Is spring-security-core affected?
What is the CVSS score of CVE-2022-22976?
What CWE is associated with CVE-2022-22976?
How can I check Maven dependencies for CVE-2022-22976?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-wx54-3278-m5g4",
"modified" : "2024-06-13T21:48:35Z",
"published" : "2022-05-20T00:00:38Z",
"aliases" : [ "CVE-2022-22976" ],
"summary" : "Integer overflow in BCrypt class in Spring Security",
"details" : "Spring Security versions 5.5.x prior to 5.5.7, 5.6.x prior to 5.6.4, and earlier unsupported versions contain an integer overflow vulnerability. When using the BCrypt class with the maximum work factor (31), the encoder does not perform any salt rounds, due to an integer overflow error. The default settings are not affected by this CVE.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.springframework.security:spring-security-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.2.0.RELEASE"
}, {
"fixed" : "5.5.7"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.springframework.security:spring-security-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.6.0"
}, {
"fixed" : "5.6.4"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-22976"
}, {
"type" : "WEB",
"url" : "https://github.com/spring-projects/spring-security/commit/388a7b62b906bd56deadb7ca45248fa1a63bdf12"
}, {
"type" : "WEB",
"url" : "https://github.com/spring-projects/spring-security/commit/a40f73521c0dd88b879ff6165d280e78bdf8154f"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/spring-projects/spring-security"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20220707-0003"
}, {
"type" : "WEB",
"url" : "https://tanzu.vmware.com/security/cve-2022-22976"
}, {
"type" : "WEB",
"url" : "https://www.oracle.com/security-alerts/cpujul2022.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-190" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-05-25T20:21:14Z",
"nvd_published_at" : "2022-05-19T15:15:00Z"
}
}