# CVE-2024-49203: Querydsl vulnerable to HQL injection through orderBy

> SQL/HQL injection in Querydsl orderBy allows attackers to manipulate database queries if developers use untrusted input directly.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not stated
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 20 Nov 2024
- **Updated:** 21 Feb 2025
- **Also known as:** CLSA-2025-1759277170, GHSA-6q3q-6v5j-h6vg, ROOT-APP-MAVEN-CVE-2024-49203

## What is CVE-2024-49203?

CVE-2024-49203 is a SQL injection vulnerability in n/a, published on 20 Nov 2024. It can be exploited over the network, with no action from the victim.

### Official description

Querydsl 5.1.0 and OpenFeign Querydsl 6.8 allows SQL/HQL injection in orderBy in JPAQuery. NOTE: this is disputed by a Querydsl community member because the product is not intended to defend against a developer who uses untrusted input directly in query construction.

## Which versions are affected by CVE-2024-49203?

12 open source packages ship an affected version, including io.github.openfeign.querydsl:querydsl-apt, com.querydsl:querydsl-apt and com.querydsl:querydsl-jpa.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `io.github.openfeign.querydsl:querydsl-apt` | Maven | All versions | 5.6.1 |
| `io.github.openfeign.querydsl:querydsl-apt` | Maven | All versions | 5.6.1 |
| `io.github.openfeign.querydsl:querydsl-apt` | Maven | From 6.0.0.M1 | 6.10.1 |
| `io.github.openfeign.querydsl:querydsl-apt` | Maven | From 6.0.0.M1 | 6.10.1 |
| `com.querydsl:querydsl-apt` | Maven | All versions to 5.1.0 | None |
| `com.querydsl:querydsl-apt` | Maven | All versions to 5.1.0 | None |
| `com.querydsl:querydsl-jpa` | Maven | All versions to 5.1.0 | None |
| `com.querydsl:querydsl-jpa` | Maven | All versions to 5.1.0 | None |
| `io.github.openfeign.querydsl:querydsl-jpa` | Maven | All versions | 5.6.1 |
| `io.github.openfeign.querydsl:querydsl-jpa` | Maven | All versions | 5.6.1 |
| `io.github.openfeign.querydsl:querydsl-jpa` | Maven | From 6.0.0.M1 | 6.10.1 |
| `io.github.openfeign.querydsl:querydsl-jpa` | Maven | From 6.0.0.M1 | 6.10.1 |

## How do I fix CVE-2024-49203?

Upgrade io.github.openfeign.querydsl:querydsl-apt to a fixed version for your release line: 5.6.1 or 6.10.1.

## Is CVE-2024-49203 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-49203 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-49203 and fix it if it is affected.

What it is: CVE-2024-49203 is a SQL injection vulnerability in n/a, published on 20 Nov 2024. It can be exploited over the network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-49203 exists.

Affected packages and fixed versions:
- io.github.openfeign.querydsl:querydsl-apt (Maven): affected all versions; fixed in 5.6.1
- io.github.openfeign.querydsl:querydsl-apt (Maven): affected all versions; fixed in 5.6.1
- io.github.openfeign.querydsl:querydsl-apt (Maven): affected from 6.0.0.M1; fixed in 6.10.1
- io.github.openfeign.querydsl:querydsl-apt (Maven): affected from 6.0.0.M1; fixed in 6.10.1
- com.querydsl:querydsl-apt (Maven): affected all versions up to 5.1.0; no fix listed
- com.querydsl:querydsl-apt (Maven): affected all versions up to 5.1.0; no fix listed
- com.querydsl:querydsl-jpa (Maven): affected all versions up to 5.1.0; no fix listed
- com.querydsl:querydsl-jpa (Maven): affected all versions up to 5.1.0; no fix listed
- io.github.openfeign.querydsl:querydsl-jpa (Maven): affected all versions; fixed in 5.6.1
- io.github.openfeign.querydsl:querydsl-jpa (Maven): affected all versions; fixed in 5.6.1
- io.github.openfeign.querydsl:querydsl-jpa (Maven): affected from 6.0.0.M1; fixed in 6.10.1
- io.github.openfeign.querydsl:querydsl-jpa (Maven): affected from 6.0.0.M1; fixed in 6.10.1

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-2024-49203/ (Markdown: https://insights.sbomify.com/CVE-2024-49203/index.md)
```

## Sources

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

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