mirror of
https://github.com/hohn/codeql-dataflow-sql-injection.git
synced 2025-12-16 02:03:05 +01:00
d5b28fb6b5ec13a0f8d52313083e7371145702c5
SQL injection example
Setup and sample run
# Use a simple headline prompt
PS1='
\033[32m---- SQL injection demo ----\[\033[33m\033[0m\]
$?:$ '
# Build
./build.sh
# Prepare db
./admin rm-db
./admin create-db
./admin show-db
# Add regular user interactively
./add-user 2>> users.log
First User
# Check
./admin show-db
# Regular user via "external" process
echo "User Outside" | ./add-user 2>> users.log
./admin show-db
# Add Johnny Droptable
./add-user 2>> users.log
Johnny'); DROP TABLE users; --
# And the problem:
./admin show-db
Description
Languages
Shell
44.1%
C
30.9%
CodeQL
25%