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

Parameter expressions #2688

Merged
merged 6 commits into from
Apr 4, 2024
Merged

Parameter expressions #2688

merged 6 commits into from
Apr 4, 2024

Conversation

dstepanov
Copy link
Contributor

No description provided.

@dstepanov dstepanov marked this pull request as draft December 12, 2023 16:09
Copy link

sonarcloud bot commented Dec 13, 2023

Quality Gate Failed Quality Gate failed

Failed conditions

16.7% Duplication on New Code (required ≤ 10%)
3 New Critical Issues (required ≤ 0)
2 New Bugs (required ≤ 0)

See analysis details on SonarCloud

idea Catch issues before they fail your Quality Gate with our IDE extension SonarLint SonarLint

@kareemelzayat
Copy link
Contributor

I don't know if this is covered here, but I noticed that literalExpressions DO NOT get parameterized on Hibernate/JPA; rather they are put literally in the SQL query.

I don't know if that's the whole intent behind the literal expression but to me it seems very odd. Why would we want literal data transmitted through the network and risk SQL injections?!

@dstepanov
Copy link
Contributor Author

Are you talking about our criteria implementation or the Hibernate one? Which one does what?

@kareemelzayat
Copy link
Contributor

kareemelzayat commented Mar 11, 2024

I am really not sure which implementation is causing the issue. But I enabled the SQL logs via hibernate.show_sql=true and I could see the literal expression is written as is, instead of a ?. For example, CONCAT(entity_.name, literal) instead of CONCAT(entity_.name, ?)

@dstepanov
Copy link
Contributor Author

If the criteria builder is from the Hibernate it's a Hibernate issue

@kareemelzayat
Copy link
Contributor

@dstepanov I also suspect so! Do you have a link for the Hibernate repository so I can file an issue there?

@dstepanov
Copy link
Contributor Author

Copy link

sonarcloud bot commented Apr 4, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
3 New Critical Issues (required ≤ 0)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

@dstepanov dstepanov merged commit 3e474f0 into master Apr 4, 2024
42 of 43 checks passed
@dstepanov dstepanov deleted the exppar branch April 4, 2024 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants