Skip to content

Commit 12f0448

Browse files
committed
Use a LIKE test instead of equality
Fixes the ability to search for CVE (as well as other reference types) with a non-exact match [SeeRM rapid7#7989]
1 parent e7a1f06 commit 12f0448

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/msf/core/db_manager.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,11 +666,11 @@ def search_modules(search_string)
666666
formatted_values = value_set.collect { |value|
667667
prefix = keyword.upcase
668668

669-
"#{prefix}-#{value}"
669+
"#{prefix}-%#{value}%"
670670
}
671671

672672
query = query.includes(:refs)
673-
union_conditions << Mdm::Module::Ref.arel_table[:name].eq_any(formatted_values)
673+
union_conditions << Mdm::Module::Ref.arel_table[:name].matches_any(formatted_values)
674674
end
675675
end
676676

0 commit comments

Comments
 (0)