correctover-scan 1.5.0 → 1.7.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/LICENSE +21 -0
- package/README.md +115 -27
- package/core/bundle-scanner.js +775 -0
- package/core/license.js +40 -75
- package/core/report.js +191 -0
- package/core/scanner.js +0 -0
- package/index.js +353 -31
- package/package.json +27 -8
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Correctover
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,23 +1,45 @@
|
|
|
1
1
|
# correctover-scan
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
[](https://search.sigstore.dev/?logIndex=2697131671)
|
|
5
|
+
|
|
6
|
+
> Security scanner for MCP servers and AI agents — detects credential exposure, SSRF, command injection risk and missing auth across your MCP configuration. 14 checks mapped to OWASP AISVS 1.0. Run anywhere with `npx correctover-scan`.
|
|
4
7
|
|
|
5
8
|

|
|
6
|
-

|
|
9
|
+
 [](https://datatracker.ietf.org/doc/draft-correctover-ccs/)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
### Verifiable artifacts behind this tool
|
|
14
|
+
|
|
15
|
+
- **Third-party interoperability** — joint assessment merged into the [EMILIA protocol](https://github.com/emiliaprotocol/emilia-protocol/pull/693)
|
|
16
|
+
- **66 signed conformance test vectors** — reproducible by anyone: [ccs-conformance-vectors](https://github.com/DSHCorrectover/ccs-conformance-vectors)
|
|
17
|
+
- **Published methodology** — [Zenodo DOI 10.5281/zenodo.21783723](https://doi.org/10.5281/zenodo.21783723)
|
|
18
|
+
- **Need a human audit?** — 116-check manual audit methodology, 5-day turnaround: [Agent Output Audit](https://correctover.com/agent-audit.html)
|
|
19
|
+
|
|
20
|
+
`correctover-scan` audits the MCP (Model Context Protocol) configuration files used by Claude Code, Claude Desktop, Cursor, VS Code and other AI agent tools. It scans for credential leaks, SSRF exposure, missing transport encryption, over-broad tool permissions and more — 14 security checks covering the issues that turn MCP integrations into RCE, data exfiltration and prompt-injection paths. Zero install: `npx correctover-scan` runs locally, works in CI, and outputs SARIF for GitHub code scanning.
|
|
21
|
+
|
|
22
|
+
**v1.4.0** adds a second mode: `--bundle` code-layer signal scanning for published npm packages and bundled/minified JavaScript — 17 checks over shipped code, with [file+line findings, minified-code reformatting and context-based false-positive suppression](#-bundle--published-package-code-scan-v140).
|
|
23
|
+
|
|
24
|
+
## ⚡ Quick Start — running in 30 seconds
|
|
7
25
|
|
|
8
|
-
|
|
26
|
+
Zero config, no account, no sign-up — scan the current directory for MCP configuration issues:
|
|
9
27
|
|
|
10
|
-
|
|
28
|
+
```bash
|
|
29
|
+
npx correctover-scan@latest
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
It auto-detects MCP config files (`.cursor/mcp.json`, `claude_desktop_config.json`, `.claude/mcp.json`, `mcp.json`, `.vscode/mcp.json` and more) and runs 14 checks. Everything runs locally on your machine — config files are not uploaded.
|
|
11
33
|
|
|
12
34
|
```bash
|
|
13
35
|
# Scan a specific config file
|
|
14
36
|
npx correctover-scan mcp.json
|
|
15
37
|
|
|
16
|
-
#
|
|
17
|
-
npx correctover-scan
|
|
38
|
+
# Recursively scan a project directory
|
|
39
|
+
npx correctover-scan -d ./my-project -r
|
|
18
40
|
|
|
19
|
-
#
|
|
20
|
-
npx correctover-scan -
|
|
41
|
+
# SARIF output for GitHub code scanning
|
|
42
|
+
npx correctover-scan mcp.json -f sarif > report.sarif
|
|
21
43
|
```
|
|
22
44
|
|
|
23
45
|
## What It Checks
|
|
@@ -63,12 +85,74 @@ Auto-detects these files:
|
|
|
63
85
|
- `.mcp/mcp.json`
|
|
64
86
|
- `config/mcp.json`
|
|
65
87
|
|
|
88
|
+
## 📦 Bundle / published-package code scan (v1.4.0)
|
|
89
|
+
|
|
90
|
+
### Usage
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Audit an unpacked npm package: reads package.json entry (main/module/bin)
|
|
94
|
+
# and every .js/.mjs/.cjs/.ts file in the tree (node_modules skipped)
|
|
95
|
+
npx correctover-scan@latest --bundle ./node_modules/some-pkg
|
|
96
|
+
npx correctover-scan@latest -b ./pkg # -b is shorthand for --bundle
|
|
97
|
+
|
|
98
|
+
# Audit a single minified/bundled JS file
|
|
99
|
+
npx correctover-scan@latest --bundle dist/app.min.js
|
|
100
|
+
|
|
101
|
+
# A positional .js/.mjs/.cjs/.ts target auto-selects bundle mode
|
|
102
|
+
npx correctover-scan@latest ./cli.js
|
|
103
|
+
|
|
104
|
+
# Outputs: text (default), JSON, or SARIF with file+line locations
|
|
105
|
+
npx correctover-scan@latest -b ./pkg -f json
|
|
106
|
+
npx correctover-scan@latest -b ./pkg -f sarif > bundle.sarif
|
|
107
|
+
npx correctover-scan@latest -b ./pkg -o report.txt # write the report to a file
|
|
108
|
+
npx correctover-scan@latest -b ./pkg -f json -o bundle.json
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Exit code is `1` when any check produces a fail-level finding — drop the command straight into CI.
|
|
112
|
+
|
|
113
|
+
### What bundle mode is — and what it is not
|
|
114
|
+
|
|
115
|
+
Bundle mode is **signal scanning over shipped/minified code**. Minifiers rename local variables, but property names, string literals, URLs, environment-variable names and error messages survive bundling — so the attack-surface signals the checks rely on are still present in the published artifact.
|
|
116
|
+
|
|
117
|
+
- **12 automatic checks** return a verdict (pass / warn / fail) — hardcoded secrets, cloud-metadata/SSRF, `shell:true`/`exec` subprocess calls, dynamic `eval`/`Function`/`vm`, plaintext endpoints, MCP transport auth, permission gates, missing timeouts/kill-switch/input validation, env-credential flow, sandbox signals.
|
|
118
|
+
- **5 semi-automatic checks** (token budget, audit logging/telemetry, supply-chain/SBOM, error handling/retry, output truncation/filtering) **enumerate the signals** they find in shipped code — the signal's presence is verifiable, but whether the control is actually enforced needs human review. Those signals are listed in the JSON output and never counted as fails.
|
|
119
|
+
- Every finding is grounded at **file + line with a code snippet**. Minified files are detected and lightly reformatted internally (statement/block expansion, no dependencies) so line numbers stay usable; already-formatted source is scanned untouched.
|
|
120
|
+
- Known-benign patterns are suppressed with context heuristics and reported as info — for example cloud-SDK metadata credential providers (AWS IMDS / GCP metadata), `shell:false` fixed-argument spawn calls, sandbox VM implementations, localhost/spec-namespace URLs and placeholder/example strings.
|
|
121
|
+
|
|
122
|
+
**Honest scope:** bundle mode does not prove reachability or intent — a signal that is located correctly may still be unreachable in practice, and conclusions on the semi-automatic checks remain a manual-review job. It is an automated triage layer that points a reviewer at the exact lines to examine; it does **not** replace the **116-check manual audit methodology**, where reviewers trace data flow and what each capability can actually be made to do. Scanning covers JavaScript/TypeScript code, configuration and protocol-layer signals; deep logic compiled into native binaries (e.g. Bun `--compile` single-file executables) is outside static analysis and is not covered by bundle mode. Everything runs locally — package code is not uploaded.
|
|
123
|
+
|
|
124
|
+
### Bundle checks (17)
|
|
125
|
+
|
|
126
|
+
Check ids continue the config scanner's 14-check scheme so text/JSON/SARIF outputs stay aligned.
|
|
127
|
+
|
|
128
|
+
| # | Check | Type | Severity | AISVS |
|
|
129
|
+
|---|-------|------|----------|-------|
|
|
130
|
+
| 1 | Hardcoded credentials in code (sk-/ghp_/AKIA/AIza/xox patterns, placeholder-aware) | automatic | 🔴 Critical | C5.1 |
|
|
131
|
+
| 2 | Plaintext HTTP outbound endpoints (localhost/spec/example hosts suppressed) | automatic | 🟠 High | C10.1 |
|
|
132
|
+
| 3 | Cloud metadata & intranet addresses / SSRF (169.254.x, RFC1918, GCP metadata; cloud-SDK & guard context suppressed) | automatic | 🔴 Critical | C10.3 |
|
|
133
|
+
| 4 | Subprocess execution — `shell:true` / `exec` (`shell:false` fixed-arg spawn not flagged) | automatic | 🟠 High | C4.1 |
|
|
134
|
+
| 5 | Dynamic code execution — `eval` / `new Function` / `vm` (sandbox/shim contexts suppressed) | automatic | 🟠 High | C4.1 |
|
|
135
|
+
| 6 | Environment-variable credential flow (hardcoded fallback secrets flagged) | automatic | 🟡 Medium | C5.1 |
|
|
136
|
+
| 7 | Permission modes & tool gates (`allowedTools`, `dangerouslySkipPermissions`) | automatic | 🟠 High | C9.3 |
|
|
137
|
+
| 8 | MCP transport authentication (remote sse/http/ws without Authorization signal) | automatic | 🟠 High | C10.2 |
|
|
138
|
+
| 9 | Timeout & interruption signals (`AbortSignal.timeout` / `timeout` options) | automatic | 🟡 Medium | C9.1 |
|
|
139
|
+
| 10 | Kill switch — `AbortController` / `AbortSignal` presence | automatic | 🟠 High | C9.5 |
|
|
140
|
+
| 11 | Sandbox isolation signals (bwrap / sandbox manager) | automatic | 🟡 Medium | C4.1 |
|
|
141
|
+
| 12 | Input validation / schema signals | automatic | 🟠 High | C2.1 |
|
|
142
|
+
| 13 | Token budget constants (`MAX_*_TOKENS` / cost limits) | semi-automatic | 🟠 High | C9.1 |
|
|
143
|
+
| 14 | Audit logging / telemetry endpoints | semi-automatic | 🟡 Medium | C12.1 |
|
|
144
|
+
| 15 | Supply chain / vendor SBOM (native artifacts, vendor versions) | semi-automatic | 🟡 Medium | C6.1 |
|
|
145
|
+
| 16 | Error handling / retry / fallback | semi-automatic | 🟡 Medium | C12.2 |
|
|
146
|
+
| 17 | Output truncation / filtering | semi-automatic | 🟡 Medium | C7.1 |
|
|
147
|
+
|
|
148
|
+
The free-tier daily scan allowance applies to bundle scans too (counted the same way as config scans); a Pro license removes the limit. License verification runs sub-millisecond on the core verification hot path.
|
|
149
|
+
|
|
66
150
|
## CI/CD Integration
|
|
67
151
|
|
|
68
152
|
### GitHub Actions
|
|
69
153
|
|
|
70
154
|
```yaml
|
|
71
|
-
- uses:
|
|
155
|
+
- uses: DSHCorrectover/correctover-scan-action@v1
|
|
72
156
|
with:
|
|
73
157
|
path: ./mcp.json
|
|
74
158
|
```
|
|
@@ -82,34 +166,38 @@ Try the online version: [correctover.com/scan](https://correctover.com/scan/)
|
|
|
82
166
|
- **OWASP AISVS 1.0** — AI System Vulnerability Severity
|
|
83
167
|
- **GB/T《智能体应用安全基本要求》** — Chinese National Mandatory Standard
|
|
84
168
|
|
|
85
|
-
##
|
|
86
|
-
|
|
87
|
-
50 scans/day — no credit card required.
|
|
169
|
+
## Manual audit
|
|
88
170
|
|
|
89
|
-
|
|
171
|
+
The free automated scan covers surface-level configuration checks. A manual Correctover audit goes deeper:
|
|
90
172
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
173
|
+
- **116-check manual audit methodology** — reviewers trace what each MCP tool can actually be made to do, not just whether a config field is present
|
|
174
|
+
- Findings grounded in **real MCP ecosystem CVEs**
|
|
175
|
+
- **5-day turnaround**, delivered as a PDF report with recommended fixes
|
|
176
|
+
- A **free 1-page summary** of your configuration first — you decide whether to continue after reading it
|
|
94
177
|
|
|
95
|
-
|
|
178
|
+
For first customers, if the manual audit finds no critical-severity issue, you pay nothing.
|
|
96
179
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
| **Security Scanner** | `npx correctover-scan` | MCP config security audit (14 checks) |
|
|
100
|
-
| **Self-Healing Test** | `pip install correctover-test` | Agent self-healing test suite |
|
|
101
|
-
| **Vulnerability Scan** | `pip install correctover-security-audit` | 215 fault type scanner |
|
|
102
|
-
| **Compliance Check** | `pip install correctover-compliance-check` | OAuth 2.1 + CCS v1.0 |
|
|
103
|
-
| **Runtime Guard** | `pip install correctover-runtime-guard` | 22µs RCE/SSRF interception |
|
|
104
|
-
| **MCP Server** | `npm install correctover-mcp-server` | 6-dimension validation |
|
|
180
|
+
- Get your free 1-page summary: email [234114134@coze.email](mailto:234114134@coze.email?subject=Free%20audit%20scan%20summary)
|
|
181
|
+
- Learn more about the manual audit: https://correctover.com/agent-audit.html
|
|
105
182
|
|
|
106
183
|
## Links
|
|
107
184
|
|
|
108
185
|
- [correctover.com](https://correctover.com) — AI Agent Runtime Assurance
|
|
109
|
-
- [CCS Standard](https://correctover.com/ccs) — Conformance Specification
|
|
186
|
+
- [CCS Standard](https://correctover.com/ccs) — Conformance Specification
|
|
110
187
|
- [Web Scanner](https://correctover.com/scan/) — Online version
|
|
111
|
-
- [GitHub](https://github.com/
|
|
188
|
+
- [GitHub](https://github.com/DSHCorrectover) — Source code
|
|
189
|
+
- [Conformance test vectors](https://github.com/DSHCorrectover/ccs-conformance-vectors) — 66 signed, reproducible
|
|
190
|
+
- [EMILIA interoperability](https://github.com/emiliaprotocol/emilia-protocol/pull/693) — merged joint assessment
|
|
191
|
+
- [Framework paper (Zenodo)](https://doi.org/10.5281/zenodo.21783723) — DOI 10.5281/zenodo.21783723
|
|
192
|
+
- [Agent Output Audit](https://correctover.com/agent-audit.html) — 116-check manual audit, 5-day turnaround
|
|
193
|
+
|
|
194
|
+
## Specification
|
|
195
|
+
|
|
196
|
+
CCS (Correctover Conformance Shape) is published as an individual Internet-Draft: **[draft-correctover-ccs](https://datatracker.ietf.org/doc/draft-correctover-ccs/)**.
|
|
197
|
+
|
|
198
|
+
An Internet-Draft is an individual submission. It is not an RFC, an adopted working-group item, or IETF endorsement; the Datatracker page is authoritative for revision and status.
|
|
112
199
|
|
|
113
200
|
## License
|
|
114
201
|
|
|
115
202
|
MIT © Correctover
|
|
203
|
+
|