Skip to content

Find the holes before someone else does. A fast, 100% Rust vulnerability scanner: XSS, SQL injection, leaked secrets, dependency CVEs and AI agent setups.

Detect Sentry, Supabase, Grafana and Doppler tokens (#144)

Prashantdbf8080ee665
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2930a48..0c9d502 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -32,6 +32,10 @@
`curl` and `wget` aliases, match in any case, so `irm https://... | iex` is reported.
- Build: the pinned `cookie` (0.18.3) and `time` (0.3.47) crates are updated for RUSTSEC-2026-0594 and
RUSTSEC-2026-0009. Neither was reachable from a scan.
+- Secrets: four new critical rules. `secret.sentry-token` finds Sentry user auth tokens (`sntryu_` and 64
+ lowercase hex), `secret.supabase-token` Supabase access tokens (`sbp_` and 40 lowercase hex),
+ `secret.grafana-token` Grafana service account tokens (`glsa_`, 32 letters or digits, `_`, 8 hex) and
+ `secret.doppler-token` Doppler personal tokens (`dp.pt.` and 43 letters or digits).
## 1.1.0 (2026-11-25)
diff --git a/README.md b/README.md
index 85a2449..08ffe6a 100644
--- a/README.md
+++ b/README.md
@@ -20,7 +20,7 @@ Every finding comes with the line, the reason and the fix.</p>
<a href="https://github.com/erkamyaman/safe-anything"><img src="https://img.shields.io/github/stars/erkamyaman/safe-anything?style=social" alt="GitHub stars"></a>
</p>
-<p align="center"><b><a href="#quick-start">Install</a></b> · <a href="https://github.com/erkamyaman/safe-anything/releases">Releases</a> · <a href="#for-ai-agents">Claude Code plugin</a> · <a href="#in-ci">GitHub Action</a> · <a href="docs/rules.md">All 95 rules</a> · <a href="docs/agent-setups.md">Agent setups</a><br>
+<p align="center"><b><a href="#quick-start">Install</a></b> · <a href="https://github.com/erkamyaman/safe-anything/releases">Releases</a> · <a href="#for-ai-agents">Claude Code plugin</a> · <a href="#in-ci">GitHub Action</a> · <a href="docs/rules.md">All 99 rules</a> · <a href="docs/agent-setups.md">Agent setups</a><br>
Made in Türkiye 🇹🇷 by <a href="https://github.com/erkamyaman">erKam Yaman</a>, who also made <a href="https://github.com/erkamyaman/rust-anything">rust-anything</a> · <a href="https://github.com/sponsors/erkamyaman">❤️ Sponsor me</a> · Sponsored by <a href="https://coderabbit.link/er-kam">CodeRabbit</a></p>
<p align="center">
@@ -105,13 +105,13 @@ it hides that finding.
## What it finds
-95 rules, each with a CWE id, an OWASP category and a link to the OWASP page that explains it.
+99 rules, each with a CWE id, an OWASP category and a link to the OWASP page that explains it.
The full list is in [docs/rules.md](docs/rules.md).
| | |
| --- | --- |
| **Code** | SQL injection, command injection, XSS (`innerHTML`, `dangerouslySetInnerHTML`, `v-html`, `echo $_GET`, `raw`), `eval` and `new Function`, path traversal, file inclusion from request input, SSRF, open redirects, unsafe deserialization (pickle, `yaml.load`, `ObjectInputStream`, `BinaryFormatter`, `unserialize`, `Marshal`), TLS checks turned off, MD5/SHA-1, DES/RC4/ECB, JWT `none`, template injection, CORS `*`, debug mode, insecure cookies, `Math.random` tokens, `GRANT ALL` and plain-text passwords in SQL files. JS/TS, Python, Go, Java, Kotlin, PHP, Ruby, C#, SQL |
-| **Secrets** | AWS (key ids and secret access keys), GitHub, GitLab, Slack, Stripe, Shopify, npm, PyPI, OpenAI, Anthropic, Groq, Google, Hugging Face, Mailgun, SendGrid, Telegram, DigitalOcean, Twilio, Linear, Postman and Pulumi keys, Google OAuth client secrets, Slack and Discord webhook URLs, private keys (also inside service-account JSON), passwords in code, credentials in connection strings, committed `.env` files, real values in `.env.example`, a `.gitignore` that misses `.env`, secrets behind public prefixes (`NEXT_PUBLIC_`, `VITE_`, `EXPO_PUBLIC_`) that ship in the client bundle |
+| **Secrets** | AWS (key ids and secret access keys), GitHub, GitLab, Slack, Stripe, Shopify, npm, PyPI, OpenAI, Anthropic, Groq, Google, Hugging Face, Mailgun, SendGrid, Telegram, DigitalOcean, Twilio, Linear, Postman, Pulumi, Sentry, Supabase, Grafana and Doppler keys, Google OAuth client secrets, Slack and Discord webhook URLs, private keys (also inside service-account JSON), passwords in code, credentials in connection strings, committed `.env` files, real values in `.env.example`, a `.gitignore` that misses `.env`, secrets behind public prefixes (`NEXT_PUBLIC_`, `VITE_`, `EXPO_PUBLIC_`) that ship in the client bundle |
| **Agent setups** | `bypassPermissions` and `--dangerously-skip-permissions`, pre-approved `Bash`, `enableAllProjectMcpServers`, MCP servers run with unpinned `npx`/`uvx`/`docker`, MCP tokens in plain text, remote MCP over `http://`, `curl \| sh` in hooks and skills, prompt-injection text, skills that read `~/.ssh` or cloud credentials, invisible Unicode in instructions. [More](docs/agent-setups.md) |
| **Mobile** | Android `debuggable`, `allowBackup`, cleartext traffic, exported content providers, WebView file access and JS bridges, world-readable files; iOS ATS turned off; tokens in UserDefaults, SharedPreferences, AsyncStorage or localStorage |
| **Config** | Docker (unpinned base, root, secrets in `ENV`, `ADD <url>`), `curl \| sh` in scripts, Dockerfiles and workflow `run:` steps, GitHub Actions (`pull_request_target`, `write-all`, actions on `@main`, script injection from PR titles), privileged containers, `hostNetwork`, Terraform (open ingress, public buckets, S3 public access blocks turned off, public or unencrypted databases), nginx autoindex, TLS 1.0/1.1 |
@@ -195,7 +195,7 @@ lockfile listed under Dependencies. Nothing is executed. The only network call i
names and versions to OSV.dev ([privacy](docs/privacy.md)).
It finds known patterns; it does not trace data through your program. A clean scan means none of
-these 95 problems were found, not that the code is safe. [Design notes](docs/adr).
+these 99 problems were found, not that the code is safe. [Design notes](docs/adr).
## Credits
diff --git a/docs/assets/social.html b/docs/assets/social.html
index e8ae9d6..94e759e 100644
--- a/docs/assets/social.html
+++ b/docs/assets/social.html
@@ -31,7 +31,7 @@
<p class="sub">Code, secrets, mobile, cloud config, dependencies, and the AI agent setup that writes it all. One command.</p>
<div class="stats">
<div class="stat"><b>&lt;0.1 s</b><small>for 1,195 files (Juice Shop, M4)</small></div>
- <div class="stat"><b>95 rules</b><small>with CWE and OWASP ids</small></div>
+ <div class="stat"><b>99 rules</b><small>with CWE and OWASP ids</small></div>
<div class="stat"><b>100% Rust</b><small>one binary, no runtime</small></div>
</div>
</div>
diff --git a/docs/rules.md b/docs/rules.md
index ec0fe9d..40c9185 100644
--- a/docs/rules.md
+++ b/docs/rules.md
@@ -32,7 +32,7 @@ Every rule safe-anything checks, generated from `safe-anything --list-rules --js
| [`code.sql-grant-all`](https://cheatsheetseries.owasp.org/cheatsheets/Database_Security_Cheat_Sheet.html) | medium | [CWE-250](https://cwe.mitre.org/data/definitions/250.html) | A01:2021 Broken Access Control | A database user gets every privilege on every database. |
| [`code.sql-plaintext-password`](https://cheatsheetseries.owasp.org/cheatsheets/Database_Security_Cheat_Sheet.html) | medium | [CWE-798](https://cwe.mitre.org/data/definitions/798.html) | A07:2021 Identification and Authentication Failures | A database password is written in a SQL file. |
-## Secrets (32)
+## Secrets (36)
| Rule | Severity | CWE | OWASP | What it means |
| --- | --- | --- | --- | --- |
@@ -61,6 +61,10 @@ Every rule safe-anything checks, generated from `safe-anything --list-rules --js
| [`secret.twilio-api-key`](https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html) | critical | [CWE-798](https://cwe.mitre.org/data/definitions/798.html) | A07:2021 Identification and Authentication Failures | A Twilio API key is written in the file. |
| [`secret.linear-api-key`](https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html) | critical | [CWE-798](https://cwe.mitre.org/data/definitions/798.html) | A07:2021 Identification and Authentication Failures | A Linear API key is written in the file. |
| [`secret.postman-api-key`](https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html) | critical | [CWE-798](https://cwe.mitre.org/data/definitions/798.html) | A07:2021 Identification and Authentication Failures | A Postman API key is written in the file. |
+| [`secret.sentry-token`](https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html) | critical | [CWE-798](https://cwe.mitre.org/data/definitions/798.html) | A07:2021 Identification and Authentication Failures | A Sentry user auth token is written in the file. |
+| [`secret.supabase-token`](https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html) | critical | [CWE-798](https://cwe.mitre.org/data/definitions/798.html) | A07:2021 Identification and Authentication Failures | A Supabase access token is written in the file. |
+| [`secret.grafana-token`](https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html) | critical | [CWE-798](https://cwe.mitre.org/data/definitions/798.html) | A07:2021 Identification and Authentication Failures | A Grafana service account token is written in the file. |
+| [`secret.doppler-token`](https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html) | critical | [CWE-798](https://cwe.mitre.org/data/definitions/798.html) | A07:2021 Identification and Authentication Failures | A Doppler personal token is written in the file. |
| [`secret.private-key`](https://cheatsheetseries.owasp.org/cheatsheets/Key_Management_Cheat_Sheet.html) | critical | [CWE-321](https://cwe.mitre.org/data/definitions/321.html) | A02:2021 Cryptographic Failures | A private key is stored in the repository. |
| [`secret.hardcoded-password`](https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html) | high | [CWE-798](https://cwe.mitre.org/data/definitions/798.html) | A07:2021 Identification and Authentication Failures | A password or secret is written in the code. |
| [`secret.url-credentials`](https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html) | high | [CWE-798](https://cwe.mitre.org/data/definitions/798.html) | A07:2021 Identification and Authentication Failures | A connection string carries a username and password. |
diff --git a/src/rules/secrets.rs b/src/rules/secrets.rs
index b7cc869..1456661 100644
--- a/src/rules/secrets.rs
+++ b/src/rules/secrets.rs
@@ -337,6 +337,30 @@ pub static RULES: &[Rule] = &[
r"\bPMAK-[0-9a-fA-F]{24}-[0-9a-fA-F]{34}\b",
"A Postman API key is written in the file."
),
+ secret!(
+ "secret.sentry-token",
+ Critical,
+ r"\bsntryu_[0-9a-f]{64}\b",
+ "A Sentry user auth token is written in the file."
+ ),
+ secret!(
+ "secret.supabase-token",
+ Critical,
+ r"\bsbp_[0-9a-f]{40}\b",
+ "A Supabase access token is written in the file."
+ ),
+ secret!(
+ "secret.grafana-token",
+ Critical,
+ r"\bglsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8}\b",
+ "A Grafana service account token is written in the file."
+ ),
+ secret!(
+ "secret.doppler-token",
+ Critical,
+ r"\bdp\.pt\.[A-Za-z0-9]{43}\b",
+ "A Doppler personal token is written in the file."
+ ),
secret!(
"secret.private-key",
Critical,
diff --git a/tests/common/mod.rs b/tests/common/mod.rs
index 0426f4b..b11a496 100644
--- a/tests/common/mod.rs
+++ b/tests/common/mod.rs
@@ -116,6 +116,10 @@ pub fn fake(name: &str) -> String {
.to_uppercase(),
"pulumi-token" => ["pu", "l-", &body(40, HEX)].concat(),
"pulumi-upper" => ["pu", "l-", &body(40, HEX).to_uppercase()].concat(),
+ "sentry" => ["sntr", "yu_", &body(64, HEX)].concat(),
+ "supabase" => ["sb", "p_", &body(40, HEX)].concat(),
+ "grafana" => ["gl", "sa_", &body(32, MIXED), "_", &body(8, HEX)].concat(),
+ "doppler" => ["dp", ".pt.", &body(43, MIXED)].concat(),
other => panic!("no fake value named {other}"),
}
}
diff --git a/tests/fixtures/secrets/EXPECTED b/tests/fixtures/secrets/EXPECTED
index 517b812..babeca6 100644
--- a/tests/fixtures/secrets/EXPECTED
+++ b/tests/fixtures/secrets/EXPECTED
@@ -51,3 +51,7 @@ config.py:61 secret.linear-api-key
config.py:63 secret.postman-api-key
config.py:65 secret.postman-api-key
config.py:66 secret.pulumi-token
+config.py:68 secret.sentry-token
+config.py:70 secret.supabase-token
+config.py:72 secret.grafana-token
+config.py:74 secret.doppler-token
diff --git a/tests/fixtures/secrets/config.py b/tests/fixtures/secrets/config.py
index 0bc2d1c..5208533 100644
--- a/tests/fixtures/secrets/config.py
+++ b/tests/fixtures/secrets/config.py
@@ -65,3 +65,11 @@ postman_lookalike = "PMAK-abc-def"
postman_upper = "{{fake:postman-upper}}"
pulumi = "{{fake:pulumi-token}}"
pulumi_lookalike = "pul-0123abcd {{fake:pulumi-upper}}"
+sentry = "{{fake:sentry}}"
+sentry_short = "sntryu_abc123"
+supabase = "{{fake:supabase}}"
+supabase_short = "sbp_abc123"
+grafana = "{{fake:grafana}}"
+grafana_short = "glsa_abc123_abcd1234"
+doppler = "{{fake:doppler}}"
+doppler_short = "dp.pt.abc123"