@vibefoundry/vibe-shield 1.1.1 → 2.0.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/README.md +31 -11
- package/SKILL.md +26 -93
- package/dist/bin/vibe-shield.d.ts +1 -1
- package/dist/bin/vibe-shield.js +38 -11
- package/dist/src/init/scaffold.d.ts +1 -1
- package/dist/src/init/scaffold.js +26 -93
- package/dist/src/mcp/server.js +5 -1
- package/dist/src/mcp-guard/skill-auditor.js +11 -3
- package/dist/src/reporter/console-reporter.js +14 -0
- package/dist/src/reporter/executive.d.ts +4 -0
- package/dist/src/reporter/executive.js +58 -0
- package/dist/src/reporter/formatters.d.ts +1 -1
- package/dist/src/reporter/formatters.js +10 -3
- package/dist/src/reporter/patch-prompt-writer.js +3 -3
- package/dist/src/scanner/attack-surface.d.ts +4 -0
- package/dist/src/scanner/attack-surface.js +50 -0
- package/dist/src/scanner/engine.d.ts +2 -3
- package/dist/src/scanner/engine.js +21 -39
- package/dist/src/scanner/mappings.d.ts +17 -0
- package/dist/src/scanner/mappings.js +39 -0
- package/dist/src/scanner/redact.d.ts +1 -0
- package/dist/src/scanner/redact.js +12 -0
- package/dist/src/scanner/rules/hardening.d.ts +5 -0
- package/dist/src/scanner/rules/hardening.js +116 -0
- package/dist/src/scanner/rules/helpers.js +2 -0
- package/dist/src/scanner/rules/index.js +6 -0
- package/dist/src/scanner/rules/response-hardening.d.ts +2 -0
- package/dist/src/scanner/rules/response-hardening.js +120 -0
- package/dist/src/scanner/rules/secret-entropy.js +0 -2
- package/dist/src/scanner/types.d.ts +33 -1
- package/dist/src/scanner/types.js +6 -2
- package/dist/src/scanner/version.d.ts +2 -0
- package/dist/src/scanner/version.js +69 -0
- package/dist/src/secrets/patterns.js +40 -0
- package/package.json +99 -99
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isRuleCategory = exports.isSeverity = exports.meetsSeverity = exports.severityRank = exports.emptySeverityCounts = exports.emptyProjectContext = exports.LANGUAGE_EXTENSIONS = exports.GRADE_THRESHOLDS = exports.GRADES = exports.SEVERITY_SCORE_CEILING = exports.SEVERITY_SCORE_PENALTY = exports.SEVERITY_WEIGHT = exports.CATEGORY_TITLES = exports.RULE_CATEGORIES = exports.CONFIDENCES = exports.SEVERITIES = void 0;
|
|
2
4
|
/**
|
|
3
5
|
* vibe-shield :: scanner type system
|
|
4
6
|
* ----------------------------------
|
|
@@ -7,8 +9,6 @@
|
|
|
7
9
|
* `ScanResult` can be cached to disk, emitted as SARIF, or handed to an agent
|
|
8
10
|
* as a patch prompt without any transformation.
|
|
9
11
|
*/
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.isRuleCategory = exports.isSeverity = exports.meetsSeverity = exports.severityRank = exports.emptySeverityCounts = exports.emptyProjectContext = exports.LANGUAGE_EXTENSIONS = exports.GRADE_THRESHOLDS = exports.GRADES = exports.SEVERITY_SCORE_CEILING = exports.SEVERITY_SCORE_PENALTY = exports.SEVERITY_WEIGHT = exports.CATEGORY_TITLES = exports.RULE_CATEGORIES = exports.CONFIDENCES = exports.SEVERITIES = void 0;
|
|
12
12
|
/** Ordered list of severities, most severe first. */
|
|
13
13
|
exports.SEVERITIES = ['critical', 'high', 'medium', 'low', 'info'];
|
|
14
14
|
/** Detection confidence reported alongside every finding. */
|
|
@@ -23,6 +23,8 @@ exports.RULE_CATEGORIES = [
|
|
|
23
23
|
'database-exposure',
|
|
24
24
|
'ai-vulnerabilities',
|
|
25
25
|
'secret-entropy',
|
|
26
|
+
'infrastructure',
|
|
27
|
+
'dependencies',
|
|
26
28
|
'agent-integrity',
|
|
27
29
|
];
|
|
28
30
|
exports.CATEGORY_TITLES = {
|
|
@@ -31,6 +33,8 @@ exports.CATEGORY_TITLES = {
|
|
|
31
33
|
'database-exposure': 'Database exposure (RLS, SQLi, service role)',
|
|
32
34
|
'ai-vulnerabilities': 'AI / LLM & classic web vulnerabilities',
|
|
33
35
|
'secret-entropy': 'Hardcoded credentials & high-entropy secrets',
|
|
36
|
+
infrastructure: 'Infrastructure, headers & containers',
|
|
37
|
+
dependencies: 'Supply-chain & dependency hygiene',
|
|
34
38
|
'agent-integrity': 'Agent skill & MCP poisoning',
|
|
35
39
|
};
|
|
36
40
|
/** Relative severity weight used by the scoring model. */
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.packageVersion = packageVersion;
|
|
37
|
+
const node_fs_1 = require("node:fs");
|
|
38
|
+
const path = __importStar(require("node:path"));
|
|
39
|
+
const VERSION = process.env.npm_package_version ?? '1.0.0';
|
|
40
|
+
let cachedVersion = null;
|
|
41
|
+
/** Package version, resolved once from the nearest package.json. */
|
|
42
|
+
async function packageVersion() {
|
|
43
|
+
if (cachedVersion)
|
|
44
|
+
return cachedVersion;
|
|
45
|
+
let dir = __dirname;
|
|
46
|
+
for (let depth = 0; depth < 6; depth += 1) {
|
|
47
|
+
try {
|
|
48
|
+
const raw = await node_fs_1.promises.readFile(path.join(dir, 'package.json'), 'utf8');
|
|
49
|
+
const parsed = JSON.parse(raw);
|
|
50
|
+
// Match the scoped name *or* the legacy bare one, so an install made
|
|
51
|
+
// before the package was published under `@vibefoundry/` still resolves
|
|
52
|
+
// its own version instead of reporting the fallback.
|
|
53
|
+
const isThisPackage = parsed.name === '@vibefoundry/vibe-shield' || parsed.name === 'vibe-shield';
|
|
54
|
+
if (isThisPackage && parsed.version) {
|
|
55
|
+
cachedVersion = parsed.version;
|
|
56
|
+
return cachedVersion;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
// Keep walking up.
|
|
61
|
+
}
|
|
62
|
+
const parent = path.dirname(dir);
|
|
63
|
+
if (parent === dir)
|
|
64
|
+
break;
|
|
65
|
+
dir = parent;
|
|
66
|
+
}
|
|
67
|
+
cachedVersion = VERSION;
|
|
68
|
+
return cachedVersion;
|
|
69
|
+
}
|
|
@@ -234,6 +234,46 @@ exports.SECRET_PATTERNS = [
|
|
|
234
234
|
minEntropy: 3,
|
|
235
235
|
note: 'Datadog API/application key.',
|
|
236
236
|
},
|
|
237
|
+
{
|
|
238
|
+
id: 'gitlab-token', vendor: 'GitLab', family: 'saas', severity: 'high',
|
|
239
|
+
regex: /\bglpat-[A-Za-z0-9_-]{20,}\b/g, minEntropy: 3,
|
|
240
|
+
note: 'GitLab personal access token.',
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
id: 'digitalocean-token', vendor: 'DigitalOcean', family: 'saas', severity: 'high',
|
|
244
|
+
regex: /\bdop_v1_[a-f0-9]{64}\b/g, minEntropy: 3,
|
|
245
|
+
note: 'DigitalOcean API token.',
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
id: 'linear-token', vendor: 'Linear', family: 'saas', severity: 'high',
|
|
249
|
+
regex: /\blin_api_[A-Za-z0-9]{40}\b/g, minEntropy: 3,
|
|
250
|
+
note: 'Linear API token.',
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
id: 'cloudflare-token', vendor: 'Cloudflare', family: 'saas', severity: 'high',
|
|
254
|
+
regex: /\bCLOUDFLARE_API_TOKEN\b["']?\s*[:=]\s*["']([A-Za-z0-9_-]{40})["']/gi, minEntropy: 3,
|
|
255
|
+
note: 'A value assigned to a Cloudflare API token variable.',
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
id: 'cohere-token', vendor: 'Cohere', family: 'saas', severity: 'high',
|
|
259
|
+
regex: /\bCOHERE_API_KEY\b["']?\s*[:=]\s*["']([A-Za-z0-9_-]{20,})["']/gi, minEntropy: 3,
|
|
260
|
+
note: 'A value assigned to a Cohere API key variable.',
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
id: 'mistral-token', vendor: 'Mistral', family: 'saas', severity: 'high',
|
|
264
|
+
regex: /\bMISTRAL_API_KEY\b["']?\s*[:=]\s*["']([A-Za-z0-9_-]{20,})["']/gi, minEntropy: 3,
|
|
265
|
+
note: 'A value assigned to a Mistral API key variable.',
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
id: 'groq-token', vendor: 'Groq', family: 'saas', severity: 'high',
|
|
269
|
+
regex: /\bgsk_[A-Za-z0-9]{30,}\b/g, minEntropy: 3,
|
|
270
|
+
note: 'Groq API key.',
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
id: 'together-token', vendor: 'Together AI', family: 'saas', severity: 'high',
|
|
274
|
+
regex: /\bTOGETHER_API_KEY\b["']?\s*[:=]\s*["']([A-Za-z0-9_-]{20,})["']/gi, minEntropy: 3,
|
|
275
|
+
note: 'A value assigned to a Together AI API key variable.',
|
|
276
|
+
},
|
|
237
277
|
{
|
|
238
278
|
id: 'jwt',
|
|
239
279
|
vendor: 'JSON Web Token',
|
package/package.json
CHANGED
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@vibefoundry/vibe-shield",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "High-speed static security analyzer and MCP/agent-skill guard for AI-generated codebases. Catches the vulnerabilities autonomous coding agents ship: leaked secrets, unguarded mutation routes, missing Postgres RLS, unverified webhooks, prompt injection sinks and XSS.",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"mcp",
|
|
7
|
-
"mcp-server",
|
|
8
|
-
"model-context-protocol",
|
|
9
|
-
"mcp-tools",
|
|
10
|
-
"mcp-security",
|
|
11
|
-
"mcp-client",
|
|
12
|
-
"json-rpc",
|
|
13
|
-
"claude-code",
|
|
14
|
-
"claude-desktop",
|
|
15
|
-
"codex",
|
|
16
|
-
"cursor",
|
|
17
|
-
"windsurf",
|
|
18
|
-
"ai-agents",
|
|
19
|
-
"agent-skills",
|
|
20
|
-
"agents-md",
|
|
21
|
-
"ai-security",
|
|
22
|
-
"ai-generated-code",
|
|
23
|
-
"vibe-coding",
|
|
24
|
-
"security-scanner",
|
|
25
|
-
"vulnerability-scanner",
|
|
26
|
-
"static-analysis",
|
|
27
|
-
"sast",
|
|
28
|
-
"appsec",
|
|
29
|
-
"cybersecurity",
|
|
30
|
-
"devsecops",
|
|
31
|
-
"owasp",
|
|
32
|
-
"cwe",
|
|
33
|
-
"sarif",
|
|
34
|
-
"prompt-injection",
|
|
35
|
-
"secret-scanner",
|
|
36
|
-
"secrets-detection",
|
|
37
|
-
"security-audit",
|
|
38
|
-
"supabase-rls",
|
|
39
|
-
"nextjs-security",
|
|
40
|
-
"row-level-security",
|
|
41
|
-
"sql-injection",
|
|
42
|
-
"agent-skill-audit",
|
|
43
|
-
"github-actions",
|
|
44
|
-
"code-scanning",
|
|
45
|
-
"ci-security-gate",
|
|
46
|
-
"npx",
|
|
47
|
-
"typescript",
|
|
48
|
-
"zero-dependencies"
|
|
49
|
-
],
|
|
50
|
-
"license": "MIT",
|
|
51
|
-
"author": "VibeFoundry",
|
|
52
|
-
"homepage": "https://github.com/avivgerz-hue/vibe-shield#readme",
|
|
53
|
-
"repository": {
|
|
54
|
-
"type": "git",
|
|
55
|
-
"url": "git+https://github.com/avivgerz-hue/vibe-shield.git"
|
|
56
|
-
},
|
|
57
|
-
"bugs": {
|
|
58
|
-
"url": "https://github.com/avivgerz-hue/vibe-shield/issues"
|
|
59
|
-
},
|
|
60
|
-
"main": "./dist/src/index.js",
|
|
61
|
-
"types": "./dist/src/index.d.ts",
|
|
62
|
-
"bin": {
|
|
63
|
-
"vibe-shield": "dist/bin/vibe-shield.js"
|
|
64
|
-
},
|
|
65
|
-
"files": [
|
|
66
|
-
"dist/bin",
|
|
67
|
-
"dist/src",
|
|
68
|
-
"SKILL.md",
|
|
69
|
-
"README.md",
|
|
70
|
-
"SECURITY.md",
|
|
71
|
-
"LICENSE"
|
|
72
|
-
],
|
|
73
|
-
"engines": {
|
|
74
|
-
"node": ">=18.17.0"
|
|
75
|
-
},
|
|
76
|
-
"scripts": {
|
|
77
|
-
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
78
|
-
"build": "npm run clean && tsc -p tsconfig.build.json && node scripts/postbuild.mjs",
|
|
79
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
80
|
-
"test": "vitest run",
|
|
81
|
-
"test:watch": "vitest",
|
|
82
|
-
"coverage": "vitest run --coverage",
|
|
83
|
-
"scan:self": "node dist/bin/vibe-shield.js scan",
|
|
84
|
-
"audit:self": "node dist/bin/vibe-shield.js audit-skills",
|
|
85
|
-
"verify": "npm run typecheck && npm run build && npm test && npm run scan:self && npm run audit:self",
|
|
86
|
-
"prepare": "node scripts/prepare.mjs",
|
|
87
|
-
"prepublishOnly": "npm run verify"
|
|
88
|
-
},
|
|
89
|
-
"dependencies": {},
|
|
90
|
-
"devDependencies": {
|
|
91
|
-
"@types/node": "^22.20.5",
|
|
92
|
-
"@vitest/coverage-v8": "^5.1.0",
|
|
93
|
-
"typescript": "^5.9.3",
|
|
94
|
-
"vitest": "^5.1.0"
|
|
95
|
-
},
|
|
96
|
-
"publishConfig": {
|
|
97
|
-
"access": "public"
|
|
98
|
-
}
|
|
99
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@vibefoundry/vibe-shield",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "High-speed static security analyzer and MCP/agent-skill guard for AI-generated codebases. Catches the vulnerabilities autonomous coding agents ship: leaked secrets, unguarded mutation routes, missing Postgres RLS, unverified webhooks, prompt injection sinks and XSS.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"mcp",
|
|
7
|
+
"mcp-server",
|
|
8
|
+
"model-context-protocol",
|
|
9
|
+
"mcp-tools",
|
|
10
|
+
"mcp-security",
|
|
11
|
+
"mcp-client",
|
|
12
|
+
"json-rpc",
|
|
13
|
+
"claude-code",
|
|
14
|
+
"claude-desktop",
|
|
15
|
+
"codex",
|
|
16
|
+
"cursor",
|
|
17
|
+
"windsurf",
|
|
18
|
+
"ai-agents",
|
|
19
|
+
"agent-skills",
|
|
20
|
+
"agents-md",
|
|
21
|
+
"ai-security",
|
|
22
|
+
"ai-generated-code",
|
|
23
|
+
"vibe-coding",
|
|
24
|
+
"security-scanner",
|
|
25
|
+
"vulnerability-scanner",
|
|
26
|
+
"static-analysis",
|
|
27
|
+
"sast",
|
|
28
|
+
"appsec",
|
|
29
|
+
"cybersecurity",
|
|
30
|
+
"devsecops",
|
|
31
|
+
"owasp",
|
|
32
|
+
"cwe",
|
|
33
|
+
"sarif",
|
|
34
|
+
"prompt-injection",
|
|
35
|
+
"secret-scanner",
|
|
36
|
+
"secrets-detection",
|
|
37
|
+
"security-audit",
|
|
38
|
+
"supabase-rls",
|
|
39
|
+
"nextjs-security",
|
|
40
|
+
"row-level-security",
|
|
41
|
+
"sql-injection",
|
|
42
|
+
"agent-skill-audit",
|
|
43
|
+
"github-actions",
|
|
44
|
+
"code-scanning",
|
|
45
|
+
"ci-security-gate",
|
|
46
|
+
"npx",
|
|
47
|
+
"typescript",
|
|
48
|
+
"zero-dependencies"
|
|
49
|
+
],
|
|
50
|
+
"license": "MIT",
|
|
51
|
+
"author": "VibeFoundry",
|
|
52
|
+
"homepage": "https://github.com/avivgerz-hue/vibe-shield#readme",
|
|
53
|
+
"repository": {
|
|
54
|
+
"type": "git",
|
|
55
|
+
"url": "git+https://github.com/avivgerz-hue/vibe-shield.git"
|
|
56
|
+
},
|
|
57
|
+
"bugs": {
|
|
58
|
+
"url": "https://github.com/avivgerz-hue/vibe-shield/issues"
|
|
59
|
+
},
|
|
60
|
+
"main": "./dist/src/index.js",
|
|
61
|
+
"types": "./dist/src/index.d.ts",
|
|
62
|
+
"bin": {
|
|
63
|
+
"vibe-shield": "dist/bin/vibe-shield.js"
|
|
64
|
+
},
|
|
65
|
+
"files": [
|
|
66
|
+
"dist/bin",
|
|
67
|
+
"dist/src",
|
|
68
|
+
"SKILL.md",
|
|
69
|
+
"README.md",
|
|
70
|
+
"SECURITY.md",
|
|
71
|
+
"LICENSE"
|
|
72
|
+
],
|
|
73
|
+
"engines": {
|
|
74
|
+
"node": ">=18.17.0"
|
|
75
|
+
},
|
|
76
|
+
"scripts": {
|
|
77
|
+
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
78
|
+
"build": "npm run clean && tsc -p tsconfig.build.json && node scripts/postbuild.mjs",
|
|
79
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
80
|
+
"test": "vitest run",
|
|
81
|
+
"test:watch": "vitest",
|
|
82
|
+
"coverage": "vitest run --coverage",
|
|
83
|
+
"scan:self": "node dist/bin/vibe-shield.js scan",
|
|
84
|
+
"audit:self": "node dist/bin/vibe-shield.js audit-skills",
|
|
85
|
+
"verify": "npm run typecheck && npm run build && npm test && npm run scan:self && npm run audit:self",
|
|
86
|
+
"prepare": "node scripts/prepare.mjs",
|
|
87
|
+
"prepublishOnly": "npm run verify"
|
|
88
|
+
},
|
|
89
|
+
"dependencies": {},
|
|
90
|
+
"devDependencies": {
|
|
91
|
+
"@types/node": "^22.20.5",
|
|
92
|
+
"@vitest/coverage-v8": "^5.1.0",
|
|
93
|
+
"typescript": "^5.9.3",
|
|
94
|
+
"vitest": "^5.1.0"
|
|
95
|
+
},
|
|
96
|
+
"publishConfig": {
|
|
97
|
+
"access": "public"
|
|
98
|
+
}
|
|
99
|
+
}
|