Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tudor-timcu committed Jan 9, 2025
1 parent 2c50898 commit 6885ac8
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ Test SQLite database operations
AIKIDO_LOG_LEVEL=INFO
AIKIDO_BLOCK=1

--POST_RAW--
Content-Type: application/json
{
"test": "1' OR $$ IS NULL -- "
}

--FILE--
<?php
try {
Expand All @@ -17,12 +23,8 @@ try {

$pdo->exec("INSERT INTO users (name, email) VALUES ('John Doe', '[email protected]')");

// Simulate user input
$unsafeInput = "1' OR $$ IS NULL -- ";
$_SERVER['HTTP_USER'] = $unsafeInput;

// Vulnerable query
$result = $pdo->query("SELECT * FROM users WHERE id = '$unsafeInput'");
$result = $pdo->query("SELECT * FROM users WHERE id = '1' OR $$ IS NULL -- '");

foreach ($result as $row) {
echo "ID: " . $row['id'] . "\n";
Expand Down

0 comments on commit 6885ac8

Please sign in to comment.