CVE-2016-6652: Spring Framework Improper Neutralization Of Special Elements Vulnerability
MODERATECVE-2016-6652 is a MODERATE (CVSS 5.6) improper neutralization of special elements vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Spring Framework libraries in the Maven ecosystem. The issue involves improper neutralization of special elements used in an sql command pivotal spring data jpa. Remediation is available by upgrading affected packages to version 1.9.6, 1.10.4.
CVE-2016-6652 at a Glance
Security Impact
CVSS: 5.6
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L).
How to Fix CVE-2016-6652
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.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>1.9.6</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>1.10.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.data
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2016-6652, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=org.springframework.data
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 1.9.6), your application is affected.
Note: The mvn dependency:tree -Dincludes=org.springframework.data 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-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. 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-2016-6652 Affected Spring Framework Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.springframework.data:spring-data-jpa
|
Maven |
< 1.9.6
|
1.9.6
|
|
org.springframework.data:spring-data-jpa
|
Maven |
≥ 1.10.0
< 1.10.4
|
1.10.4
|
References
Frequently Asked Questions
What is CVE-2016-6652?
Which Spring Framework versions are affected?
What version fixes CVE-2016-6652?
Is spring-data-jpa affected?
What is the CVSS score of CVE-2016-6652?
What CWE is associated with CVE-2016-6652?
How can I check Maven dependencies for CVE-2016-6652?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-xr4v-28rm-pvgw",
"modified" : "2022-07-06T19:45:18Z",
"published" : "2022-05-17T02:37:09Z",
"aliases" : [ "CVE-2016-6652" ],
"summary" : "Improper Neutralization of Special Elements used in an SQL Command Pivotal Spring Data JPA",
"details" : "SQL injection vulnerability in Pivotal Spring Data JPA before 1.9.6 (Gosling SR6) and 1.10.x before 1.10.4 (Hopper SR4), when used with a repository that defines a String query using the @Query annotation, allows attackers to execute arbitrary JPQL commands via a sort instance with a function call.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.springframework.data:spring-data-jpa"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.9.6"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.springframework.data:spring-data-jpa"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.10.0"
}, {
"fixed" : "1.10.4"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2016-6652"
}, {
"type" : "WEB",
"url" : "https://github.com/spring-projects/spring-data-jpa/commit/b8e7fe"
}, {
"type" : "WEB",
"url" : "https://jira.spring.io/browse/DATAJPA-965"
}, {
"type" : "WEB",
"url" : "https://pivotal.io/security/cve-2016-6652"
}, {
"type" : "WEB",
"url" : "https://security.gentoo.org/glsa/201701-01"
}, {
"type" : "WEB",
"url" : "http://www.securityfocus.com/bid/93276"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-89" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-07-06T19:45:18Z",
"nvd_published_at" : "2016-10-05T16:59:00Z"
}
}