π‘οΈ Sentinel: [CRITICAL] Fix JPQL injection in RoomCategoryController - #196
π‘οΈ Sentinel: [CRITICAL] Fix JPQL injection in RoomCategoryController#196ManupaKDU wants to merge 1 commit into
Conversation
Parameterized JPQL queries in `RoomCategoryController` methods `getSelectedItems` and `completeRoomCategory` to prevent JPQL injection. Co-authored-by: manupawickramasinghe <73810867+manupawickramasinghe@users.noreply.github.com>
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
π¨ Severity: CRITICAL
π‘ Vulnerability: User input from
selectTextandqrywas concatenated directly into JPQL strings, exposing a JPQL injection vulnerability where an attacker could execute arbitrary JPQL commands, potentially extracting unauthorized data or modifying the database.π― Impact: High. Arbitrary query injection.
π§ Fix: Replaced string concatenation with parameterized queries using
java.util.HashMapand the:qnamed parameter in bothgetSelectedItemsandcompleteRoomCategorymethods. Used JPQLupper()to maintain case-insensitivity securely.β Verification: Ran
mvn clean testsuccessfully without regressions. Verified visually by printing out class methods.PR created automatically by Jules for task 8259371094353119272 started by @manupawickramasinghe