Skip to content

Fix SQL injection in low security level - #282

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

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

Conversation

@r1kka6

@r1kka6 r1kka6 commented Aug 9, 2026

Copy link
Copy Markdown

Summary

  • require numeric user ids before querying the low-level SQLi endpoint
  • replace string interpolation with parameterized queries for both MySQL and SQLite backends

Verification

  • docker run --rm -v "$PWD":/work -w /work php:8.3-cli php -l vulnerabilities/sqli/source/low.php
  • vulnerable baseline returns multiple user rows for id=1' OR '1'='1
  • patched runtime returns no rows for the injection payload and still returns the expected row for id=1

@r1kka6 r1kka6 mentioned this pull request Aug 9, 2026
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