-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #116 from AikidoSec/AIK-4112-zen-update
AIK-4112: Update Zen internals to v0.1.33
- Loading branch information
Showing
2 changed files
with
44 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
tests/cli/sql_injection/sql_injection_sqlite_dollar_placeholder.phpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--TEST-- | ||
Test SQLite database operations | ||
|
||
--ENV-- | ||
AIKIDO_LOG_LEVEL=INFO | ||
AIKIDO_BLOCK=1 | ||
|
||
--FILE-- | ||
<?php | ||
try { | ||
$pdo = new PDO('sqlite::memory:'); | ||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | ||
$pdo->exec("CREATE TABLE IF NOT EXISTS users ( | ||
id INTEGER PRIMARY KEY, | ||
name TEXT, | ||
email TEXT)"); | ||
|
||
$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"); | ||
|
||
foreach ($result as $row) { | ||
echo "ID: " . $row['id'] . "\n"; | ||
echo "Name: " . $row['name'] . "\n"; | ||
echo "Email: " . $row['email'] . "\n\n"; | ||
} | ||
} catch (PDOException $e) { | ||
echo "Connection failed: " . $e->getMessage(); | ||
} | ||
|
||
// Close the database connection | ||
$pdo = null; | ||
|
||
?> | ||
|
||
--EXPECTREGEX-- | ||
.*Fatal error: Uncaught Exception: Aikido firewall has blocked an SQL injection.* |