Skip to content

Commit 6d1b2a6

Browse files
committed
Optimize regular expression
for detecting numbers and comma-separated list of numbers.
1 parent 48b1200 commit 6d1b2a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/aikido/zen/scanners/sql_injection_scanner.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def attack?
6868
return false if /\A[[:alnum:]_]+\z/i.match?(@input)
6969

7070
# If the input is a comma-separated list of numbers, ignore it.
71-
return false if /\A(?:\d+(?:,\s*)?)+\z/i.match?(@input)
71+
return false if /\A[\s,]*\d[\s,\d]*\z/.match?(@input)
7272

7373
Internals.detect_sql_injection(@query, @input, @dialect)
7474
rescue => err

0 commit comments

Comments
 (0)