safe-anything 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -20,8 +20,8 @@ Every finding comes with the line, the reason and the fix.</p>
20
20
  <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>
21
21
  </p>
22
22
 
23
- <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 92 rules</a> · <a href="docs/agent-setups.md">Agent setups</a><br>
24
- 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>
23
+ <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 110 rules</a> · <a href="docs/agent-setups.md">Agent setups</a><br>
24
+ 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> and <a href="https://www.atakdomain.com/">Atak Domain</a></p>
25
25
 
26
26
  <p align="center">
27
27
  <img src="docs/assets/terminal.gif" alt="safe-anything scans OWASP Juice Shop: 1,195 files in 0.03 s, 67 findings including the SQL injection in routes/login.ts, eval in routes/userProfile.ts, seeded passwords and a token in localStorage. Then it scans an AI agent setup: a GitHub token in .mcp.json, bypassPermissions, pre-approved Bash, curl piped to sh in a hook, a skill that reads ~/.ssh, invisible Unicode, unpinned MCP servers." width="820">
@@ -77,7 +77,8 @@ safe-anything --list-rules
77
77
  - folders `.git`, `node_modules`, `target`, `vendor`, `dist`, `build`, `.next`, `.venv`, `venv`,
78
78
  `__pycache__`, `Pods`, `.gradle` and `.claude/worktrees`, so generated code in `build/` is
79
79
  not checked
80
- - any file over 2 MB, lockfiles included, so a lockfile that large gets no dependency check
80
+ - any file over 2 MB. Lockfiles are read up to 64 MB, for the dependency check only (no code rules
81
+ past 2 MB); a larger one is named in the report as not checked
81
82
  - `*.min.js`, `*.map`, `*.jsonl` and `*.log`
82
83
  - binary files: images, fonts, archives, media and compiled files by their extension (`.png`, `.woff2`,
83
84
  `.zip`, `.mp4`, `.class`, ...), and any other file with a zero byte in its first 8 KB. A text file
@@ -104,17 +105,17 @@ it hides that finding.
104
105
 
105
106
  ## What it finds
106
107
 
107
- 92 rules, each with a CWE id, an OWASP category and a link to the OWASP page that explains it.
108
+ 110 rules, each with a CWE id, an OWASP category and a link to the OWASP page that explains it.
108
109
  The full list is in [docs/rules.md](docs/rules.md).
109
110
 
110
111
  | | |
111
112
  | --- | --- |
112
- | **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 |
113
- | **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 and Twilio 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 |
113
+ | **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, Scala, PHP, Ruby, C#, SQL |
114
+ | **Secrets** | AWS (key ids and secret access keys), GitHub, GitLab, Slack, Stripe, Shopify, npm, PyPI, RubyGems, Docker Hub, OpenAI, Anthropic, Groq, Google, Hugging Face, Mailgun, SendGrid, Telegram, DigitalOcean, Heroku, Fly.io, Databricks, Perplexity, OpenRouter, Notion, Twilio, Linear, Prefect, Postman, Pulumi, Sentry, New Relic, Supabase, Grafana and Doppler keys, Google OAuth client secrets, Slack and Discord webhook URLs, private keys (also inside service-account JSON) and age keys, 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 |
114
115
  | **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) |
115
116
  | **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 |
116
117
  | **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 |
117
- | **Dependencies** | every locked version in `package-lock.json`, `npm-shrinkwrap.json`, `yarn.lock`, `pnpm-lock.yaml`, `Cargo.lock`, `requirements*.txt`, `poetry.lock`, `uv.lock`, `pdm.lock`, `Pipfile.lock`, `go.mod`, `Gemfile.lock`, `composer.lock` and `pubspec.lock`, checked against [OSV.dev](https://osv.dev), with the nearest fixed version |
118
+ | **Dependencies** | every locked version in `package-lock.json`, `npm-shrinkwrap.json`, `yarn.lock`, `pnpm-lock.yaml`, `bun.lock`, `Cargo.lock`, `requirements*.txt`, `poetry.lock`, `uv.lock`, `pdm.lock`, `Pipfile.lock`, `go.mod`, `Gemfile.lock`, `composer.lock` and `pubspec.lock`, checked against [OSV.dev](https://osv.dev), with the nearest fixed version |
118
119
 
119
120
  <p align="center">
120
121
  <img src="docs/assets/nextjs-public-env.gif" alt="safe-anything on the with-mqtt-js example from the Next.js repository: 2 high findings, an MQTT password read from a NEXT_PUBLIC_ variable in app/page.tsx and environment.d.ts, which Next.js ships in the client bundle." width="820">
@@ -145,7 +146,7 @@ Tools: `scan` (path, offline, severity, include_tests) and `list_rules`. The ski
145
146
  ## In CI
146
147
 
147
148
  ```yaml
148
- - uses: erkamyaman/safe-anything@v1.1.0
149
+ - uses: erkamyaman/safe-anything@v1.2.0
149
150
  with:
150
151
  fail-on: high
151
152
  # baseline: .safe-anything-baseline.json # fail only on findings not in it
@@ -194,7 +195,7 @@ lockfile listed under Dependencies. Nothing is executed. The only network call i
194
195
  names and versions to OSV.dev ([privacy](docs/privacy.md)).
195
196
 
196
197
  It finds known patterns; it does not trace data through your program. A clean scan means none of
197
- these 92 problems were found, not that the code is safe. [Design notes](docs/adr).
198
+ these 110 problems were found, not that the code is safe. [Design notes](docs/adr).
198
199
 
199
200
  ## Credits
200
201
 
@@ -227,6 +228,15 @@ these 92 problems were found, not that the code is safe. [Design notes](docs/adr
227
228
  </a>
228
229
  </p>
229
230
 
231
+ <p align="center">
232
+ <a href="https://www.atakdomain.com/">
233
+ <picture>
234
+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/sponsors/domain-dark.svg">
235
+ <img src="docs/assets/sponsors/domain-light.svg" width="800" alt="Domain sponsor: Atak Domain">
236
+ </picture>
237
+ </a>
238
+ </p>
239
+
230
240
  <p align="center">
231
241
  <a href="https://github.com/sponsors/erkamyaman">
232
242
  <picture>
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "safe-anything",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Find the holes before someone else does. One fast command scans code, secrets, mobile and cloud config, dependencies and AI agent setups. 100% Rust.",
5
5
  "keywords": [
6
6
  "security",