From 5e005cd6eebf338f8090f9a07bbc11d0b804ee88 Mon Sep 17 00:00:00 2001 From: RichardAH Date: Thu, 1 May 2025 09:54:41 +1000 Subject: [PATCH] remove false positives from sus pat finder (#506) --- suspicious_patterns.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/suspicious_patterns.sh b/suspicious_patterns.sh index 6010c2494..076c1a929 100755 --- a/suspicious_patterns.sh +++ b/suspicious_patterns.sh @@ -13,8 +13,8 @@ for file in $files_changed; do # Check if the file exists (it might have been deleted) if [ -f "$absolute_path" ]; then - # Search the file for the given patterns - grep_output=$(grep -n -E '(([^rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz]|^)(s|p)[rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz]{25,60}([^(]|$)))|([^A-Fa-f0-9](02|03|ED)[A-Fa-f0-9]{64})' "$absolute_path") + # Search the file for the given patterns, but exclude lines containing 'public_key' + grep_output=$(grep -n -E '(([^rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz]|^)(s|p)[rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz]{25,60}([^(]|$)))|([^A-Fa-f0-9](02|03|ED)[A-Fa-f0-9]{64})' "$absolute_path" | grep -v "public_key") # Check if grep found any matches if [ ! -z "$grep_output" ]; then @@ -25,7 +25,3 @@ for file in $files_changed; do fi fi done - -# If the loop completes without finding any suspicious patterns -echo "Success: No suspicious patterns found in the diff." -exit 0 \ No newline at end of file