扫描报告
22 /100
newapi
Assistant for newapi (new-api), an open-source unified AI gateway platform. Manages models, tokens, groups, and balances through secure token handling.
This is a legitimate New API token management skill with well-designed security controls; shell execution via exec-token is declared and scoped to token substitution, with no evidence of credential exfiltration or hidden malicious behavior.
可以安装
The skill is safe to use. The primary risk surface is exec-token's arbitrary command execution, which is intentional and documented. Audit whether users can be socially engineered into passing malicious commands through the placeholder substitution mechanism.
安全发现 4 项
| 严重性 | 安全发现 | 位置 |
|---|---|---|
| 中危 | exec-token.js executes arbitrary shell commands 代码执行 | scripts/exec-token.js:58 |
| 低危 | env.js traverses project root looking for .env files 敏感访问 | scripts/env.js:31 |
| 提示 | inject-key.js --scan reads arbitrary files 敏感访问 | scripts/inject-key.js:59 |
| 提示 | copy-key.js writes real tokens to system clipboard 凭证窃取 | scripts/copy-key.js:62 |
| 资源类型 | 声明权限 | 推断权限 | 状态 | 证据 |
|---|---|---|---|---|
| 网络访问 | READ | READ | ✓ 一致 | All scripts (api.js, fetch-key.js, inject-key.js, copy-key.js, exec-token.js) ma… |
| 命令执行 | WRITE | WRITE | ✓ 一致 | exec-token.js:28 — execSync(realCommand, {shell:true}) executes user-constructed… |
| 剪贴板 | WRITE | WRITE | ✓ 一致 | copy-key.js:62 — execSync(clipCmd, {input: fullKey}) writes token to system clip… |
| 文件系统 | READ+WRITE | READ+WRITE | ✓ 一致 | inject-key.js reads and writes config files; env.js reads .env files from projec… |
| 环境变量 | READ | READ | ✓ 一致 | env.js reads NEWAPI_BASE_URL, NEWAPI_ACCESS_TOKEN, NEWAPI_USER_ID from process.e… |
| 技能调用 | READ | READ | ✓ 一致 | SKILL.md defines all actions and their invocation patterns; no undeclared cross-… |
| 数据库 | NONE | NONE | — | No direct database access; all persistence is via New API REST API |
1 高危 7 项发现
高危 API 密钥 疑似硬编码凭证
api_key = "__NEWAPI_TOKEN_42__" docs/actions-config.md:53 中危 外部 URL 外部 URL
https://api.example.com/v1 docs/actions-config.md:55 中危 外部 URL 外部 URL
https://www.newapi.ai docs/help.md:13 中危 外部 URL 外部 URL
https://your-instance.com docs/help.md:37 中危 外部 URL 外部 URL
https://apifox.newapi.ai/llms.txt docs/help.md:63 中危 外部 URL 外部 URL
https://www.newapi.ai/llms.txt docs/help.md:64 中危 外部 URL 外部 URL
https://your-newapi-instance.com docs/setup.md:14 目录结构
14 文件 · 36.8 KB · 1063 行 JavaScript 7f · 604L
Markdown 7f · 459L
├─
▾
docs
│ ├─
actions-config.md
Markdown
│ ├─
actions-exec.md
Markdown
│ ├─
actions-query.md
Markdown
│ ├─
actions-token.md
⚠
Markdown
│ ├─
help.md
Markdown
│ └─
setup.md
Markdown
├─
▾
scripts
│ ├─
api.js
JavaScript
│ ├─
copy-key.js
JavaScript
│ ├─
env.js
JavaScript
│ ├─
exec-token.js
⚠
JavaScript
│ ├─
fetch-key.js
JavaScript
│ ├─
inject-key.js
JavaScript
│ └─
sanitize.js
JavaScript
└─
SKILL.md
Markdown
依赖分析 1 项
| 包名 | 版本 | 来源 | 已知漏洞 | 备注 |
|---|---|---|---|---|
none | N/A | none | 否 | Zero external dependencies — scripts use only native Node.js/Bun/Deno APIs (fs, path, child_process, fetch) |
安全亮点
✓ SKILL.md thoroughly documents all actions, capabilities, and security constraints — no documentation mismatch
✓ API keys are never printed to stdout/stderr — all key handling is in-memory via fetchTokenKey
✓ Token key substitution uses a well-defined placeholder pattern (__NEWAPI_TOKEN_{id}__) with validation
✓ Sanitization module (sanitize.js) provides regex-based redaction for sk- tokens, Bearer tokens, sensitive field values, and connection strings
✓ Atomic file writes in inject-key.js prevent partial overwrites of config files
✓ No external dependencies — zero-dependency scripts using native fetch/Node APIs reduce supply chain risk
✓ API responses are masked in api.js (keys shown as sk-xxxx**********xxxx)
✓ Security guidelines explicitly prohibit reading .env files, clipboard contents, or circumventing masking
✓ No base64-encoded payloads, no obfuscation, no anti-analysis patterns detected
✓ No attempts to access ~/.ssh, ~/.aws, or other sensitive system directories
✓ No curl|bash or wget|sh remote script execution patterns