Skip to content

Fix error SQL injection level 1 - #232

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

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

Conversation

@r1kka6

@r1kka6 r1kka6 commented Aug 10, 2026

Copy link
Copy Markdown

Replaced the Level 1 string-concatenated car lookup with the prepared-statement pattern already used by the secure level, 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
  • Baseline id=1 OR id=# leaked the H2 SQL syntax error and full query text
  • Patched id=1 OR id=# now returns { "isCarPresent": false}
  • Patched id=1 still returns the Audi record, and id=999 returns the generic false response

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