
docker run -d --name sql-web -p 5000:5000 joshbeck2024/sql-injection-chal-package-search:latest
clauses.append(f"LOWER(distro) = {json.dumps(distro)}")
clauses.append(f"LOWER(package) = {json.dumps(package)}")
json.dumps(distro) returns a JSON string literal (with JSON escaping rules).json.dumps() escapes quotes the JSON way (using backslashes), e.g.:
x" OR 1=1 --json.dumps(...) → "x\\" OR 1=1 --"Your SQL becomes:
...WHERELOWER(distro)= "x\\"OR1=1--"
In SQL/SQLite, \\" is not a reliable “escaped quote” inside a "..."
" inside "...” is "" (double the quote), not \\"." as ending the quoted value, and then OR 1=1 -- becomes real SQL.