Find the holes before someone else does. A fast, 100% Rust vulnerability scanner: XSS, SQL injection, leaked secrets, dependency CVEs and AI agent setups.
Rust ai-agentsclaude-codeclaude-code-pluginclicodexcursordevsecopsmcposvowasprustsastsecret-scanningsecretssecuritysecurity-scannersql-injectionvulnerabilityvulnerability-scannerxss
fix(secrets): detect Sentry token after escaped whitespace (issue #218) (#225)
Alima59b8da83cc78
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 87c6f79..98af469 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -2,6 +2,9 @@## Unreleased+- Secrets: `secret.sentry-token` now reports a token that comes right after an escaped newline,+ tab or carriage return in a quoted string (`"line\nsntryu_..."`), as the OpenRouter and New+ Relic rules already did.- Dependencies: a binary `bun.lockb` is no longer named when a text `bun.lock` sits beside it inthe same folder; the text lockfile was already read, so the old binary one is not an uncheckeddependency.diff --git a/src/rules/secrets.rs b/src/rules/secrets.rsindex b389de3..e8d810f 100644--- a/src/rules/secrets.rs+++ b/src/rules/secrets.rs@@ -440,7 +440,7 @@ pub static RULES: &[Rule] = &[secret!("secret.sentry-token",Critical,- r"\bsntryu_[0-9a-f]{64}\b",+ r"(?:\\[nrt]|\b)(sntryu_[0-9a-f]{64})\b","A Sentry user auth token is written in the file."),secret!(diff --git a/tests/fixtures/secrets/EXPECTED b/tests/fixtures/secrets/EXPECTEDindex ce056b5..b45874a 100644--- a/tests/fixtures/secrets/EXPECTED+++ b/tests/fixtures/secrets/EXPECTED@@ -80,3 +80,4 @@ config.py:114 secret.newrelic-keyconfig.py:115 secret.flyio-tokenconfig.py:117 secret.flyio-tokenconfig.py:118 secret.openrouter-key+config.py:119 secret.sentry-tokendiff --git a/tests/fixtures/secrets/config.py b/tests/fixtures/secrets/config.pyindex 5b54b73..9375133 100644--- a/tests/fixtures/secrets/config.py+++ b/tests/fixtures/secrets/config.py@@ -116,3 +116,4 @@ flyio = "{{fake:flyio}}"flyio_lookalike = "{{fake:flyio-short}} my{{fake:flyio}} {{fake:flyio}}a"flyio_escaped = "line\\n{{fake:flyio}}"openrouter_escaped = "line\\n{{fake:openrouter}}"+sentry_escaped = "line\\n{{fake:sentry}}"