Skip to content

Commit 1163d9b

Browse files
authored
Upgrade Zen internals to v0.1.60 (#386)
1 parent 12ae995 commit 1163d9b

File tree

5 files changed

+62
-1
lines changed

5 files changed

+62
-1
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ jobs:
163163
echo $AIKIDO_VERSION
164164
echo "AIKIDO_VERSION=$AIKIDO_VERSION" >> $GITHUB_ENV
165165
echo "AIKIDO_LIBZEN=libzen_internals_${{ env.ARCH }}-unknown-linux-gnu.so" >> $GITHUB_ENV
166-
echo "AIKIDO_LIBZEN_VERSION=0.1.48" >> $GITHUB_ENV
166+
echo "AIKIDO_LIBZEN_VERSION=0.1.60" >> $GITHUB_ENV
167167
168168
- name: Download artifacts
169169
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"AIKIDO_BLOCK": "1",
3+
"AIKIDO_LOCALHOST_ALLOWED_BY_DEFAULT": "0",
4+
"AIKIDO_FEATURE_COLLECT_API_SCHEMA": "1"
5+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
$pdo = new PDO("sqlite::memory:");
4+
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
5+
$pdo->exec("CREATE TABLE IF NOT EXISTS users (
6+
id INTEGER PRIMARY KEY,
7+
name TEXT,
8+
email TEXT,
9+
status TEXT)");
10+
11+
$pdo->exec("INSERT INTO users (name, email, status) VALUES ('John Doe', 'john@example.com', 'active')");
12+
13+
$requestBody = file_get_contents('php://input');
14+
$data = json_decode($requestBody, true);
15+
16+
$stmt = $pdo->prepare("SELECT * FROM users WHERE name = :name AND email IS NOT NULL AND status NOT IN ('SUSPENDED', 'DELETED')");
17+
$stmt->execute(['name' => $data['name']]);
18+
19+
echo "Query executed!";
20+
21+
?>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"success": true,
3+
"serviceId": 1,
4+
"heartbeatIntervalInMS": 600000,
5+
"endpoints": [],
6+
"blockedUserIds": [],
7+
"allowedIPAddresses": [],
8+
"receivedAnyStats": true,
9+
"block": true
10+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import requests
2+
import time
3+
import sys
4+
from testlib import *
5+
6+
'''
7+
Checks that common SQL strings like "is not", "not in" etc. do not
8+
trigger false positive SQL injection detections.
9+
'''
10+
11+
def check_not_blocked(input):
12+
response = php_server_post("/testDetection", {"name": "John", "input": input})
13+
assert_response_code_is(response, 200)
14+
assert_response_body_contains(response, "Query executed!")
15+
16+
def run_test():
17+
check_not_blocked("is not")
18+
check_not_blocked("not in")
19+
check_not_blocked("TIME ZONE")
20+
check_not_blocked("IS NOT")
21+
check_not_blocked(":n")
22+
23+
if __name__ == "__main__":
24+
load_test_args()
25+
run_test()

0 commit comments

Comments
 (0)