@yagyeshvyas/vibeguard 0.1.0 → 1.1.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/CHANGELOG.md +126 -0
- package/LICENSE +21 -0
- package/README.md +499 -599
- package/bin/cli.js +2083 -1640
- package/ci/vibeguard.yml +42 -41
- package/package.json +14 -11
- package/src/ast.js +4 -0
- package/src/auto.js +427 -0
- package/src/crosstaint.js +154 -9
- package/src/daemon-run.js +12 -0
- package/src/daemon.js +342 -0
- package/src/engine.js +294 -234
- package/src/guard.js +80 -0
- package/src/mcp-server.js +1814 -1804
- package/src/report.js +325 -312
- package/src/rules-pack.js +121 -14
- package/src/rules.js +1506 -1446
- package/src/scanner.js +805 -651
- package/src/shell-guard.js +292 -0
- package/src/shell-hook.ps1 +135 -0
- package/src/shell-hook.sh +90 -0
- package/src/suppress.js +78 -8
- package/src/taint-ast.js +1004 -0
- package/src/taint.js +52 -13
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to VibeGuard are documented here.
|
|
4
|
+
Format based on [Keep a Changelog](https://keepachangelog.com/).
|
|
5
|
+
|
|
6
|
+
## [Unreleased]
|
|
7
|
+
|
|
8
|
+
### Added
|
|
9
|
+
- `vibeguard scan --staged` — scan only git-staged files. Ideal for a
|
|
10
|
+
pre-commit hook: fast and scoped to exactly what's being committed. Per-file
|
|
11
|
+
only (cross-file analysis skipped, and the CLI says so).
|
|
12
|
+
- `vibeguard scan --no-suppress` — CI trust mode. Ignores inline
|
|
13
|
+
`vibeguard-ignore` comments and the heuristic false-positive filter so a
|
|
14
|
+
careless or hostile inline comment in a PR cannot silence a gate. Deliberate
|
|
15
|
+
project config (ignoreRules/ignorePaths) is still honored.
|
|
16
|
+
- Fail-loud coverage tracking. Every analysis pass (taint, python-taint, AST,
|
|
17
|
+
file-rules) that errors is now recorded instead of silently swallowed. Scan
|
|
18
|
+
results carry `engine` (`ast` | `regex-only`) and `diagnostics`
|
|
19
|
+
(degraded passes, parse-failed files, degraded file count). The CLI prints a
|
|
20
|
+
loud banner when running `regex-only` (acorn missing) or when any file was
|
|
21
|
+
only partially analyzed — a degraded scan no longer masquerades as clean.
|
|
22
|
+
- `vibeguard scan --strict` — exit code 3 when any file scanned degraded, so CI
|
|
23
|
+
never trusts an incomplete result. **Note:** existing CI configs that add
|
|
24
|
+
`--strict` will now hard-fail on degraded scans (intended).
|
|
25
|
+
- Benchmark quality gate: `node test/benchmark/run.js --gate` fails (exit 2) if
|
|
26
|
+
overall precision/recall/F1 regress below a floor (P≥80% / R≥78% / F1≥80%;
|
|
27
|
+
override via `VIBEGUARD_BENCH_MIN_*`). Wired into CI so detection quality
|
|
28
|
+
regressions block merges.
|
|
29
|
+
- ReDoS / pathological-input regression tests + coverage-transparency tests.
|
|
30
|
+
- Engine mode + degraded-coverage now surfaced in JSON output and the MCP
|
|
31
|
+
`scan` tool (payload + summary) so agents don't treat a degraded scan as an
|
|
32
|
+
all-clear.
|
|
33
|
+
- `VIBEGUARD_NO_POSTINSTALL=1` (and CI auto-detect) to silence the install
|
|
34
|
+
message.
|
|
35
|
+
- README `Coverage & Limits` section: honest per-language detection-depth
|
|
36
|
+
matrix, engine-mode explainer, fail-loud explainer, and an explicit "the
|
|
37
|
+
shell guard is a mistake-catcher, not a sandbox" statement.
|
|
38
|
+
- `vibeguard auto` — one-command full autonomous protection. Activates
|
|
39
|
+
daemon (file watcher), pre-commit hook, post-edit hook, and shell guard.
|
|
40
|
+
Idempotent. `--stop` reverses everything and restores backups. `--status`
|
|
41
|
+
shows what's active. `--ci` for pipeline mode. `--fix` for safe auto-fixes.
|
|
42
|
+
`--no-shell` to skip shell hook. `--strict` to block on HIGH too.
|
|
43
|
+
- `src/auto.js` orchestrator composing existing modules (scanner, daemon,
|
|
44
|
+
hook, shell-guard). All state under `.vibeguard/auto.json`.
|
|
45
|
+
- Shell hook FP fix: default-allow policy. Unknown commands are allowed.
|
|
46
|
+
Only block on known dangerous patterns. Fail-open on module load errors.
|
|
47
|
+
Both `shell-hook.sh` and `shell-hook.ps1` now try multiple module paths
|
|
48
|
+
and never block when VibeGuard can't load.
|
|
49
|
+
|
|
50
|
+
### Performance
|
|
51
|
+
- Incremental scanning: `vibeguard scan --changed` only rescans files whose
|
|
52
|
+
content changed since the last scan (SHA-256 hash cache under
|
|
53
|
+
`.vibeguard/cache`). Warm re-scan of an unchanged tree drops from ~600ms to
|
|
54
|
+
~5ms in local testing (~100×+). Per-file only — cross-file taint/rules are
|
|
55
|
+
skipped in this mode and the CLI says so; run a full scan for those. Intended
|
|
56
|
+
for pre-commit and watch loops.
|
|
57
|
+
- Fixed: the scanner no longer walks its own `.vibeguard/` cache/baseline
|
|
58
|
+
artifacts (added to the skip-dirs list).
|
|
59
|
+
- Scanner ~50% faster (108ms → 54ms/file on the repo's own source). Three
|
|
60
|
+
behavior-preserving changes, verified identical findings + unchanged benchmark
|
|
61
|
+
(95 TP / 15 FP / 16 FN):
|
|
62
|
+
1. Memoize the global-flag regex per rule — the hot path was recompiling a
|
|
63
|
+
fresh `RegExp` per rule *per line* (~64% of scan time).
|
|
64
|
+
2. Hoist the `fileFilter` check out of the per-line loop (it depends only on
|
|
65
|
+
the path) and cache the compiled filter.
|
|
66
|
+
3. Provably-safe literal prefilter: skip a rule when a mandatory literal from
|
|
67
|
+
its regex is absent from the line, avoiding the regex entirely. Never
|
|
68
|
+
introduces a false negative (bails on alternation, ignores optional/grouped
|
|
69
|
+
literals). Guarded by unit tests + a throughput regression test.
|
|
70
|
+
|
|
71
|
+
### Changed
|
|
72
|
+
- Python taint analysis rewritten as single-pass taint propagation (still pure
|
|
73
|
+
JS — no external parser, keeps VibeGuard zero-dependency and offline). Tracks
|
|
74
|
+
tainted variables through intermediate assignments (`q = "..." + data` →
|
|
75
|
+
`execute(q)`) and clears taint on clean reassignment. Fixes false positives
|
|
76
|
+
where a tainted name merely appeared near an unrelated sink. Parameterized SQL
|
|
77
|
+
(`execute("... %s ...", (params,))`) and inline-sanitized sinks
|
|
78
|
+
(`eval(int(x))`, `os.system(shlex.quote(x))`) are not flagged; unsafe
|
|
79
|
+
concatenation / f-string flows still fire.
|
|
80
|
+
- Shell guard normalizer hardened. Now substitutes ALL variable assignments
|
|
81
|
+
(previously only the first, a real bypass: `A=rm; B=-rf; $A $B /`), handles
|
|
82
|
+
`$IFS` word-splitting and `/usr/bin/rm`, and iterates to a fixpoint so layered
|
|
83
|
+
obfuscation unwinds. Still, by design, a mistake-catcher — not a sandbox.
|
|
84
|
+
- CI workflow renamed `test.yml` → `ci.yml` to match the README status badge.
|
|
85
|
+
- Taint analysis upgraded from regex-only to scope-aware, AST-based dataflow
|
|
86
|
+
(`taint-ast.js`). Sources/sinks matched on AST nodes (MemberExpression /
|
|
87
|
+
CallExpression), not text. Respects block/function scope with shadowing,
|
|
88
|
+
clears taint on clean reassignment, recognizes sanitizers (parseInt,
|
|
89
|
+
path.basename, DOMPurify.sanitize, etc. — configurable array). Tracks
|
|
90
|
+
cross-function taint within a file via intra-function fixpoint. All
|
|
91
|
+
AST-confirmed findings carry `confidence: "high"` and `dataflow: true`.
|
|
92
|
+
Regex taint retained as fallback for unparseable files. Finding object
|
|
93
|
+
shape unchanged (ruleId/severity/title/message/fix preserved).
|
|
94
|
+
|
|
95
|
+
### Added
|
|
96
|
+
- Cross-file taint analysis via import/export graph (`crosstaint.js`)
|
|
97
|
+
- Optional AST mode with acorn + acorn-typescript (`ast.js`)
|
|
98
|
+
- `vibeguard doctor` — AI host security audit (hook injection, base URL hijack, MCP config)
|
|
99
|
+
- `vibeguard history` — git history secret scan
|
|
100
|
+
- `vibeguard watch` — re-scan on file change
|
|
101
|
+
- `vibeguard rules` / `vibeguard explain` — rule listing and documentation
|
|
102
|
+
- Live key verification (`--verify-keys`) for OpenAI + Stripe
|
|
103
|
+
- Inline suppressions (`vibeguard-ignore-line` / `vibeguard-ignore-next-line`)
|
|
104
|
+
- Project config (`.vibeguardrc.json`) with ignoreRules, ignorePaths, severityOverrides
|
|
105
|
+
- .gitignore-aware secret scanning
|
|
106
|
+
- Stable finding fingerprints for SARIF + baseline diffing
|
|
107
|
+
- External scanner support: semgrep, gitleaks, bandit
|
|
108
|
+
- 15 secret types (GitHub, Slack, GitLab, Twilio, SendGrid, Mailgun, Telegram, npm, Resend, connection strings, public-LLM-key)
|
|
109
|
+
- AI security rules (browser-api-key, disabled-sandbox, eval-llm-output, prompt-injection-marker)
|
|
110
|
+
- Injection rules (prototype pollution, ReDoS, XXE, CRLF)
|
|
111
|
+
- Framework rules (Prisma raw, React dangerous HTML, reflected XSS)
|
|
112
|
+
- IaC rules (Dockerfile, GitHub Actions, Terraform)
|
|
113
|
+
- Package hygiene (unpinned deps, dangerous scripts, no lockfile)
|
|
114
|
+
- 63 tests, all passing
|
|
115
|
+
|
|
116
|
+
## [0.1.0] - Initial release
|
|
117
|
+
- Core scanner with secrets, injection, auth, config, PII rules
|
|
118
|
+
- Fix → verify loop with baseline + rollback
|
|
119
|
+
- MCP server (5 tools)
|
|
120
|
+
- Live URL scan
|
|
121
|
+
- Badge generation
|
|
122
|
+
- One-command multi-client installer
|
|
123
|
+
- Pre-commit hook
|
|
124
|
+
- GitHub Actions CI template
|
|
125
|
+
- SARIF 2.1.0 output
|
|
126
|
+
- Zero runtime dependencies (scanner)
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Yagyesh Vyas
|
|
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.
|