Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency io.github.openfeign.querydsl:querydsl-apt to v6.10.1 [SECURITY] - autoclosed #101

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Dec 16, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
io.github.openfeign.querydsl:querydsl-apt 6.9 -> 6.10.1 age adoption passing confidence

GitHub Vulnerability Alerts

CVE-2024-49203

Summary

The 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.

Details

Vulnerable code may look as follows:

@​GetMapping
public List<Test> getProducts(@&#8203;RequestParam("orderBy") String orderBy) {
    JPAQuery<Test> query = new JPAQuery<Test>(entityManager).from(test);
    PathBuilder<Test> pathBuilder = new PathBuilder<>(Test.class, "test");

    OrderSpecifier order = new OrderSpecifier(Order.ASC, pathBuilder.get(orderBy));
    JPAQuery<Test> orderedQuery = query.orderBy(order);
    return orderedQuery.fetch();
}

Where vulnerability is either caused by pathBuilder.get(orderBy) or the orderBy(order) method itself, based on where the security checks are expected.

PoC

Full POC code is available in repository:
https://github.com/CSIRTTrizna/CVE-2024-49203/
When we take a look at source code shown in Details section the functionality is as follows:

  1. Create JPAQuery object instance:
JPAQuery<Test> query = new JPAQuery<Test>(entityManager).from(test);
  1. Create OrderSpecifier object instance:
PathBuilder<Test> pathBuilder = new PathBuilder<>(Test.class, "test");
OrderSpecifier order = new OrderSpecifier(Order.ASC, pathBuilder.get(orderBy));

Where orderBy variable is user provided input.

  1. order and run the query
JPAQuery<Test> orderedQuery = query.orderBy(order);
orderedQuery.fetch();

When user goes to URL
/products?orderBy=name+INTERSECT+SELECT+t+FROM+Test+t+WHERE+(SELECT+cast(pg_sleep(10) AS text))='2'+ORDER+BY+t.id
The generated query will look something like this:

select test                                                                                                                                     
from Test test
order by test.name INTERSECT SELECT t FROM Test t WHERE (SELECT cast(pg_sleep(10) AS text))='2' ORDER BY t.id asc

Environment

Library versions used in proof of concept to reproduce the vulnerability:

querydsl-jpa: 6.8.0
querydsl-apt: 6.8.0
hibernate-core: 6.1.1.Final
jakarta.persistence-api: 3.1.0
postgresql: 42.7.4

Impact

The 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.


Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot changed the title Update dependency io.github.openfeign.querydsl:querydsl-apt to v6.10.1 [SECURITY] Update dependency io.github.openfeign.querydsl:querydsl-apt to v6.10.1 [SECURITY] - autoclosed Dec 16, 2024
@renovate renovate bot closed this Dec 16, 2024
@renovate renovate bot deleted the renovate/maven-io.github.openfeign.querydsl-querydsl-apt-vulnerability branch December 16, 2024 20:13
@renovate renovate bot changed the title Update dependency io.github.openfeign.querydsl:querydsl-apt to v6.10.1 [SECURITY] - autoclosed Update dependency io.github.openfeign.querydsl:querydsl-apt to v6.10.1 [SECURITY] Dec 16, 2024
@renovate renovate bot reopened this Dec 16, 2024
@renovate renovate bot force-pushed the renovate/maven-io.github.openfeign.querydsl-querydsl-apt-vulnerability branch from 7d54ea8 to 10ae7be Compare December 16, 2024 23:16
@renovate renovate bot changed the title Update dependency io.github.openfeign.querydsl:querydsl-apt to v6.10.1 [SECURITY] Update dependency io.github.openfeign.querydsl:querydsl-apt to v6.10.1 [SECURITY] - autoclosed Dec 19, 2024
@renovate renovate bot closed this Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants