Skip to content

Commit

Permalink
Merge pull request #442 from owasp-noir:fixed-440
Browse files Browse the repository at this point in the history
Fixed-440
  • Loading branch information
hahwul authored Nov 1, 2024
2 parents 439a861 + fc90c6f commit 02dfece
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/passive_scan/detect.cr
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,17 @@ module NoirPassiveScan
when "regex"
case matcher.condition
when "and"
begin
matcher.patterns && matcher.patterns.all? { |pattern| content.match(Regex.new(pattern.to_s)) }
rescue
false
end
when "or"
begin
matcher.patterns && matcher.patterns.any? { |pattern| content.match(Regex.new(pattern.to_s)) }
rescue
false
end
else
false
end
Expand Down

0 comments on commit 02dfece

Please sign in to comment.