Skip to content

Commit 5137042

Browse files
committed
Add tests
1 parent 6d1b2a6 commit 5137042

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

test/aikido/zen/scanners/sql_injection_scanner_test.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,18 @@ def refute_attack(query, input = query, *args)
249249
refute_attack "SELECT * FROM users_123", "users_123"
250250
end
251251

252-
test "ignores input that does not show up in the SQL query" do
252+
test "it ignores numbers" do
253+
refute_attack "SELECT * WHERE id = 123", "123"
254+
refute_attack "SELECT * WHERE id = 123 ", " 123 "
255+
end
256+
257+
test "it ignores comma-separated list of numbers" do
258+
refute_attack "SELECT * WHERE id IN (1,2,3)", "1,2,3"
259+
refute_attack "SELECT * WHERE id IN (1, 2, 3)", "1, 2, 3"
260+
refute_attack "SELECT * WHERE id IN (,1,,)", ",1,,"
261+
end
262+
263+
test "it ignores input that does not show up in the SQL query" do
253264
refute_attack "SELECT * FROM users WHERE id IN (1,2,3)", "1,2,3"
254265
refute_attack "SELECT * FROM users", "1,2,3"
255266
end

0 commit comments

Comments
 (0)