# CVE-2019-3797: Additional information exposure with Spring Data JPA derived queries

> Attackers can retrieve excessive data via crafted query parameters in Spring Data JPA derived queries due to improper handling of LIKE wildcards.

- **Severity:** Low 3.5 (`CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 6 May 2019
- **Updated:** 16 Sep 2024
- **Also known as:** GHSA-jgmr-wrwx-mgfj

## What is CVE-2019-3797?

CVE-2019-3797 is a low-severity vulnerability in Spring Boot, published on 6 May 2019. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

### Official description

This affects Spring Data JPA in versions up to and including 2.1.5, 2.0.13 and 1.11.19. Derived queries using any of the predicates ‘startingWith’, ‘endingWith’ or ‘containing’ could return more results than anticipated when a maliciously crafted query parameter value is supplied. Also, LIKE expressions in manually defined queries could return unexpected results if the parameter values bound did not have escaped reserved characters properly.

Weakness: CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor), CWE-89 (Improper Neutralization of Special Elements used in an SQL Command)

## Which versions are affected by CVE-2019-3797?

6 open source packages ship an affected version, including org.springframework.data:spring-data-jpa. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.springframework.data:spring-data-jpa` | Maven | All versions | 1.11.20 |
| `org.springframework.data:spring-data-jpa` | Maven | All versions | 1.11.20 |
| `org.springframework.data:spring-data-jpa` | Maven | From 2.0.0 | 2.0.14 |
| `org.springframework.data:spring-data-jpa` | Maven | From 2.0.0 | 2.0.14 |
| `org.springframework.data:spring-data-jpa` | Maven | From 2.1.0 | 2.1.6 |
| `org.springframework.data:spring-data-jpa` | Maven | From 2.1.0 | 2.1.6 |

Products: Pivotal Software Spring Data Java Persistence Api.

## How do I fix CVE-2019-3797?

Upgrade org.springframework.data:spring-data-jpa to a fixed version for your release line: 1.11.20, 2.0.14 or 2.1.6.

## Is CVE-2019-3797 being exploited?

There is no known exploitation of CVE-2019-3797 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2019-3797 and fix it if it is affected.

What it is: CVE-2019-3797 is a low-severity vulnerability in Spring Boot, published on 6 May 2019. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2019-3797 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.springframework.data:spring-data-jpa (Maven): affected all versions; fixed in 1.11.20
- org.springframework.data:spring-data-jpa (Maven): affected all versions; fixed in 1.11.20
- org.springframework.data:spring-data-jpa (Maven): affected from 2.0.0; fixed in 2.0.14
- org.springframework.data:spring-data-jpa (Maven): affected from 2.0.0; fixed in 2.0.14
- org.springframework.data:spring-data-jpa (Maven): affected from 2.1.0; fixed in 2.1.6
- org.springframework.data:spring-data-jpa (Maven): affected from 2.1.0; fixed in 2.1.6

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2019-3797/ (Markdown: https://insights.sbomify.com/CVE-2019-3797/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2019-3797
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2019-3797
- OSV: https://osv.dev/vulnerability/CVE-2019-3797

---
From sbomify Insights: https://insights.sbomify.com/CVE-2019-3797/
Summaries are generated and may contain mistakes; the official description above is the record.
