Skip to content

Commit 9ed83a6

Browse files
authored
Merge pull request Netflix-Skunkworks#243 from Netflix/bugfix/vuln-deduplication
loosen vuln deduplication matching to prevent edge cases
2 parents a2d4f24 + 0aa1e2b commit 9ed83a6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/helpers/vulnerability_helpers.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -424,14 +424,14 @@ def find_duplicate_vulnerability(vulnerability, options={})
424424
case vulnerability.match_location
425425
when "content"
426426
# This is a static analyzer match for content
427-
return existing_vulnerabilities.select{|v| v["url"] == vulnerability.url && v["code_fragment"] == vulnerability.code_fragment && v["term"] == vulnerability.term }
427+
return existing_vulnerabilities.select{|v| v["url"] == vulnerability.url && v["term"] == vulnerability.term }
428428
when "file"
429429
# This is a static analyzer match for file and github event monitor
430-
return existing_vulnerabilities.select{|v| v["file_name"] == vulnerability.file_name && v["code_fragment"] == vulnerability.code_fragment && v["term"] == vulnerability.term }
430+
return existing_vulnerabilities.select{|v| v["file_name"] == vulnerability.file_name && v["term"] == vulnerability.term }
431431
when "source_code"
432432
# This is a static analyzer match for any static analyzer which has
433433
# source_code_line, source_code_file, and type
434-
return existing_vulnerabilities.select{|v| v["source_code_file"] == vulnerability.source_code_file && v["source_code_line"] == vulnerability.source_code_line && v["type"] == vulnerability.type}
434+
return existing_vulnerabilities.select{|v| v["source_code_file"] == vulnerability.source_code_file && v["type"] == vulnerability.type}
435435
when "path"
436436
# This is a static analyzer match for paths
437437
return existing_vulnerabilities.select{|v| v["url"] == vulnerability.url && v["term"] == vulnerability.term}

0 commit comments

Comments
 (0)