Scan Report
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.
Safe to install
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.
Findings 4 items
| Severity | Finding | Location |
|---|---|---|
| Medium | exec-token.js executes arbitrary shell commands RCE | scripts/exec-token.js:58 |
| Low | env.js traverses project root looking for .env files Sensitive Access | scripts/env.js:31 |
| Info | inject-key.js --scan reads arbitrary files Sensitive Access | scripts/inject-key.js:59 |
| Info | copy-key.js writes real tokens to system clipboard Credential Theft | scripts/copy-key.js:62 |
| Resource | Declared | Inferred | Status | Evidence |
|---|---|---|---|---|
| Network | READ | READ | ✓ Aligned | All scripts (api.js, fetch-key.js, inject-key.js, copy-key.js, exec-token.js) ma… |
| Shell | WRITE | WRITE | ✓ Aligned | exec-token.js:28 — execSync(realCommand, {shell:true}) executes user-constructed… |
| Clipboard | WRITE | WRITE | ✓ Aligned | copy-key.js:62 — execSync(clipCmd, {input: fullKey}) writes token to system clip… |
| Filesystem | READ+WRITE | READ+WRITE | ✓ Aligned | inject-key.js reads and writes config files; env.js reads .env files from projec… |
| Environment | READ | READ | ✓ Aligned | env.js reads NEWAPI_BASE_URL, NEWAPI_ACCESS_TOKEN, NEWAPI_USER_ID from process.e… |
| Skill Invoke | READ | READ | ✓ Aligned | SKILL.md defines all actions and their invocation patterns; no undeclared cross-… |
| Database | NONE | NONE | — | No direct database access; all persistence is via New API REST API |
1 High 7 findings
High API Key 疑似硬编码凭证
api_key = "__NEWAPI_TOKEN_42__" docs/actions-config.md:53 Medium External URL 外部 URL
https://api.example.com/v1 docs/actions-config.md:55 Medium External URL 外部 URL
https://www.newapi.ai docs/help.md:13 Medium External URL 外部 URL
https://your-instance.com docs/help.md:37 Medium External URL 外部 URL
https://apifox.newapi.ai/llms.txt docs/help.md:63 Medium External URL 外部 URL
https://www.newapi.ai/llms.txt docs/help.md:64 Medium External URL 外部 URL
https://your-newapi-instance.com docs/setup.md:14 File Tree
14 files · 36.8 KB · 1063 lines 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
Dependencies 1 items
| Package | Version | Source | Known Vulns | Notes |
|---|---|---|---|---|
none | N/A | none | No | Zero external dependencies — scripts use only native Node.js/Bun/Deno APIs (fs, path, child_process, fetch) |
Security Positives
✓ 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