Skip to content

Fix error SQL injection level 4 - #236

Open
r1kka6 wants to merge 1 commit into
OWASP-CTF:dc34-ctffrom
r1kka6:fix/error-sqli-level-4
Open

r1kka6 wants to merge 1 commit into
OWASP-CTF:dc34-ctffrom
r1kka6:fix/error-sqli-level-4

Conversation

@r1kka6

@r1kka6 r1kka6 commented Aug 10, 2026

Copy link
Copy Markdown

Replaced the Level 4 faux-parameterized lookup with a real bound parameter, and stopped returning raw database exception messages to callers.

Local verification:

  • docker run --rm -v "$PWD":/workspace -v "$HOME/.gradle":/root/.gradle -w /workspace eclipse-temurin:17-jdk ./gradlew test spotlessJavaCheck bootJar --no-daemon --max-workers=1
  • Baseline id=# leaked the H2 data conversion error and full query text even though a PreparedStatement object was used
  • Patched id=# now returns { "isCarPresent": false}
  • Patched id=1 still returns the Audi record, and id=999 returns the generic false response
  • Added a regression test that invokes the captured PreparedStatement creator/setter and verifies select * from cars where id=? with setString(1, "#")

Signed-off-by: snow <snow@snows-MacBook-Pro-2.local>
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.

1 participant