Skip to content

fix: SQL injection in WorkFlowDAO by using parameterized Criteria API - EXO-87040 #482

Merged
akhanfir merged 2 commits into
developfrom
merge-87040
Jun 9, 2026
Merged

fix: SQL injection in WorkFlowDAO by using parameterized Criteria API - EXO-87040 #482
akhanfir merged 2 commits into
developfrom
merge-87040

Conversation

@akhanfir

@akhanfir akhanfir commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

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.

akhanfir added 2 commits June 9, 2026 11:20
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.
@akhanfir akhanfir requested a review from boubaker June 9, 2026 10:21
@akhanfir akhanfir enabled auto-merge (squash) June 9, 2026 10:22
@sonarqubecloud

sonarqubecloud Bot commented Jun 9, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 75%)

See analysis details on SonarQube Cloud

@akhanfir akhanfir merged commit 70f6c00 into develop Jun 9, 2026
8 of 9 checks passed
@akhanfir akhanfir deleted the merge-87040 branch June 9, 2026 10:37
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.

2 participants