@yagyeshvyas/vibeguard 1.0.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 -63
- package/LICENSE +21 -0
- package/README.md +499 -870
- package/bin/cli.js +2083 -1954
- package/ci/vibeguard.yml +42 -41
- package/package.json +2 -2
- package/src/auto.js +6 -1
- package/src/engine.js +294 -234
- package/src/mcp-server.js +1814 -1799
- package/src/report.js +325 -312
- package/src/rules-pack.js +9 -2
- package/src/rules.js +1506 -1451
- package/src/scanner.js +805 -685
- package/src/shell-guard.js +291 -275
- package/src/taint-ast.js +161 -9
- package/src/taint.js +14 -1
package/README.md
CHANGED
|
@@ -1,871 +1,500 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
|
|
3
|
-
<!-- Animated
|
|
4
|
-
<img src="
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
<!--
|
|
9
|
-
<
|
|
10
|
-
<img src="https://img.shields.io/
|
|
11
|
-
<img src="https://img.shields.io/
|
|
12
|
-
<img src="https://img.shields.io/badge/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
vibeguard
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
-
|
|
213
|
-
|
|
214
|
-
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
-
|
|
362
|
-
-
|
|
363
|
-
-
|
|
364
|
-
|
|
365
|
-
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
-
|
|
374
|
-
-
|
|
375
|
-
-
|
|
376
|
-
-
|
|
377
|
-
-
|
|
378
|
-
-
|
|
379
|
-
-
|
|
380
|
-
-
|
|
381
|
-
-
|
|
382
|
-
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
-
|
|
392
|
-
-
|
|
393
|
-
-
|
|
394
|
-
-
|
|
395
|
-
-
|
|
396
|
-
-
|
|
397
|
-
|
|
398
|
-
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
vibeguard
|
|
459
|
-
vibeguard
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
| 11 | Self-Check | All VibeGuard modules intact? |
|
|
501
|
-
| 12 | Tamper Check | No tampering with VibeGuard? |
|
|
502
|
-
| 13 | Behavioral Check | No suspicious patterns? |
|
|
503
|
-
|
|
504
|
-
---
|
|
505
|
-
|
|
506
|
-
<div align="center">
|
|
507
|
-
<h2>🔬 AST Taint Analysis & Confidence</h2>
|
|
508
|
-
</div>
|
|
509
|
-
|
|
510
|
-
VibeGuard uses **scope-aware AST dataflow analysis** (not just regex) to track user input from source to sink:
|
|
511
|
-
|
|
512
|
-
```js
|
|
513
|
-
const name = req.body.name; // source — tainted
|
|
514
|
-
const cmd = `ls ${name}`; // taint propagates through template literal
|
|
515
|
-
exec(cmd); // sink — command injection confirmed
|
|
516
|
-
```
|
|
517
|
-
|
|
518
|
-
**Confidence levels** on every finding reduce alert fatigue:
|
|
519
|
-
|
|
520
|
-
| Confidence | Meaning | How it's set |
|
|
521
|
-
|------------|---------|-------------|
|
|
522
|
-
| `high` | Dataflow-confirmed — input traced to sink | AST taint, AST analysis |
|
|
523
|
-
| `medium` | Multi-signal regex with `filter()` | Rules with validation logic |
|
|
524
|
-
| `low` | Bare regex match — heuristic hint | Single-pattern rules |
|
|
525
|
-
|
|
526
|
-
```bash
|
|
527
|
-
vibeguard scan --min-confidence medium # hide low-confidence hints
|
|
528
|
-
vibeguard scan --show-suppressed # show inline-suppressed findings
|
|
529
|
-
```
|
|
530
|
-
|
|
531
|
-
**Inline suppression** with reasons:
|
|
532
|
-
|
|
533
|
-
```js
|
|
534
|
-
const key = "sk_live_..."; // vibeguard-ignore[secret.stripe-live-key]: test fixture
|
|
535
|
-
// vibeguard-ignore-next[code.eval]: intentional eval in REPL
|
|
536
|
-
eval(userInput);
|
|
537
|
-
```
|
|
538
|
-
|
|
539
|
-
SARIF output maps confidence to `result.properties.confidence` for CI integrations.
|
|
540
|
-
|
|
541
|
-
---
|
|
542
|
-
|
|
543
|
-
<div align="center">
|
|
544
|
-
<h2>📊 Numbers</h2>
|
|
545
|
-
</div>
|
|
546
|
-
|
|
547
|
-
<!-- COUNTS:START -->
|
|
548
|
-
<!-- Auto-generated by scripts/counts.js — do not edit manually -->
|
|
549
|
-
<!-- Rules: 693 | MCP Tools: 75 | Defense Layers: 13 -->
|
|
550
|
-
<!-- COUNTS:END -->
|
|
551
|
-
|
|
552
|
-
<table>
|
|
553
|
-
<tr><th>Metric</th><th>Value</th><th></th></tr>
|
|
554
|
-
<tr><td>Rules</td><td><b>693</b></td><td>🔒</td></tr>
|
|
555
|
-
<tr><td>MCP tools</td><td><b>75</b></td><td>🤖</td></tr>
|
|
556
|
-
<tr><td>CLI commands</td><td><b>58</b></td><td>💻</td></tr>
|
|
557
|
-
<tr><td>Auto-fixable rules</td><td><b>43</b></td><td>🔧</td></tr>
|
|
558
|
-
<tr><td>Defense layers</td><td><b>13</b></td><td>🛡️</td></tr>
|
|
559
|
-
<tr><td>Pre-deploy gates</td><td><b>13</b></td><td>🚀</td></tr>
|
|
560
|
-
<tr><td>AI clients</td><td><b>12</b></td><td>🧠</td></tr>
|
|
561
|
-
<tr><td>Languages</td><td><b>14</b></td><td>🌐</td></tr>
|
|
562
|
-
<tr><td>Frameworks</td><td><b>20+</b></td><td>⚡</td></tr>
|
|
563
|
-
<tr><td>Presets</td><td><b>12</b></td><td>⚙️</td></tr>
|
|
564
|
-
<tr><td>Privacy rules</td><td><b>50+</b></td><td>🔒</td></tr>
|
|
565
|
-
<tr><td>Firewall rules</td><td><b>30+</b></td><td>🔥</td></tr>
|
|
566
|
-
<tr><td>AI Firewall threats</td><td><b>20+</b></td><td>🧱</td></tr>
|
|
567
|
-
<tr><td>PII types detected</td><td><b>10+</b></td><td>👁️</td></tr>
|
|
568
|
-
<tr><td>Source modules</td><td><b>43</b></td><td>📦</td></tr>
|
|
569
|
-
<tr><td>Tests</td><td><b>329</b></td><td>✅</td></tr>
|
|
570
|
-
<tr><td>Lint errors</td><td><b>0</b></td><td>✨</td></tr>
|
|
571
|
-
<tr><td>Dependencies</td><td><b>1</b> (MCP SDK)</td><td>📦</td></tr>
|
|
572
|
-
<tr><td>Cost</td><td><b>$0</b></td><td>💚</td></tr>
|
|
573
|
-
<tr><td>Telemetry</td><td><b>None</b></td><td>🔒</td></tr>
|
|
574
|
-
<tr><td>Data sent to servers</td><td><b>None</b></td><td>🔒</td></tr>
|
|
575
|
-
</table>
|
|
576
|
-
|
|
577
|
-
---
|
|
578
|
-
|
|
579
|
-
<div align="center">
|
|
580
|
-
<h2>📏 Benchmark (Precision / Recall / F1)</h2>
|
|
581
|
-
</div>
|
|
582
|
-
|
|
583
|
-
We measure VibeGuard against a curated JS vuln corpus — not a fake rule count.
|
|
584
|
-
|
|
585
|
-
<!-- BENCHMARK:START -->
|
|
586
|
-
<!-- Auto-generated by `npm run benchmark` — do not edit manually -->
|
|
587
|
-
|
|
588
|
-
## Summary
|
|
589
|
-
|
|
590
|
-
| Category | TP | FP | FN | Precision | Recall | F1 |
|
|
591
|
-
|----------|----|----|----|-----------|--------|----|
|
|
592
|
-
| injection | 43 | 10 | 3 | 81.1% | 93.5% | 86.9% |
|
|
593
|
-
| secrets | 17 | 0 | 0 | 100.0% | 100.0% | 100.0% |
|
|
594
|
-
| xss | 4 | 0 | 0 | 100.0% | 100.0% | 100.0% |
|
|
595
|
-
| path-traversal | 9 | 1 | 0 | 90.0% | 100.0% | 94.7% |
|
|
596
|
-
| ai-safety | 7 | 2 | 0 | 77.8% | 100.0% | 87.5% |
|
|
597
|
-
| **OVERALL** | **80** | **13** | **3** | **86.0%** | **96.4%** | **90.9%** |
|
|
598
|
-
|
|
599
|
-
## Per-Category Details
|
|
600
|
-
|
|
601
|
-
### injection
|
|
602
|
-
|
|
603
|
-
| File | Rule ID | Verdict |
|
|
604
|
-
|------|---------|---------|
|
|
605
|
-
| cmd-concat.js | `taint.command-injection` | TP |
|
|
606
|
-
| cmd-concat.js | `ast.command-injection` | TP |
|
|
607
|
-
| cmd-concat2.js | `taint.command-injection` | TP |
|
|
608
|
-
| cmd-concat2.js | `ast.command-injection` | TP |
|
|
609
|
-
| cmd-go.go | `go.command-injection` | TP |
|
|
610
|
-
| cmd-py.py | `py.os-system` | TP |
|
|
611
|
-
| cmd-py2.py | `py.subprocess-shell-true` | TP |
|
|
612
|
-
| cmd-py3.py | `py.os-system` | TP |
|
|
613
|
-
| cmd-spawn.js | `taint.command-injection` | TP |
|
|
614
|
-
| cmd-template.js | `taint.command-injection` | TP |
|
|
615
|
-
| cmd-template.js | `ast.command-injection` | TP |
|
|
616
|
-
| eval-input.js | `ast.eval-dynamic` | TP |
|
|
617
|
-
| eval-new-function.js | `ast.function-constructor` | TP |
|
|
618
|
-
| eval-new-function.js | `ast.mass-assignment` | FP |
|
|
619
|
-
| eval-template.js | `ast.eval-dynamic` | TP |
|
|
620
|
-
| eval-template.js | `taint.code-injection` | FP |
|
|
621
|
-
| nosql-where.js | `ast.nosql-injection` | TP |
|
|
622
|
-
| nosql.js | `ast.nosql-injection` | TP |
|
|
623
|
-
| nosql2.js | `ast.nosql-injection` | TP |
|
|
624
|
-
| nosql3.js | `ast.nosql-injection` | TP |
|
|
625
|
-
| open-redirect.js | `web.open-redirect` | TP |
|
|
626
|
-
| open-redirect2.js | `taint.open-redirect` | TP |
|
|
627
|
-
| proto-poll.js | `injection.prototype-pollution` | TP |
|
|
628
|
-
| proto-poll.js | `ast.mass-assignment` | TP |
|
|
629
|
-
| proto-poll2.js | `injection.prototype-pollution` | TP |
|
|
630
|
-
| proto-poll3.js | `injection.prototype-pollution` | TP |
|
|
631
|
-
| sql-concat.js | `code.sql-injection` | TP |
|
|
632
|
-
| sql-concat.js | `taint.sql-injection` | TP |
|
|
633
|
-
| sql-concat2.js | `code.sql-injection` | TP |
|
|
634
|
-
| sql-concat2.js | `taint.sql-injection` | TP |
|
|
635
|
-
| sql-concat3.js | `code.sql-injection` | TP |
|
|
636
|
-
| sql-csharp.cs | `csharp.sql-injection` | TP |
|
|
637
|
-
| sql-csharp.cs | `code.sql-injection` | FP |
|
|
638
|
-
| sql-fstring.py | `py.sql-injection` | TP |
|
|
639
|
-
| sql-fstring2.py | `py.sql-injection` | TP |
|
|
640
|
-
| sql-knex.js | `code.sql-injection` | TP |
|
|
641
|
-
| sql-knex.js | `mikroorm.identifier-from-request` | FP |
|
|
642
|
-
| sql-kotlin.kt | `kotlin.sql-injection` | TP |
|
|
643
|
-
| sql-py-concat.py | `py.sql-injection` | FN |
|
|
644
|
-
| sql-py-concat.py | `code.sql-injection` | FP |
|
|
645
|
-
| sql-raw-rb.js | `code.sql-injection` | TP |
|
|
646
|
-
| sql-raw2.js | `db.sql-template-literal` | TP |
|
|
647
|
-
| sql-sequelize.js | `code.sql-injection` | TP |
|
|
648
|
-
| sql-sprintf.go | `go.sql-fmt-sprintf` | TP |
|
|
649
|
-
| sql-sprintf.go | `go.sql-injection` | FP |
|
|
650
|
-
| sql-sprintf2.go | `go.sql-fmt-sprintf` | TP |
|
|
651
|
-
| sql-sprintf2.go | `go.sql-injection` | FP |
|
|
652
|
-
| sql-template.js | `db.sql-template-literal` | TP |
|
|
653
|
-
| sql-template2.js | `db.sql-template-literal` | FN |
|
|
654
|
-
| sql-template2.js | `injection.orm-raw-user` | FN |
|
|
655
|
-
| sql-template2.js | `taint.sql-injection` | FP |
|
|
656
|
-
| sql-template3.js | `db.sql-template-literal` | TP |
|
|
657
|
-
| ssrf.js | `ast.ssrf` | TP |
|
|
658
|
-
| ssrf2.js | `taint.ssrf` | TP |
|
|
659
|
-
| cmd-array.js | `taint.command-injection` | FP |
|
|
660
|
-
| sql-parameterized.js | `taint.sql-injection` | FP |
|
|
661
|
-
|
|
662
|
-
### secrets
|
|
663
|
-
|
|
664
|
-
| File | Rule ID | Verdict |
|
|
665
|
-
|------|---------|---------|
|
|
666
|
-
| conn-string.js | `secret.connection-string` | TP |
|
|
667
|
-
| docker-build-arg.js | `ai.key-in-url` | TP |
|
|
668
|
-
| env-secret.js | `secret.high-entropy` | TP |
|
|
669
|
-
| generic-secret.js | `secret.generic-credential` | TP |
|
|
670
|
-
| github-token.js | `secret.github-token` | TP |
|
|
671
|
-
| github-token2.js | `secret.github-token` | TP |
|
|
672
|
-
| github-token2.js | `secret.high-entropy` | TP |
|
|
673
|
-
| gitlab-token.js | `secret.gitlab-token` | TP |
|
|
674
|
-
| mailgun-key.js | `secret.mailgun-key` | TP |
|
|
675
|
-
| mailgun-key.js | `secret.high-entropy` | TP |
|
|
676
|
-
| npm-token.js | `secret.npm-token` | TP |
|
|
677
|
-
| npm-token.js | `secret.high-entropy` | TP |
|
|
678
|
-
| resend-key.js | `secret.resend-key` | TP |
|
|
679
|
-
| sendgrid-key.js | `secret.sendgrid-key` | TP |
|
|
680
|
-
| slack-token.js | `secret.slack-token` | TP |
|
|
681
|
-
| stripe-key.js | `secret.generic-credential` | TP |
|
|
682
|
-
| stripe-key.js | `stripe.key-in-client` | TP |
|
|
683
|
-
|
|
684
|
-
### xss
|
|
685
|
-
|
|
686
|
-
| File | Rule ID | Verdict |
|
|
687
|
-
|------|---------|---------|
|
|
688
|
-
| dangerously-html.jsx | `react.dangerous-html` | TP |
|
|
689
|
-
| dangerously-html2.jsx | `react.dangerous-html` | TP |
|
|
690
|
-
| dangerously-html2.jsx | `ai.llm-output-dom` | TP |
|
|
691
|
-
| eval-llm-output.js | `ai.llm-output-dom` | TP |
|
|
692
|
-
|
|
693
|
-
### path-traversal
|
|
694
|
-
|
|
695
|
-
| File | Rule ID | Verdict |
|
|
696
|
-
|------|---------|---------|
|
|
697
|
-
| append-file.js | `taint.path-traversal` | TP |
|
|
698
|
-
| create-read-stream.js | `taint.path-traversal` | TP |
|
|
699
|
-
| path-join-template.js | `upload.filename-path-traversal` | TP |
|
|
700
|
-
| read-concat.js | `taint.path-traversal` | TP |
|
|
701
|
-
| read-template.js | `ai.tool-broad-file-access` | TP |
|
|
702
|
-
| read-template.js | `taint.path-traversal` | TP |
|
|
703
|
-
| sendfile.js | `taint.path-traversal` | TP |
|
|
704
|
-
| unlink-concat.js | `taint.path-traversal` | TP |
|
|
705
|
-
| write-concat.js | `taint.path-traversal` | TP |
|
|
706
|
-
| allowlist.js | `taint.path-traversal` | FP |
|
|
707
|
-
|
|
708
|
-
### ai-safety
|
|
709
|
-
|
|
710
|
-
| File | Rule ID | Verdict |
|
|
711
|
-
|------|---------|---------|
|
|
712
|
-
| agent-deploy.js | `ai.agent-can-deploy` | TP |
|
|
713
|
-
| agent-secrets.js | `ai.agent-can-access-secrets` | TP |
|
|
714
|
-
| llm-output-dom.js | `ai.llm-output-dom` | TP |
|
|
715
|
-
| llm-output-exec.js | `ai.llm-output-shell` | TP |
|
|
716
|
-
| llm-output-exec.js | `taint.command-injection` | TP |
|
|
717
|
-
| llm-output-exec.js | `ast.command-injection` | TP |
|
|
718
|
-
| tool-poisoning.js | `ai.mcp-description-injection-deep` | TP |
|
|
719
|
-
| agent-safe-config.js | `ai.agent-can-deploy` | FP |
|
|
720
|
-
| agent-safe-config.js | `ai.agent-can-access-secrets` | FP |
|
|
721
|
-
|
|
722
|
-
## Methodology
|
|
723
|
-
|
|
724
|
-
- **True Positive (TP)**: Expected rule fires on a vuln file.
|
|
725
|
-
- **False Positive (FP)**: Any finding on a clean file, or an unexpected rule on a vuln file.
|
|
726
|
-
- **False Negative (FN)**: Expected rule that did not fire on a vuln file.
|
|
727
|
-
- **Precision** = TP / (TP + FP)
|
|
728
|
-
- **Recall** = TP / (TP + FN)
|
|
729
|
-
- **F1** = 2 * (Precision * Recall) / (Precision + Recall)
|
|
730
|
-
|
|
731
|
-
Generated: 2026-07-12T03:43:25.339Z
|
|
732
|
-
|
|
733
|
-
<!-- BENCHMARK:END -->
|
|
734
|
-
|
|
735
|
-
---
|
|
736
|
-
|
|
737
|
-
<div align="center">
|
|
738
|
-
<h2>🔒 Privacy Guarantee</h2>
|
|
739
|
-
</div>
|
|
740
|
-
|
|
741
|
-
**VibeGuard never sends your code, secrets, API keys, or personal information anywhere.**
|
|
742
|
-
|
|
743
|
-
| What | Network? | When |
|
|
744
|
-
|------|----------|------|
|
|
745
|
-
| `vibeguard scan` | **Never** | Local file read + regex match |
|
|
746
|
-
| `vibeguard fix` | **Never** | Local file edit |
|
|
747
|
-
| `vibeguard install` | **Never** | Local config write |
|
|
748
|
-
| `vibeguard mcp` | **Never** | stdio transport only |
|
|
749
|
-
| `vibeguard cve` | Opt-in | Package name → OSV.dev (free API) |
|
|
750
|
-
| `vibeguard url` | Opt-in | URL you type → fetch headers |
|
|
751
|
-
| `--verify-keys` | Opt-in | Key → provider that owns it |
|
|
752
|
-
|
|
753
|
-
**No telemetry. No analytics. No tracking. No data collection. No uploads.**
|
|
754
|
-
|
|
755
|
-
---
|
|
756
|
-
|
|
757
|
-
<div align="center">
|
|
758
|
-
<h2>⚙️ Presets</h2>
|
|
759
|
-
</div>
|
|
760
|
-
|
|
761
|
-
```bash
|
|
762
|
-
vibeguard preset nextjs # Next.js + React
|
|
763
|
-
vibeguard preset django # Django + Python
|
|
764
|
-
vibeguard preset rails # Ruby on Rails
|
|
765
|
-
vibeguard preset spring # Spring Boot + Java
|
|
766
|
-
vibeguard preset aws # AWS / Terraform
|
|
767
|
-
vibeguard preset gcp # Google Cloud
|
|
768
|
-
vibeguard preset azure # Azure
|
|
769
|
-
vibeguard preset api # REST / GraphQL API
|
|
770
|
-
vibeguard preset mobile # React Native / mobile
|
|
771
|
-
vibeguard preset fullstack # all rules (maximum coverage)
|
|
772
|
-
```
|
|
773
|
-
|
|
774
|
-
---
|
|
775
|
-
|
|
776
|
-
<div align="center">
|
|
777
|
-
<h2>🔧 CI/CD</h2>
|
|
778
|
-
</div>
|
|
779
|
-
|
|
780
|
-
```bash
|
|
781
|
-
vibeguard init-ci # GitHub Actions (SARIF + fail on CRITICAL)
|
|
782
|
-
vibeguard install-hook # git pre-commit hook (blocks on critical)
|
|
783
|
-
vibeguard install-hook-post # PostToolUse hook (auto-scan after AI edits)
|
|
784
|
-
vibeguard pr-comment # GitHub PR comment format (markdown)
|
|
785
|
-
```
|
|
786
|
-
|
|
787
|
-
Templates included for: **GitLab CI**, **Jenkins**, **CircleCI**, **Azure Pipelines**.
|
|
788
|
-
|
|
789
|
-
---
|
|
790
|
-
|
|
791
|
-
<div align="center">
|
|
792
|
-
<h2>💻 Languages & Frameworks</h2>
|
|
793
|
-
</div>
|
|
794
|
-
|
|
795
|
-
**Languages (14):** JavaScript, TypeScript, Python, Go, Java, Ruby, PHP, C#, Rust, Kotlin, Swift, Bash, SQL, YAML
|
|
796
|
-
|
|
797
|
-
**Frameworks (20+):** Next.js, React, Remix, Astro, SolidStart, SvelteKit, Nuxt, Django, Flask, Rails, Laravel, Spring Boot, NestJS, Fastify, Express, Hono, tRPC, Gin, Echo, Drizzle, Prisma, Sequelize, TypeORM, Kysely, MikroORM, Convex, Turso, Clerk, Auth.js, Supabase, Firebase, Stripe, Polar, LemonSqueezy, Resend, Upstash, Pinecone, PostHog, Uploadthing
|
|
798
|
-
|
|
799
|
-
**Compliance:** SOC 2, PCI-DSS, HIPAA, GDPR, ISO 27001, EU AI Act
|
|
800
|
-
|
|
801
|
-
---
|
|
802
|
-
|
|
803
|
-
<div align="center">
|
|
804
|
-
<h2>🛠️ Development</h2>
|
|
805
|
-
</div>
|
|
806
|
-
|
|
807
|
-
```bash
|
|
808
|
-
npm install
|
|
809
|
-
npm test # 329 tests
|
|
810
|
-
npm run benchmark # precision/recall/F1 benchmark
|
|
811
|
-
npm run counts # self-generating rule/tool counts
|
|
812
|
-
npm run lint # 0 errors
|
|
813
|
-
npm run coverage # coverage report
|
|
814
|
-
```
|
|
815
|
-
|
|
816
|
-
---
|
|
817
|
-
|
|
818
|
-
<div align="center">
|
|
819
|
-
<h2>📖 Honest Scope</h2>
|
|
820
|
-
</div>
|
|
821
|
-
|
|
822
|
-
VibeGuard catches the **mechanical** security holes that AI tools leave behind. It does NOT:
|
|
823
|
-
- Prove your app is safe or leak-proof
|
|
824
|
-
- Track personal data end-to-end through your app automatically
|
|
825
|
-
- Judge business logic flaws
|
|
826
|
-
- Replace a real security review for anything touching money, auth, or personal data
|
|
827
|
-
|
|
828
|
-
It **raises the floor fast** — catching the holes that AI tools create by default.
|
|
829
|
-
|
|
830
|
-
---
|
|
831
|
-
|
|
832
|
-
<div align="center">
|
|
833
|
-
<h2>📄 License</h2>
|
|
834
|
-
|
|
835
|
-
MIT — Free forever. No ads. No tracking. No data collection.
|
|
836
|
-
|
|
837
|
-
</div>
|
|
838
|
-
|
|
839
|
-
---
|
|
840
|
-
|
|
841
|
-
<div align="center">
|
|
842
|
-
|
|
843
|
-
<!-- Author Section with Animation -->
|
|
844
|
-
<img src="https://readme-typing-svg.herokuapp.com?font=Fira+Code&weight=600&size=22&duration=2000&pause=300&color=2E75B6¢er=true&vCenter=true&random=false&width=400&lines=Made+with+%E2%9D%A4%EF%B8%8F+by+Yagyesh+Vyas;Star+%E2%AD%90+if+VibeGuard+helped+you;Open+source+%7C+MIT+License;Zero+telemetry+%7C+100%25+local" alt="Made by Yagyesh Vyas" />
|
|
845
|
-
|
|
846
|
-
<br/>
|
|
847
|
-
|
|
848
|
-
<a href="https://www.linkedin.com/in/yagyeshvyas/">
|
|
849
|
-
<img src="https://img.shields.io/badge/LinkedIn-%230077B5.svg?style=for-the-badge&logo=linkedin&logoColor=white" alt="LinkedIn" />
|
|
850
|
-
</a>
|
|
851
|
-
|
|
852
|
-
<a href="https://github.com/yagyeshVyas">
|
|
853
|
-
<img src="https://img.shields.io/badge/GitHub-%23121011.svg?style=for-the-badge&logo=github&logoColor=white" alt="GitHub" />
|
|
854
|
-
</a>
|
|
855
|
-
|
|
856
|
-
<a href="https://www.npmjs.com/package/vibeguard">
|
|
857
|
-
<img src="https://img.shields.io/badge/npm-%23CB3837.svg?style=for-the-badge&logo=npm&logoColor=white" alt="npm" />
|
|
858
|
-
</a>
|
|
859
|
-
|
|
860
|
-
<br/>
|
|
861
|
-
<br/>
|
|
862
|
-
|
|
863
|
-
<p><b>⭐ If VibeGuard helped you, star the repo!</b></p>
|
|
864
|
-
|
|
865
|
-
<p>Found a bug? <a href="https://github.com/yagyeshVyas/VibeGuard/issues">Open an issue</a> · Want to contribute? <a href="https://github.com/yagyeshVyas/VibeGuard/pulls">Submit a PR</a></p>
|
|
866
|
-
|
|
867
|
-
<br/>
|
|
868
|
-
|
|
869
|
-
<p><sub>VibeGuard v0.1.0 · MIT License · 693 rules · 75 MCP tools · 13 defense layers · $0 cost · zero telemetry</sub></p>
|
|
870
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<!-- Animated logo / banner -->
|
|
4
|
+
<img src="website/banner.svg" alt="VibeGuard" width="480" />
|
|
5
|
+
|
|
6
|
+
### Scan your AI-generated app for leaked keys, open databases, and injection holes in 5 seconds. 100% offline, free forever.
|
|
7
|
+
|
|
8
|
+
<!-- Badges -->
|
|
9
|
+
<p>
|
|
10
|
+
<a href="https://www.npmjs.com/package/@yagyeshvyas/vibeguard"><img src="https://img.shields.io/npm/v/@yagyeshvyas/vibeguard?style=flat-square&logo=npm&logoColor=white" alt="npm version" /></a>
|
|
11
|
+
<a href="https://github.com/yagyeshVyas/VibeGuard/actions"><img src="https://img.shields.io/github/actions/workflow/status/yagyeshVyas/VibeGuard/ci.yml?style=flat-square&logo=github&logoColor=white" alt="CI" /></a>
|
|
12
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="MIT license" /></a>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<!-- Demo GIF -->
|
|
16
|
+
<img src="website/demo.gif" alt="VibeGuard scan demo" width="640" />
|
|
17
|
+
|
|
18
|
+
<br/>
|
|
19
|
+
<sub>Captured against a test project with a planted <code>sk_live</code> Stripe key.</sub>
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
<!-- Quick install command -->
|
|
24
|
+
<a href="https://www.npmjs.com/package/@yagyeshvyas/vibeguard"><code>npx @yagyeshvyas/vibeguard scan</code></a>
|
|
25
|
+
|
|
26
|
+
[Features](#what-it-catches) • [Quick Start](#quick-start) • [Benchmark](#benchmark) • [Commands](#commands) • [Website](https://vibe-guard-site-ivory.vercel.app/) • [Docs](https://github.com/yagyeshVyas/VibeGuard/wiki)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<!-- Anchor target for the badge link -->
|
|
31
|
+
<a id="license"></a>
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
$ npx @yagyeshvyas/vibeguard scan
|
|
37
|
+
|
|
38
|
+
VibeGuard security scan
|
|
39
|
+
./my-app
|
|
40
|
+
|
|
41
|
+
CRITICAL api/route.ts:3 [secret.openai-key]
|
|
42
|
+
OpenAI API key hardcoded in server code
|
|
43
|
+
fix: Move to environment variable.
|
|
44
|
+
|
|
45
|
+
HIGH db/query.ts:5 [taint.sql-injection]
|
|
46
|
+
User input flows into SQL query via template literal (dataflow-confirmed)
|
|
47
|
+
fix: Use parameterized queries / prepared statements.
|
|
48
|
+
|
|
49
|
+
HIGH app/page.jsx:8 [taint.xss-dom]
|
|
50
|
+
User input from URLSearchParams reaches innerHTML — DOM XSS
|
|
51
|
+
fix: Use textContent instead of innerHTML. Sanitize with DOMPurify if needed.
|
|
52
|
+
|
|
53
|
+
Grade D (12 files) 1 critical 3 high 2 medium 1 low
|
|
54
|
+
|
|
55
|
+
Run vibeguard fix to auto-fix 4 issues
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Quick Start
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npx @yagyeshvyas/vibeguard scan
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Or one-command full protection (daemon + hooks + shell guard):
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
npx @yagyeshvyas/vibeguard auto # full protection on
|
|
70
|
+
npx @yagyeshvyas/vibeguard auto --stop # turn it off
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Wire into Claude Code
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
claude mcp add vibeguard -- npx @yagyeshvyas/vibeguard mcp
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Wire into Cursor / Windsurf
|
|
80
|
+
|
|
81
|
+
Add to your MCP config:
|
|
82
|
+
```json
|
|
83
|
+
{ "mcpServers": { "vibeguard": { "command": "npx", "args": ["@yagyeshvyas/vibeguard", "mcp"] } } }
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## What It Catches
|
|
89
|
+
|
|
90
|
+
**Leaked Stripe key in client code**
|
|
91
|
+
```js
|
|
92
|
+
const key = "sk_live_51H8x..."; // anyone with devtools can issue refunds
|
|
93
|
+
```
|
|
94
|
+
VibeGuard flags 50+ secret types — OpenAI, AWS, GitHub, Stripe, Slack, Firebase — and tells you to move them to `process.env`.
|
|
95
|
+
|
|
96
|
+
**Supabase database open to the world**
|
|
97
|
+
```sql
|
|
98
|
+
create table posts ( ... ); -- no RLS — anyone can read/write all rows
|
|
99
|
+
```
|
|
100
|
+
Detects missing RLS, fake RLS policies (`USING (true)`), and service-role keys in client components.
|
|
101
|
+
|
|
102
|
+
**SQL injection via template literal**
|
|
103
|
+
```js
|
|
104
|
+
db.query(`SELECT * FROM users WHERE id = ${req.body.id}`);
|
|
105
|
+
```
|
|
106
|
+
AST taint analysis traces `req.body.id` through template literals to `query()` — confirmed dataflow, not a regex guess.
|
|
107
|
+
|
|
108
|
+
**Prompt injection in system prompt**
|
|
109
|
+
```js
|
|
110
|
+
{ role: "system", content: "You are " + req.body.prompt }
|
|
111
|
+
```
|
|
112
|
+
Catches user input injected into the system role — the root cause of most prompt injection attacks.
|
|
113
|
+
|
|
114
|
+
**`dangerouslySetInnerHTML` with request data**
|
|
115
|
+
```jsx
|
|
116
|
+
<div dangerouslySetInnerHTML={{__html: req.body.html}} />
|
|
117
|
+
```
|
|
118
|
+
Flags XSS sinks across React, Vue (`v-html`), Angular (`innerHTML`), and raw `innerHTML` / `outerHTML` / `insertAdjacentHTML`.
|
|
119
|
+
|
|
120
|
+
**AI agent loop without iteration cap**
|
|
121
|
+
```js
|
|
122
|
+
while (true) { await agent.step(); }
|
|
123
|
+
```
|
|
124
|
+
Detects uncapped agent loops — infinite API spend, resource exhaustion.
|
|
125
|
+
|
|
126
|
+
**Hardcoded JWT secret**
|
|
127
|
+
```js
|
|
128
|
+
jwt.sign(payload, "mysecret123"); // token forgery
|
|
129
|
+
```
|
|
130
|
+
Catches hardcoded session secrets, JWT keys, and credentials in config files, Dockerfiles, and Kubernetes secrets.
|
|
131
|
+
|
|
132
|
+
**Shell command from LLM output**
|
|
133
|
+
```js
|
|
134
|
+
const completion = await openai.chat.completions.create({...});
|
|
135
|
+
exec(completion.choices[0].message.content); // RCE via prompt injection
|
|
136
|
+
```
|
|
137
|
+
Only scanner that detects LLM output reaching `exec`, `eval`, SQL queries, and DOM sinks.
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## `vibeguard auto` — One Command Full Protection
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
vibeguard auto # activates everything
|
|
145
|
+
vibeguard auto --status # see what's active
|
|
146
|
+
vibeguard auto --stop # reverse everything, restore backups
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
| Layer | What it does |
|
|
150
|
+
|-------|-------------|
|
|
151
|
+
| Daemon | Watches files, auto-scans on every change (300ms debounce) |
|
|
152
|
+
| Pre-commit hook | Blocks git commits on critical findings |
|
|
153
|
+
| Post-edit hook | Auto-scans files after AI agent edits them |
|
|
154
|
+
| Shell guard | Blocks dangerous commands (`rm -rf`, `sudo`, `curl\|sh`) before execution |
|
|
155
|
+
|
|
156
|
+
All state in `.vibeguard/auto.json`. Idempotent — safe to run twice. `--stop` restores everything byte-for-byte.
|
|
157
|
+
|
|
158
|
+
Flags: `--ci` (pipeline mode, exit non-zero on critical), `--fix` (apply safe auto-fixes), `--no-shell`, `--strict`.
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Confidence + Inline Suppression
|
|
163
|
+
|
|
164
|
+
Every finding has a confidence level:
|
|
165
|
+
|
|
166
|
+
| Confidence | Meaning |
|
|
167
|
+
|------------|---------|
|
|
168
|
+
| `high` | Dataflow-confirmed — input traced to sink via AST |
|
|
169
|
+
| `medium` | Multi-signal regex with validation logic |
|
|
170
|
+
| `low` | Bare regex match — heuristic hint |
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
vibeguard scan --min-confidence medium # hide low-confidence hints (default)
|
|
174
|
+
vibeguard scan --all # show everything
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Suppress inline with a reason:
|
|
178
|
+
|
|
179
|
+
```js
|
|
180
|
+
const key = "sk_live_..."; // vibeguard-ignore[secret.stripe-live-key]: test fixture
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Coverage & Limits
|
|
186
|
+
|
|
187
|
+
Detection depth is **not uniform across languages** — be honest about what you're getting:
|
|
188
|
+
|
|
189
|
+
| Language | Secrets / patterns | Dataflow taint | Engine |
|
|
190
|
+
|----------|:---:|:---:|--------|
|
|
191
|
+
| JavaScript / TypeScript | ✅ | ✅ interprocedural + cross-file | AST (acorn) |
|
|
192
|
+
| Python | ✅ | ⚠️ heuristic (line-proximity, single-file) | regex |
|
|
193
|
+
| Go | ✅ | ⚠️ targeted rules (e.g. `fmt.Sprintf` SQL) | regex |
|
|
194
|
+
| Java / PHP / Ruby / C# / Rust | ✅ | ❌ pattern-only | regex |
|
|
195
|
+
|
|
196
|
+
**Engine modes.** Full precision needs the optional `acorn` parser. Without it VibeGuard runs `regex-only` and says so loudly on every scan:
|
|
197
|
+
|
|
198
|
+
```
|
|
199
|
+
⚠ engine: regex-only — acorn not installed, AST/taint precision disabled.
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Install precision: `npm i -D acorn acorn-walk acorn-typescript`.
|
|
203
|
+
|
|
204
|
+
**Fail-loud, never fail-silent.** If any analysis pass errors or a file fails to parse, VibeGuard reports degraded coverage instead of pretending the scan was clean:
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
⚠ degraded coverage: 2 file(s) not fully analyzed [passes: ast, taint].
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Use `vibeguard scan --strict` to make a degraded scan a hard failure (exit 3) in CI.
|
|
211
|
+
|
|
212
|
+
**Fast modes.** `--changed` rescans only files changed since the last scan (SHA-256 cache; ~100×+ faster warm re-scans). `--staged` scans only git-staged files — ideal for a pre-commit hook. Both are per-file (cross-file analysis skipped; run a full scan for that). `--no-suppress` ignores inline `vibeguard-ignore` comments and the heuristic FP filter for a CI trust gate.
|
|
213
|
+
|
|
214
|
+
**The shell guard is a mistake-catcher, not a sandbox.** It normalizes common obfuscation (base64, `$IFS`, variable indirection, quote-splitting) and blocks accidental / AI-generated dangerous commands. A determined adversary who knows the patterns can still evade it — it is not sandbox-escape prevention.
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## Benchmark
|
|
219
|
+
|
|
220
|
+
Measured against a curated corpus of 121 files (90 vuln + 31 clean). Not a vanity number.
|
|
221
|
+
|
|
222
|
+
<!-- BENCHMARK:START -->
|
|
223
|
+
<!-- Auto-generated by `npm run benchmark` — do not edit manually -->
|
|
224
|
+
|
|
225
|
+
## Summary
|
|
226
|
+
|
|
227
|
+
| Category | TP | FP | FN | Precision | Recall | F1 |
|
|
228
|
+
|----------|----|----|----|-----------|--------|----|
|
|
229
|
+
| injection | 43 | 5 | 6 | 89.6% | 87.8% | 88.7% |
|
|
230
|
+
| secrets | 19 | 7 | 2 | 73.1% | 90.5% | 80.9% |
|
|
231
|
+
| xss | 16 | 0 | 1 | 100.0% | 94.1% | 97.0% |
|
|
232
|
+
| path-traversal | 9 | 1 | 1 | 90.0% | 90.0% | 90.0% |
|
|
233
|
+
| ai-safety | 8 | 2 | 6 | 80.0% | 57.1% | 66.7% |
|
|
234
|
+
| **OVERALL** | **95** | **15** | **16** | **86.4%** | **85.6%** | **86.0%** |
|
|
235
|
+
|
|
236
|
+
## Per-Category Details
|
|
237
|
+
|
|
238
|
+
### injection
|
|
239
|
+
|
|
240
|
+
| File | Rule ID | Verdict |
|
|
241
|
+
|------|---------|---------|
|
|
242
|
+
| sql-concat.js | `code.sql-injection` | TP |
|
|
243
|
+
| sql-concat.js | `taint.sql-injection` | TP |
|
|
244
|
+
| sql-concat2.js | `code.sql-injection` | TP |
|
|
245
|
+
| sql-concat2.js | `taint.sql-injection` | TP |
|
|
246
|
+
| sql-concat3.js | `code.sql-injection` | TP |
|
|
247
|
+
| sql-template.js | `db.sql-template-literal` | TP |
|
|
248
|
+
| sql-template.js | `taint.sql-injection` | FN |
|
|
249
|
+
| sql-template2.js | `db.sql-template-literal` | FN |
|
|
250
|
+
| sql-template2.js | `taint.sql-injection` | TP |
|
|
251
|
+
| sql-template3.js | `db.sql-template-literal` | TP |
|
|
252
|
+
| sql-template3.js | `taint.sql-injection` | FN |
|
|
253
|
+
| sql-raw-rb.js | `code.sql-injection` | TP |
|
|
254
|
+
| sql-raw2.js | `db.sql-template-literal` | TP |
|
|
255
|
+
| sql-knex.js | `code.sql-injection` | TP |
|
|
256
|
+
| sql-knex.js | `mikroorm.identifier-from-request` | FP |
|
|
257
|
+
| sql-sequelize.js | `code.sql-injection` | TP |
|
|
258
|
+
| sql-fstring.py | `py.sql-injection` | TP |
|
|
259
|
+
| sql-fstring2.py | `py.sql-injection` | TP |
|
|
260
|
+
| sql-py-concat.py | `py.sql-injection` | FN |
|
|
261
|
+
| sql-sprintf.go | `go.sql-fmt-sprintf` | TP |
|
|
262
|
+
| sql-sprintf.go | `go.sql-injection` | FP |
|
|
263
|
+
| sql-sprintf2.go | `go.sql-fmt-sprintf` | TP |
|
|
264
|
+
| sql-sprintf2.go | `go.sql-injection` | FP |
|
|
265
|
+
| sql-kotlin.kt | `kotlin.sql-injection` | TP |
|
|
266
|
+
| sql-csharp.cs | `csharp.sql-injection` | TP |
|
|
267
|
+
| cmd-concat.js | `taint.command-injection` | TP |
|
|
268
|
+
| cmd-concat.js | `ast.command-injection` | TP |
|
|
269
|
+
| cmd-template.js | `taint.command-injection` | TP |
|
|
270
|
+
| cmd-template.js | `ast.command-injection` | TP |
|
|
271
|
+
| cmd-concat2.js | `taint.command-injection` | TP |
|
|
272
|
+
| cmd-concat2.js | `ast.command-injection` | TP |
|
|
273
|
+
| cmd-spawn.js | `taint.command-injection` | FN |
|
|
274
|
+
| cmd-py.py | `py.os-system` | TP |
|
|
275
|
+
| cmd-py2.py | `py.subprocess-shell-true` | TP |
|
|
276
|
+
| cmd-py3.py | `py.os-system` | TP |
|
|
277
|
+
| cmd-go.go | `go.command-injection` | TP |
|
|
278
|
+
| eval-input.js | `ast.eval-dynamic` | TP |
|
|
279
|
+
| eval-template.js | `ast.eval-dynamic` | TP |
|
|
280
|
+
| eval-template.js | `taint.code-injection` | FP |
|
|
281
|
+
| eval-new-function.js | `ast.function-constructor` | TP |
|
|
282
|
+
| eval-new-function.js | `ast.mass-assignment` | FP |
|
|
283
|
+
| nosql.js | `ast.nosql-injection` | TP |
|
|
284
|
+
| nosql2.js | `ast.nosql-injection` | TP |
|
|
285
|
+
| nosql3.js | `ast.nosql-injection` | TP |
|
|
286
|
+
| nosql-where.js | `ast.nosql-injection` | TP |
|
|
287
|
+
| proto-poll.js | `injection.prototype-pollution` | TP |
|
|
288
|
+
| proto-poll.js | `ast.mass-assignment` | TP |
|
|
289
|
+
| proto-poll2.js | `injection.prototype-pollution` | TP |
|
|
290
|
+
| proto-poll3.js | `injection.prototype-pollution` | TP |
|
|
291
|
+
| ssrf.js | `ast.ssrf` | TP |
|
|
292
|
+
| ssrf2.js | `ast.ssrf` | FN |
|
|
293
|
+
| ssrf2.js | `taint.ssrf` | TP |
|
|
294
|
+
| open-redirect.js | `web.open-redirect` | TP |
|
|
295
|
+
| open-redirect2.js | `taint.open-redirect` | TP |
|
|
296
|
+
|
|
297
|
+
### secrets
|
|
298
|
+
|
|
299
|
+
| File | Rule ID | Verdict |
|
|
300
|
+
|------|---------|---------|
|
|
301
|
+
| openai-key.js | `secret.openai-key` | TP |
|
|
302
|
+
| openai-key2.js | `secret.anthropic-key` | TP |
|
|
303
|
+
| github-token.js | `secret.github-token` | TP |
|
|
304
|
+
| github-token2.js | `secret.github-token` | TP |
|
|
305
|
+
| github-token2.js | `secret.high-entropy` | FP |
|
|
306
|
+
| stripe-key.js | `secret.stripe-live-key` | TP |
|
|
307
|
+
| stripe-key.js | `secret.generic-credential` | TP |
|
|
308
|
+
| stripe-key.js | `stripe.key-in-client` | FP |
|
|
309
|
+
| stripe-restricted.js | `secret.stripe-restricted-key` | TP |
|
|
310
|
+
| slack-token.js | `secret.slack-token` | TP |
|
|
311
|
+
| gitlab-token.js | `secret.gitlab-token` | TP |
|
|
312
|
+
| sendgrid-key.js | `secret.sendgrid-key` | TP |
|
|
313
|
+
| npm-token.js | `secret.npm-token` | TP |
|
|
314
|
+
| npm-token.js | `secret.high-entropy` | FP |
|
|
315
|
+
| gcp-key.js | `secret.gcp-api-key` | FN |
|
|
316
|
+
| private-key.js | `secret.private-key` | TP |
|
|
317
|
+
| aws-key.js | `secret.aws-access-key` | TP |
|
|
318
|
+
| mailgun-key.js | `secret.mailgun-key` | TP |
|
|
319
|
+
| mailgun-key.js | `secret.high-entropy` | FP |
|
|
320
|
+
| telegram-token.js | `secret.telegram-bot-token` | FN |
|
|
321
|
+
| resend-key.js | `secret.resend-key` | TP |
|
|
322
|
+
| conn-string.js | `secret.conn-string-password` | TP |
|
|
323
|
+
| conn-string.js | `secret.connection-string` | FP |
|
|
324
|
+
| generic-secret.js | `secret.generic-credential` | TP |
|
|
325
|
+
| docker-build-arg.js | `secret.docker-build-arg` | TP |
|
|
326
|
+
| docker-build-arg.js | `ai.key-in-url` | FP |
|
|
327
|
+
| env-secret.js | `secret.aws-secret-in-env` | TP |
|
|
328
|
+
| env-secret.js | `secret.high-entropy` | FP |
|
|
329
|
+
|
|
330
|
+
### xss
|
|
331
|
+
|
|
332
|
+
| File | Rule ID | Verdict |
|
|
333
|
+
|------|---------|---------|
|
|
334
|
+
| reflected-xss.js | `xss.reflected-response` | TP |
|
|
335
|
+
| reflected-xss.js | `taint.xss-reflected` | TP |
|
|
336
|
+
| reflected-xss2.js | `xss.reflected-response` | TP |
|
|
337
|
+
| reflected-xss2.js | `taint.xss-reflected` | TP |
|
|
338
|
+
| reflected-xss3.js | `xss.reflected-response` | TP |
|
|
339
|
+
| reflected-xss3.js | `taint.xss-reflected` | TP |
|
|
340
|
+
| reflected-xss4.js | `xss.reflected-response` | TP |
|
|
341
|
+
| reflected-xss4.js | `taint.xss-reflected` | TP |
|
|
342
|
+
| innerhtml.js | `injection.xss-angular-innerHTML` | TP |
|
|
343
|
+
| innerhtml.js | `taint.xss-dom` | TP |
|
|
344
|
+
| innerhtml2.js | `injection.xss-innerhtml-direct` | TP |
|
|
345
|
+
| innerhtml2.js | `taint.xss-dom` | TP |
|
|
346
|
+
| dangerously-html.jsx | `react.dangerous-html` | TP |
|
|
347
|
+
| dangerously-html2.jsx | `react.dangerous-html` | TP |
|
|
348
|
+
| dangerously-html2.jsx | `ai.llm-output-dom` | TP |
|
|
349
|
+
| vue-v-html.js | `injection.xss-vue-v-html` | FN |
|
|
350
|
+
| eval-llm-output.js | `ai.llm-output-dom` | TP |
|
|
351
|
+
|
|
352
|
+
### path-traversal
|
|
353
|
+
|
|
354
|
+
| File | Rule ID | Verdict |
|
|
355
|
+
|------|---------|---------|
|
|
356
|
+
| read-concat.js | `taint.path-traversal` | TP |
|
|
357
|
+
| sendfile.js | `taint.path-traversal` | TP |
|
|
358
|
+
| read-template.js | `taint.path-traversal` | TP |
|
|
359
|
+
| read-template.js | `ai.tool-broad-file-access` | TP |
|
|
360
|
+
| write-concat.js | `taint.path-traversal` | TP |
|
|
361
|
+
| unlink-concat.js | `taint.path-traversal` | TP |
|
|
362
|
+
| create-read-stream.js | `taint.path-traversal` | TP |
|
|
363
|
+
| append-file.js | `taint.path-traversal` | TP |
|
|
364
|
+
| path-join-template.js | `taint.path-traversal` | FN |
|
|
365
|
+
| path-join-template.js | `upload.filename-path-traversal` | TP |
|
|
366
|
+
| allowlist.js | `taint.path-traversal` | FP |
|
|
367
|
+
|
|
368
|
+
### ai-safety
|
|
369
|
+
|
|
370
|
+
| File | Rule ID | Verdict |
|
|
371
|
+
|------|---------|---------|
|
|
372
|
+
| user-in-system-prompt.js | `ai.user-input-in-system-prompt` | TP |
|
|
373
|
+
| llm-output-exec.js | `ai.llm-output-exec` | TP |
|
|
374
|
+
| llm-output-exec.js | `taint.command-injection` | TP |
|
|
375
|
+
| llm-output-exec.js | `ai.llm-output-shell` | FP |
|
|
376
|
+
| llm-output-exec.js | `ast.command-injection` | FP |
|
|
377
|
+
| agent-loop-no-cap.js | `ai.agent-loop-no-cap` | TP |
|
|
378
|
+
| model-id-user-input.js | `ai.model-id-injection` | TP |
|
|
379
|
+
| tool-result-injection.js | `ai.tool-result-injection` | FN |
|
|
380
|
+
| agent-memory-poison.js | `ai.memory-poisoning` | FN |
|
|
381
|
+
| tool-poisoning.js | `ai.tool-poisoning` | TP |
|
|
382
|
+
| tool-poisoning.js | `ai.mcp-description-injection-deep` | TP |
|
|
383
|
+
| prompt-extraction.js | `ai.prompt-extraction` | FN |
|
|
384
|
+
| llm-output-dom.js | `ai.llm-output-dom` | TP |
|
|
385
|
+
| agent-deploy.js | `ai.agent-can-deploy` | FN |
|
|
386
|
+
| agent-secrets.js | `ai.agent-can-access-secrets` | FN |
|
|
387
|
+
| model-id-template.js | `ai.model-id-injection` | FN |
|
|
388
|
+
|
|
389
|
+
## Methodology
|
|
390
|
+
|
|
391
|
+
- **True Positive (TP)**: Expected rule fires on a vuln file.
|
|
392
|
+
- **False Positive (FP)**: Any finding on a clean file, or an unexpected rule on a vuln file.
|
|
393
|
+
- **False Negative (FN)**: Expected rule that did not fire on a vuln file.
|
|
394
|
+
- **Precision** = TP / (TP + FP)
|
|
395
|
+
- **Recall** = TP / (TP + FN)
|
|
396
|
+
- **F1** = 2 * (Precision * Recall) / (Precision + Recall)
|
|
397
|
+
|
|
398
|
+
Generated: 2026-07-12T18:25:03.049Z
|
|
399
|
+
|
|
400
|
+
<!-- BENCHMARK:END -->
|
|
401
|
+
|
|
402
|
+
---
|
|
403
|
+
|
|
404
|
+
## Commands
|
|
405
|
+
|
|
406
|
+
```bash
|
|
407
|
+
vibeguard scan [dir] # scan a project (auto-detects framework)
|
|
408
|
+
vibeguard scan --fix # scan + apply safe auto-fixes
|
|
409
|
+
vibeguard scan --all # show all findings including low-confidence
|
|
410
|
+
vibeguard auto [dir] # full protection (daemon + hooks + shell guard)
|
|
411
|
+
vibeguard auto --stop # turn off, restore backups
|
|
412
|
+
vibeguard fix [dir] # auto-fix 43 rule types
|
|
413
|
+
vibeguard pre-deploy [dir] # 13-gate deployment check
|
|
414
|
+
vibeguard mcp # MCP server (for AI client integration)
|
|
415
|
+
vibeguard guard "command" # check a shell command before running it
|
|
416
|
+
vibeguard install-hook # git pre-commit hook (blocks on critical)
|
|
417
|
+
vibeguard install-hook-post # PostToolUse hook (auto-scan AI edits)
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
---
|
|
421
|
+
|
|
422
|
+
## Privacy
|
|
423
|
+
|
|
424
|
+
VibeGuard runs entirely on your machine. No telemetry, no analytics, no network calls by default.
|
|
425
|
+
|
|
426
|
+
| Command | Network? |
|
|
427
|
+
|---------|---------|
|
|
428
|
+
| `scan`, `fix`, `auto`, `mcp`, `install` | Never |
|
|
429
|
+
| `cve` (package name lookup) | Opt-in, OSV.dev only |
|
|
430
|
+
| `url` (header scan) | Opt-in, URL you provide |
|
|
431
|
+
|
|
432
|
+
The runtime interceptor adds guardrails that make data exfiltration significantly harder — it wraps `fetch`, `http.request`, `child_process.exec`, and `fs.readFileSync` to block outbound secrets, PII, and sensitive file access. It is not a sandbox escape prevention layer.
|
|
433
|
+
|
|
434
|
+
---
|
|
435
|
+
|
|
436
|
+
## Honest Scope
|
|
437
|
+
|
|
438
|
+
VibeGuard catches the mechanical security holes that AI coding tools leave behind. It does **not**:
|
|
439
|
+
|
|
440
|
+
- Prove your app is safe or leak-proof
|
|
441
|
+
- Track personal data end-to-end through your app
|
|
442
|
+
- Judge business logic flaws
|
|
443
|
+
- Replace a real security review for anything touching money, auth, or personal data
|
|
444
|
+
|
|
445
|
+
It raises the floor fast — catching the holes that AI tools create by default. The benchmark numbers above are honest: 86.0% F1 means it misses ~14% of real issues and produces some false positives. Run `npm run benchmark` to reproduce. Read the per-category details in `test/benchmark/benchmark-results.md` before relying on it.
|
|
446
|
+
|
|
447
|
+
---
|
|
448
|
+
|
|
449
|
+
## Languages
|
|
450
|
+
|
|
451
|
+
JavaScript, TypeScript, Python, Go, Java, Ruby, PHP, C#, Rust, Kotlin, Swift, Bash, SQL, YAML. Language-specific rules are gated by file extension — Go rules don't fire on `.js` files.
|
|
452
|
+
|
|
453
|
+
---
|
|
454
|
+
|
|
455
|
+
## CI/CD
|
|
456
|
+
|
|
457
|
+
```bash
|
|
458
|
+
vibeguard auto --ci # non-interactive, exit non-zero on critical
|
|
459
|
+
vibeguard init-ci # generate GitHub Actions workflow
|
|
460
|
+
vibeguard scan --output sarif # SARIF output for GitHub Code Scanning
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
Templates included for GitLab CI, Jenkins, CircleCI, Azure Pipelines.
|
|
464
|
+
|
|
465
|
+
---
|
|
466
|
+
|
|
467
|
+
## Development
|
|
468
|
+
|
|
469
|
+
```bash
|
|
470
|
+
npm install
|
|
471
|
+
npm test # 342 tests
|
|
472
|
+
npm run benchmark # precision/recall/F1
|
|
473
|
+
npm run counts # verify rule/tool counts match source
|
|
474
|
+
npm run lint # 0 errors
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
---
|
|
478
|
+
|
|
479
|
+
## License
|
|
480
|
+
|
|
481
|
+
MIT. Free forever. No ads. No tracking. No data collection.
|
|
482
|
+
|
|
483
|
+
---
|
|
484
|
+
|
|
485
|
+
<div align="center">
|
|
486
|
+
|
|
487
|
+
## Built by Yagyesh Vyas
|
|
488
|
+
|
|
489
|
+
<p>
|
|
490
|
+
<a href="https://github.com/yagyeshVyas"><img src="https://img.shields.io/badge/GitHub-yagyeshVyas-181717?style=for-the-badge&logo=github&logoColor=white" alt="GitHub" /></a>
|
|
491
|
+
<a href="https://www.linkedin.com/in/yagyeshvyas"><img src="https://img.shields.io/badge/LinkedIn-Yagyesh%20Vyas-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white" alt="LinkedIn" /></a>
|
|
492
|
+
<a href="https://www.npmjs.com/~yagyeshvyas"><img src="https://img.shields.io/badge/npm-@yagyeshvyas-CB3837?style=for-the-badge&logo=npm&logoColor=white" alt="npm" /></a>
|
|
493
|
+
<a href="https://vibe-guard-site-ivory.vercel.app/"><img src="https://img.shields.io/badge/Website-vibe--guard--site-ivory.vercel.app-000000?style=for-the-badge&logo=vercel&logoColor=white" alt="Website" /></a>
|
|
494
|
+
</p>
|
|
495
|
+
|
|
496
|
+
Found a bug? [Open an issue](https://github.com/yagyeshVyas/VibeGuard/issues). • Have a question? [Start a discussion](https://github.com/yagyeshVyas/VibeGuard/discussions).
|
|
497
|
+
|
|
498
|
+
<sub>© 2026 Yagyesh Vyas. Released under the MIT License.</sub>
|
|
499
|
+
|
|
871
500
|
</div>
|