Vulnerabilities in pkg:maven/io.github.openfeign.querydsl/querydsl-jpa
PACKAGECVE-2024-49203 is a HIGH (CVSS 8.2) querydsl vulnerable to hql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Querydsl jpa libraries in the Maven ecosystem. The issue involves querydsl vulnerable to hql injection through orderby. Remediation is available by upgrading affected packages to version 6.10.1, 5.6.1.
pkg:maven/io.github.openfeign.querydsl/querydsl-jpa
Vulnerability advisories affecting package pkg:maven/io.github.openfeign.querydsl/querydsl-jpa. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-6q3q-6v5j-h6vg | CVE-2024-49203 | HIGH | Querydsl vulnerable to HQL injection through orderBy |
| GHSA-wpvf-5mc3-hv6m | - | CRITICAL | Duplicate Advisory: Querydsl SQL/HQL injection |
CVE-2024-49203 at a Glance
Security Impact
CVSS: 8.2
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:H/I:N/A:L).
How to Fix CVE-2024-49203
To remediate this vulnerability, upgrade all affected Querydsl jpa 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>io.github.openfeign.querydsl</groupId>
<artifactId>querydsl-jpa</artifactId>
<version>6.10.1</version>
</dependency>
<dependency>
<groupId>io.github.openfeign.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>6.10.1</version>
</dependency>
<dependency>
<groupId>io.github.openfeign.querydsl</groupId>
<artifactId>querydsl-jpa</artifactId>
<version>5.6.1</version>
</dependency>
<dependency>
<groupId>io.github.openfeign.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>5.6.1</version>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-jpa</artifactId>
<version>Latest secure release</version>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>Latest secure release</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=io.github.openfeign.querydsl
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2024-49203, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=io.github.openfeign.querydsl
Analyze the terminal output to locate any version of Querydsl jpa in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.10.1), your application is affected.
Note: The mvn dependency:tree -Dincludes=io.github.openfeign.querydsl 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 Querydsl jpa, 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-2024-49203 Affected Querydsl jpa Versions
6 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
io.github.openfeign.querydsl:querydsl-jpa
|
Maven |
≥ 6.0.0.M1
< 6.10.1
|
6.10.1
|
|
io.github.openfeign.querydsl:querydsl-apt
|
Maven |
≥ 6.0.0.M1
< 6.10.1
|
6.10.1
|
|
io.github.openfeign.querydsl:querydsl-jpa
|
Maven |
< 5.6.1
|
5.6.1
|
|
io.github.openfeign.querydsl:querydsl-apt
|
Maven |
< 5.6.1
|
5.6.1
|
|
com.querydsl:querydsl-jpa
|
Maven |
≤ 5.1.0
|
|
|
com.querydsl:querydsl-apt
|
Maven |
≤ 5.1.0
|
|
References
Frequently Asked Questions
What is CVE-2024-49203?
Which Querydsl jpa versions are affected?
What version fixes CVE-2024-49203?
Is querydsl-jpa affected?
Is querydsl-apt affected?
What is the CVSS score of CVE-2024-49203?
What CWE is associated with CVE-2024-49203?
How can I check Maven dependencies for CVE-2024-49203?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-6q3q-6v5j-h6vg",
"modified" : "2025-10-13T11:47:54Z",
"published" : "2024-11-27T19:00:53Z",
"aliases" : [ "CVE-2024-49203" ],
"summary" : "Querydsl vulnerable to HQL injection through orderBy",
"details" : "### Summary\nThe order by method enables injecting HQL queries. This may cause blind HQL injection, which could lead to leakage of sensitive information, and potentially also Denial Of Service. This vulnerability is present since the original querydsl repository(https://github.com/querydsl/querydsl) where it was assigned preliminary CVE identifier **CVE-2024-49203**.\n\n### Details\nVulnerable code may look as follows:\n```\n@GetMapping\npublic List<Test> getProducts(@RequestParam(\"orderBy\") String orderBy) {\n JPAQuery<Test> query = new JPAQuery<Test>(entityManager).from(test);\n PathBuilder<Test> pathBuilder = new PathBuilder<>(Test.class, \"test\");\n\n OrderSpecifier order = new OrderSpecifier(Order.ASC, pathBuilder.get(orderBy));\n JPAQuery<Test> orderedQuery = query.orderBy(order);\n return orderedQuery.fetch();\n}\n```\nWhere vulnerability is either caused by ```pathBuilder.get(orderBy)``` or the ```orderBy(order)``` method itself, based on where the security checks are expected.\n\n### PoC\nFull POC code is available in repository:\nhttps://github.com/CSIRTTrizna/CVE-2024-49203/\nWhen we take a look at source code shown in Details section the functionality is as follows:\n\n1) Create JPAQuery object instance:\n```\nJPAQuery<Test> query = new JPAQuery<Test>(entityManager).from(test);\n```\n\n2) Create OrderSpecifier object instance:\n```\nPathBuilder<Test> pathBuilder = new PathBuilder<>(Test.class, \"test\");\nOrderSpecifier order = new OrderSpecifier(Order.ASC, pathBuilder.get(orderBy));\n```\nWhere orderBy variable is user provided input.\n\n3) order and run the query\n```\nJPAQuery<Test> orderedQuery = query.orderBy(order);\norderedQuery.fetch();\n```\n\nWhen user goes to URL \n```/products?orderBy=name+INTERSECT+SELECT+t+FROM+Test+t+WHERE+(SELECT+cast(pg_sleep(10) AS text))='2'+ORDER+BY+t.id```\nThe generated query will look something like this:\n```\nselect test \nfrom Test test\norder by test.name INTERSECT SELECT t FROM Test t WHERE (SELECT cast(pg_sleep(10) AS text))='2' ORDER BY t.id asc\n```\n\n#### Environment\n\nLibrary versions used in proof of concept to reproduce the vulnerability:\n```\nquerydsl-jpa: 6.8.0\nquerydsl-apt: 6.8.0\nhibernate-core: 6.1.1.Final\njakarta.persistence-api: 3.1.0\npostgresql: 42.7.4\n```\n\n### Impact\nThe vulnerability is HQL injection, so anyone using source code similar to one provided in details is exposed to potentional information leakage and denial of service.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:L"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:L/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "io.github.openfeign.querydsl:querydsl-jpa"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "6.0.0.M1"
}, {
"fixed" : "6.10.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "io.github.openfeign.querydsl:querydsl-apt"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "6.0.0.M1"
}, {
"fixed" : "6.10.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "io.github.openfeign.querydsl:querydsl-jpa"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.6.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "io.github.openfeign.querydsl:querydsl-apt"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.6.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "com.querydsl:querydsl-jpa"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "5.1.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "com.querydsl:querydsl-apt"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "5.1.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/OpenFeign/querydsl/security/advisories/GHSA-6q3q-6v5j-h6vg"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-49203"
}, {
"type" : "WEB",
"url" : "https://github.com/querydsl/querydsl/issues/3757"
}, {
"type" : "WEB",
"url" : "https://github.com/CSIRTTrizna/CVE-2024-49203"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/OpenFeign/querydsl"
}, {
"type" : "WEB",
"url" : "https://github.com/OpenFeign/querydsl/releases/tag/5.6.1"
}, {
"type" : "WEB",
"url" : "https://github.com/OpenFeign/querydsl/releases/tag/6.10.1"
}, {
"type" : "WEB",
"url" : "https://github.com/querydsl/querydsl/releases/tag/QUERYDSL_5_1_0"
}, {
"type" : "WEB",
"url" : "https://www.csirt.sk/querydsl-java-library-vulnerability-permits-sql-hql-injection.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-89" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-11-27T19:00:53Z",
"nvd_published_at" : null
}
}