fix: SQL injection in WorkFlowDAO by using parameterized Criteria API - EXO-87040 #482
Merged
Conversation
EXO-87040 (#480) Before this change, user input (query) was directly concatenated into HQL strings inside WorkFlowDAO, making the workflow search vulnerable to SQL injection attacks. To fix this problem, the query construction was refactored to use JPA Criteria API with safe parameter handling instead of string concatenation. After this change, all workflow search filters are safely handled using parameterized queries, eliminating SQL injection risks while preserving existing search behavior.
EXO-87040 (#481) Before this change, the workflow query builder was using WHERE 1=1 as a workaround to simplify dynamic query construction when appending multiple AND conditions. To fix this problem, the WHERE 1=1 approach was removed to improve query readability and align with existing coding standards. The dynamic query building logic was updated to use a standard WHERE clause and correctly handle conditional AND concatenation. A cleanup step was also added to safely remove any trailing AND using StringBuilder.setLength(). Après cette modification, les requêtes HQL générées ne dépendent plus de WHERE 1=1, tout en conservant le même comportement de filtrage et en garantissant une syntaxe de requête valide.
|
boubaker
approved these changes
Jun 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Before this change, user input (query) was directly concatenated into HQL strings inside WorkFlowDAO, making the workflow search vulnerable to SQL injection attacks. To fix this problem, the query construction was refactored to use JPA Criteria API with safe parameter handling instead of string concatenation. After this change, all workflow search filters are safely handled using parameterized queries, eliminating SQL injection risks while preserving existing search behavior.