From a6d68edb1657b7ea24654c5d5db17a63f1f014ec Mon Sep 17 00:00:00 2001 From: Brendan-Lim <121050815+Brendan-Lim@users.noreply.github.com> Date: Sun, 22 Nov 2026 00:49:31 +0800 Subject: [PATCH] fix: stop matching sk- keys inside longer words in the publication audit --- scripts/audit-public-files.py | 2 +- scripts/tests/test_publication_audit.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/audit-public-files.py b/scripts/audit-public-files.py index e447df2..f77f0f7 100644 --- a/scripts/audit-public-files.py +++ b/scripts/audit-public-files.py @@ -12,7 +12,7 @@ ROOT = Path(__file__).resolve().parents[1] MAX_BLOB = 32 * 1024 * 1024 CREDENTIALS = [ - re.compile(rb'(?:gh[pousr]_[A-Za-z0-9_]{20,}|github_pat_[A-Za-z0-9_]{20,}|sk-[A-Za-z0-9_-]{20,}|AKIA[A-Z0-9]{16}|AIza[A-Za-z0-9_-]{30,}|xox[baprs]-[A-Za-z0-9-]{15,})'), + re.compile(rb'(?:gh[pousr]_[A-Za-z0-9_]{20,}|github_pat_[A-Za-z0-9_]{20,}|(?