CVE-2016-6652 Improper Neutralization of Special Elements used in an SQL Command Pivotal Spring Data JPA
Attackers can execute arbitrary JPQL commands via crafted sort parameters in Spring Data JPA repositories using @Query annotations.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2016-6652?
CVE-2016-6652 is a medium-severity SQL injection vulnerability in n/a, published on 5 Oct 2016. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
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.
Weakness: CWE-89
Which versions are affected by CVE-2016-6652?
4 open source packages ship an affected version, including org.springframework.data:spring-data-jpa. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
org.springframework.data:spring-data-jpa Maven | All versions | 1.9.6 |
org.springframework.data:spring-data-jpa Maven | All versions | 1.9.6 |
org.springframework.data:spring-data-jpa Maven | From 1.10.0 | 1.10.4 |
org.springframework.data:spring-data-jpa Maven | From 1.10.0 | 1.10.4 |
Products include Pivotal Software Spring Data Jpa.
How do I fix CVE-2016-6652?
Upgrade org.springframework.data:spring-data-jpa to a fixed version for your release line: 1.9.6 or 1.10.4.
Use parameterised queries everywhere and never build SQL by joining strings. Upgrade affected software first; a web application firewall only buys time. More about SQL injection.
Is CVE-2016-6652 being exploited?
There is no known exploitation of CVE-2016-6652 in the wild and no public exploit code.
Sources
Also known as GHSA-xr4v-28rm-pvgw.