最近推送 2026-11-28 02:29(4 天前),属于活跃维护
erkamyaman/safe-anything
GITHUB中文整理主语言 Rust · 831 星 · MIT · 创建于 2026-11-23
一个用 Rust 编写的命令行漏洞扫描工具,在代码库中查找安全漏洞、泄露密钥、依赖项 CVE 以及 AI 代理配置风险。
仓库健康度
5 个维度开放 Issue 49 个 · Fork 95 个
24 小时 +0 · 7 日 +215 · 30 日 积累中
许可证 MIT · 12 个 topics · 开了 Wiki
这一项暂无数据,不代表项目没有发布
「证据不足」表示这项数据暂时没有取到,不能读成「项目有问题」;「部分数据」表示只拿到一部分信号。版本发布要额外调 Releases 接口,下一版补。
Star 趋势
9 天记录横轴 2026-11-24 → 2026-12-02,纵轴按这段时间的最小/最大值拉伸。趋势来自站内每天记录一次的星数,页面打开时不会实时请求 GitHub。
它解决什么问题
据 README 归纳开发者在代码提交或部署前很难快速发现常见安全问题,如 XSS、SQL 注入、硬编码密钥等,如果没有这类工具,这些问题可能被带到生产环境,增加被攻击的风险。
核心能力
6 条- 1扫描代码中的 SQL 注入、命令注入、XSS、路径遍历等漏洞
- 2检测云服务密钥、令牌、私钥和 .env 文件中的敏感信息
- 3检查 Android 和 iOS 应用的安全配置风险
- 4分析 Docker、GitHub Actions、Kubernetes 等基础设施配置
- 5对比锁文件中的依赖版本与 OSV.dev 数据库发现已知漏洞
- 6审查 AI 代理(如 MCP 服务器、Claude Code 等)的配置安全性
项目画像
6 个角度项目定位
一个用 Rust 编写的命令行漏洞扫描工具,在代码库中查找安全漏洞、泄露密钥、依赖项 CVE 以及 AI 代理配置风险。
适合谁
开发人员、安全工程师或 DevOps 团队,在代码提交前或 CI 流程中自动检查安全漏洞,也适合审查 AI 代理配置的场景。
典型场景
在 Git 提交前运行扫描,发现并修复代码中的注入漏洞或泄露的密钥;集成到 CI 流水线中,当发现高危问题时自动失败以阻止合并;检查移动应用配置中是否开启了调试模式或明文传输等不安全选项;审查 AI 代理的 MCP 服务器配置,避免使用不安全的启动方式或明文令牌
部署难度
安装 Rust 后可通过 cargo install safe-anything 安装,或使用 npx safe-anything;无需配置文件,直接在项目目录运行命令即可,退出码可用于 CI 判断。
风险限制
只识别已知模式,不会追踪数据流;扫描结果干净仅表示未发现预设的 74 个问题,不代表代码绝对安全;依赖检查需要联网访问 OSV.dev;默认跳过测试文件中的部分密钥检测。
最近维护
最近一次推送是 2026-11-28 02:29。 实现方式:对仓库进行并行遍历,每个文件只读取一次,并用编译好的正则表达式匹配规则;对于无法简单判断的模式,会解析文件内容(如 MCP 配置、Dockerfile 和锁文件);依赖检查通过向 OSV.dev 发送包名和版本进行网络查询,不执行任何代码。
README 原文细节
3 个板块怎么安装从零跑起来的步骤
Quick start
That's it. No config, no account, no upload. It exits with 1 when something high or critical is found, so it works as a pre-commit or CI check as is.
- .gitignore is respected, and nodemodules, vendor, target, dist, build, virtualenvs
- and .claude/worktrees are skipped. List more paths in .safe-anything-ignore.
- safe-anything:ignore in a comment silences that line (or the next one).
- In tests, specs and fixtures only real provider keys and private keys count, unless you pass
- --include-tests.
cargo install safe-anything # or: npx safe-anything .
safe-anything .
实现原理它内部是怎么做的
How it works
One parallel walk over the repository (the ignore crate, the walker behind ripgrep), one read per file, and every rule that applies run as a compiled regex. Where a pattern can't tell right from wrong, the file is parsed: MCP configs as JSON with comments, Dockerfile stages, ten lockfile formats. Nothing is executed. The only network call is the dependency check, which sends package names and versions to OSV.dev (privacy).
It finds known patterns; it does not trace data through your program. A clean scan means none of these 74 problems were found, not that the code is safe. Design notes.
其它说明README 里剩下的内容
What it finds
74 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.
Of the 73 Next.js examples that come with env files, scanned one by one, the env checks flag one: a password behind NEXTPUBLIC.
- Code — SQL injection, command injection, XSS (innerHTML, dangerouslySetInnerHTML, v-html, echo $GET, raw), eval and new Function, path traversal, SSRF, unsafe deserialization (pickle, yaml.load, Objec
- Secrets — AWS, GitHub, Slack, Stripe, OpenAI, Anthropic and Google keys, private keys, passwords in code, credentials in connection strings, committed .env files, real values in .env.example, a .gitig
- Agent setups — bypassPermissions and --dangerously-skip-permissions, pre-approved Bash, MCP servers run with unpinned npx/uvx/docker, MCP tokens in plain text, remote MCP over http://, `curl \ — sh in
- Mobile — Android debuggable, cleartext traffic, exported content providers, WebView file access and JS bridges, world-readable files; iOS ATS turned off; tokens in UserDefaults, SharedPreferences, Asy
- Config — Docker (unpinned base, root, secrets in ENV, ADD ), GitHub Actions (pullrequesttarget, write-all, actions on @main, script injection from PR titles), privileged containers, hostNetwork, open
- Dependencies — every locked version in package-lock.json, yarn.lock, pnpm-lock.yaml, Cargo.lock, requirements.txt, poetry.lock, uv.lock, go.mod, Gemfile.lock, composer.lock and pubspec.lock, checked a
Measured
Release build on an Apple M4, --offline, 2026-11-22. Every finding was read by hand. Times are the scan's own report; the same scan took 0.03 to 0.13 s depending on what else the machine was doing.
Quiet on good code: expressjs/express, 216 files, no findings.
The noisiest rule is code.xss-inner-html: it fires on any HTML built from a variable, and most of those in local tooling are not reachable by an attacker. It stays on, because real XSS looks the same. Status per family: docs/STATUS.md.
- OWASP Juice Shop (vulnerable on purpose) — 1,195 — 67 — the login and search SQL injections, the eval challenges, MD5 passwords, tokens in localStorage, seeded passwords, open Terraform ingress; 2 to
- DVWA (vulnerable on purpose) — 233 — 63 — the SQL injections, command injections, MD5 passwords and eval; about 4 false positives (setup-script inserts, input validated in the "impossible" level)
- expressjs/express — 216 — 0
- pallets/flask — 231 — 2 — both false positives in practice: eval of the user's own shell startup file, SHA-1 for key derivation (reported as low)
- modelcontextprotocol/servers — 439 — 1 — pullrequesttarget in a workflow, worth a look
- anthropics/skills — 392 — 6 — innerHTML in local review pages (5), shell=True in a script that runs commands by design
- vercel-labs/agent-skills — 439 — 0
- rust-anything — 3,134 — 6 — innerHTML in GIF demo pages (5), an action on @master
- safe-anything itself — 53 — 0 — checked in CI on every push
概述
Find the holes before someone else does. One command finds XSS, SQL injection and other vulnerabilities in your code, leaked secrets, risky mobile and cloud config, vulnerable dependencies, and the AI agent setup that writes it all. Every finding comes with the line, the reason and the fix.
A real run on OWASP Juice Shop and on an agent setup with the usual mistakes (Apple M4). What it finds on other repositories.
Your code SQL and command injection, XSS, eval, SSRF, path traversal, unsafe deserialization, weak crypto. Nine languages and SQL. Your secrets Cloud and AI keys, tokens, private keys, passwords, and .env mistakes: committed env files, real values in .env.example, secrets behind NEXTPUBLIC or VITE. Always redacted in the output. Your stack Android and iOS settings, Docker, GitHub Actions, Kubernetes, Terraform, nginx, and every locked dependency against OSV.dev. Your agent MCP servers, Claude Code, Codex, Cursor, Gemini and OpenCode settings, hooks and skills: the files that decide what your a
关于 safe-anything 的常见问题
7 个问题safe-anything 是做什么的?
一个用 Rust 编写的命令行漏洞扫描工具,在代码库中查找安全漏洞、泄露密钥、依赖项 CVE 以及 AI 代理配置风险。 开发者在代码提交或部署前很难快速发现常见安全问题,如 XSS、SQL 注入、硬编码密钥等,如果没有这类工具,这些问题可能被带到生产环境,增加被攻击的风险。
safe-anything 有哪些功能?
核心能力:扫描代码中的 SQL 注入、命令注入、XSS、路径遍历等漏洞;检测云服务密钥、令牌、私钥和 .env 文件中的敏感信息;检查 Android 和 iOS 应用的安全配置风险;分析 Docker、GitHub Actions、Kubernetes 等基础设施配置;对比锁文件中的依赖版本与 OSV.dev 数据库发现已知漏洞;审查 AI 代理(如 MCP 服务器、Claude Code 等)的配置安全性。
safe-anything 适合谁用?
开发人员、安全工程师或 DevOps 团队,在代码提交前或 CI 流程中自动检查安全漏洞,也适合审查 AI 代理配置的场景。
safe-anything 是怎么工作的?
对仓库进行并行遍历,每个文件只读取一次,并用编译好的正则表达式匹配规则;对于无法简单判断的模式,会解析文件内容(如 MCP 配置、Dockerfile 和锁文件);依赖检查通过向 OSV.dev 发送包名和版本进行网络查询,不执行任何代码。
怎么安装 safe-anything?
按项目 README 的说明:.gitignore is respected, and nodemodules, vendor, target, dist, build, virtualenvs;and .claude/worktrees are skipped. List more paths in .safe-anything-ignore.;safe-anything:ignore in a comment silences that line (or the next one).;In tests, specs and fixtures only real provider keys and private keys count, unless you pass。完整命令见下方「怎么安装」一节或 GitHub 仓库的 README。
用 safe-anything 有什么门槛或限制?
只识别已知模式,不会追踪数据流;扫描结果干净仅表示未发现预设的 74 个问题,不代表代码绝对安全;依赖检查需要联网访问 OSV.dev;默认跳过测试文件中的部分密钥检测。
safe-anything 现在还在维护吗?数据怎么样?
目前 831 星,95 个 Fork,主语言 Rust,创建于 2026-11-23,最近一次推送 2026-11-28 02:29,许可证 MIT。星数、Fork、推送时间都是 GitHub 返回的实时数据,「最近推送」离现在越近说明越活跃;长期不动要留意是否已停止维护。
这些内容来自哪
读法说明项目数据取自 GitHub 官方接口与项目 README;星数、Fork、语言与时间以 GitHub 页面为准,档案更新于 2026-11-24 11:06。