guardvibe 3.0.32 → 3.0.34

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 CHANGED
@@ -6,7 +6,7 @@
6
6
  [![npm provenance](https://img.shields.io/badge/provenance-verified-brightgreen)](https://www.npmjs.com/package/guardvibe)
7
7
  [![codecov](https://codecov.io/gh/goklab/guardvibe/graph/badge.svg)](https://codecov.io/gh/goklab/guardvibe)
8
8
 
9
- **The security MCP built for vibe coding.** 365 security rules, 36 tools covering the entire AI-generated code journey — from first line to production deployment.
9
+ **The security MCP built for vibe coding.** 365 security rules, 38 tools covering the entire AI-generated code journey — from first line to production deployment.
10
10
 
11
11
  Works with **Claude Code, Cursor, Gemini CLI, Codex, VS Code (Copilot), Windsurf**, and any MCP-compatible coding agent.
12
12
 
@@ -14,7 +14,7 @@ Works with **Claude Code, Cursor, Gemini CLI, Codex, VS Code (Copilot), Windsurf
14
14
 
15
15
  Most security tools are built for enterprise security teams. GuardVibe is built for **you** — the developer using AI to build and ship web apps fast.
16
16
 
17
- - **365 security rules, 36 tools** purpose-built for the stacks AI agents generate
17
+ - **365 security rules, 38 tools** purpose-built for the stacks AI agents generate
18
18
  - **Zero setup friction** — `npx guardvibe` and you're scanning
19
19
  - **No account required** — runs 100% locally, no API keys, no cloud
20
20
  - **Understands your stack** — not generic SAST, but rules that know Next.js, Supabase, Stripe, Clerk, and the tools you actually use
@@ -440,9 +440,10 @@ Tested on real AI-built projects (837 files, Next.js + Supabase + Clerk):
440
440
  If your AI agent cannot connect to GuardVibe:
441
441
 
442
442
  1. **Restart your IDE/agent.** MCP servers are started by the host application. After running `npx guardvibe init`, restart Claude Code, Cursor, or Gemini CLI for the config to take effect.
443
- 2. **Check the config path.** Run `npx guardvibe init claude` again and verify the output shows the correct config file location (`.claude.json` in your project root for Claude Code, `.cursor/mcp.json` for Cursor).
444
- 3. **Verify Node.js version.** GuardVibe requires Node.js >= 18.0.0. Check with `node --version`.
445
- 4. **Check npx cache.** If you upgraded GuardVibe and the old version is cached, run `npx -y guardvibe@latest` to force the latest version.
443
+ 2. **Check the config path.** Run `npx guardvibe init claude` again and verify the output shows the correct config file location (`.mcp.json` in your project root for Claude Code, `.cursor/mcp.json` for Cursor).
444
+ 3. **Re-run `init` to upgrade.** When upgrading GuardVibe, re-run `npx guardvibe init claude` — `.mcp.json` is pinned to a specific version (e.g. `guardvibe@3.0.33`) at init time for fast deterministic startup. Stale pins won't auto-update.
445
+ 4. **Verify Node.js version.** GuardVibe requires Node.js >= 18.0.0. Check with `node --version`.
446
+ 5. **Check npx cache.** If you upgraded GuardVibe and the old version is cached, run `npx -y guardvibe@latest` to force the latest version.
446
447
 
447
448
  ### Node.js version requirements
448
449
 
@@ -127,7 +127,7 @@ export const complianceMetadata = {
127
127
  exploit: "Server Action returns full database objects including sensitive fields (passwordHash, internalNotes). Client receives all data in the response.",
128
128
  audit: "Review Server Action return values. Verify select/pick is used to return only necessary fields.",
129
129
  },
130
- // === AUTH RULES (VG420-VG430) ===
130
+ // === AUTH RULES (VG420-VG449) ===
131
131
  VG420: {
132
132
  gdpr: ["GDPR:Art32(1)(b)", "GDPR:Art32(1)(d)"],
133
133
  iso27001: ["ISO27001:A.5.15", "ISO27001:A.8.5"],
@@ -113,7 +113,7 @@ export const authRules = [
113
113
  compliance: ["SOC2:CC6.1"],
114
114
  },
115
115
  {
116
- id: "VG430",
116
+ id: "VG449",
117
117
  name: "Clerk SSRF via clerkFrontendApiProxy",
118
118
  severity: "critical",
119
119
  owasp: "A10:2025 Server-Side Request Forgery",
@@ -29,7 +29,7 @@ export const dockerfileRules = [
29
29
  severity: "medium",
30
30
  owasp: "A03:2025 Software Supply Chain Failures",
31
31
  description: "Using :latest tag or no tag makes builds non-reproducible and vulnerable to supply chain attacks.",
32
- pattern: /FROM\s+\S+(?::latest\s|(?!:)\s)/gi,
32
+ pattern: /^FROM\s+[^\s:@]+(?::latest)?(?=\s)/gim,
33
33
  languages: ["dockerfile"],
34
34
  fix: "Pin to a specific version tag: FROM node:20-alpine instead of FROM node:latest.",
35
35
  fixCode: "# Pin to specific version\nFROM node:20-alpine\n# Not: FROM node:latest\n# Not: FROM node",
@@ -179,7 +179,7 @@ export const webSecurityRules = [
179
179
  severity: "high",
180
180
  owasp: "A05:2021 Security Misconfiguration",
181
181
  description: "Response serving user-uploaded files does not set X-Content-Type-Options: nosniff. Browsers may MIME-sniff the content and execute uploaded files as HTML/JavaScript, enabling stored XSS via file uploads.",
182
- pattern: /(?:createReadStream|sendFile|send\s*\(|pipe\s*\(|res\.download|res\.sendFile|getSignedUrl|getPublicUrl)[\s\S]{0,500}?(?:(?!X-Content-Type-Options|nosniff)[\s\S]){10,}?(?:res\.end|\.pipe|return|response)/gi,
182
+ pattern: /(?:res\.sendFile|res\.download|createReadStream|getSignedUrl|getPublicUrl|\.pipe\s*\(\s*res)[\s\S]{0,500}?(?:(?!X-Content-Type-Options|nosniff)[\s\S]){10,}?(?:res\.end|\.pipe|return|response)/gi,
183
183
  languages: ["javascript", "typescript"],
184
184
  fix: "Set X-Content-Type-Options: nosniff on all responses serving user-uploaded content.",
185
185
  fixCode: '// Set nosniff header for uploaded file responses\nres.setHeader("X-Content-Type-Options", "nosniff");\nres.setHeader("Content-Disposition", "attachment"); // force download for unknown types\nres.sendFile(filePath);',
package/build/index.js CHANGED
@@ -60,7 +60,7 @@ function mergeStatsIntoOutput(results, summary, format) {
60
60
  const server = new McpServer({
61
61
  name: "guardvibe",
62
62
  version: pkg.version,
63
- description: "Security MCP for vibe coding — single source of truth for AI assistants. 365 security rules and 36 tools. Use full_audit for a comprehensive PASS/FAIL/WARN verdict with deterministic result hash, coverage %, and unified report across code, secrets, dependencies, config, taint analysis, and auth coverage. IMPORTANT: When full_audit returns FAIL/WARN, call remediation_plan to get a mandatory section-by-section fix checklist covering ALL 6 sections (not just code). After fixing, call verify_remediation to confirm all sections were addressed. Same code = same hash = same results regardless of which AI assistant runs it. Covers OWASP, Next.js, Supabase, Stripe, Clerk, Prisma, Hono, AI SDK, MCP server security, host hardening. Maps to SOC2, PCI-DSS, HIPAA, GDPR, ISO27001, EU AI Act. Runs 100% locally with zero configuration.",
63
+ description: "Security MCP for vibe coding — single source of truth for AI assistants. 365 security rules and 38 tools. Use full_audit for a comprehensive PASS/FAIL/WARN verdict with deterministic result hash, coverage %, and unified report across code, secrets, dependencies, config, taint analysis, and auth coverage. IMPORTANT: When full_audit returns FAIL/WARN, call remediation_plan to get a mandatory section-by-section fix checklist covering ALL 6 sections (not just code). After fixing, call verify_remediation to confirm all sections were addressed. Same code = same hash = same results regardless of which AI assistant runs it. Covers OWASP, Next.js, Supabase, Stripe, Clerk, Prisma, Hono, AI SDK, MCP server security, host hardening. Maps to SOC2, PCI-DSS, HIPAA, GDPR, ISO27001, EU AI Act. Runs 100% locally with zero configuration.",
64
64
  });
65
65
  // Tool 1: Analyze code for security vulnerabilities
66
66
  server.tool("check_code", "Analyze inline code for security vulnerabilities (OWASP Top 10, XSS, SQL injection, insecure patterns). Pass code as a string parameter. For scanning files on disk, use scan_file instead. Example: check_code({code: 'app.get(...)', language: 'javascript'})", {
@@ -606,7 +606,8 @@ export function analyzeCode(code, language, framework, filePath, configDir, rule
606
606
  const hasPublishingFields = /"(?:bin|exports|module|types|typings)"\s*:/i.test(code);
607
607
  const mainPointsToBuild = /"main"\s*:\s*"(?:dist|build|lib|out)\//i.test(code);
608
608
  const runtimeNames = "node|nodemon|tsx|ts-node|next|nest|vite|remix|astro";
609
- const startsAsApp = new RegExp('"start"\\s*:\\s*"(?:' + runtimeNames + ')\\b', "i").test(code);
609
+ // Allow leading env-var assignments: NODE_OPTIONS=..., NODE_ENV=production, PORT=3000, etc.
610
+ const startsAsApp = new RegExp('"start"\\s*:\\s*"(?:[A-Z_][A-Z0-9_]*=\\S+\\s+)*(?:' + runtimeNames + ')\\b', "i").test(code);
610
611
  if (!hasPublishingFields && !mainPointsToBuild && startsAsApp)
611
612
  continue;
612
613
  }
@@ -744,6 +745,12 @@ function isDuplicatePair(a, b) {
744
745
  const bIsAdmin = adminPatterns.some(p => b.rule.name.includes(p));
745
746
  if (aIsAdmin && bIsAdmin)
746
747
  return true;
748
+ // Both are open-redirect rules — VG101 (core) + VG409 (nextjs) duplicate case
749
+ const redirectPatterns = ["Unvalidated redirect", "Open Redirect"];
750
+ const aIsRedirect = redirectPatterns.some(p => a.rule.name.includes(p));
751
+ const bIsRedirect = redirectPatterns.some(p => b.rule.name.includes(p));
752
+ if (aIsRedirect && bIsRedirect)
753
+ return true;
747
754
  return false;
748
755
  }
749
756
  /** Check if rule A is more specific than rule B (framework rules > core rules). */
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "guardvibe",
3
- "version": "3.0.32",
3
+ "version": "3.0.34",
4
4
  "mcpName": "io.github.goklab/guardvibe",
5
- "description": "Security MCP for vibe coding. 365 rules, 36 tools, CLI + doctor. Host security, auth coverage mapping, LLM-powered deep scan (IDOR/business logic), taint analysis. Plus Next.js, Supabase, Clerk, Stripe, Prisma, tRPC, Hono, GraphQL, Convex, Turso, Uploadthing, AI SDK, and the full AI-generated stack.",
5
+ "description": "Security MCP for vibe coding. 365 rules, 38 tools, CLI + doctor. Host security, auth coverage mapping, LLM-powered deep scan (IDOR/business logic), taint analysis. Plus Next.js, Supabase, Clerk, Stripe, Prisma, tRPC, Hono, GraphQL, Convex, Turso, Uploadthing, AI SDK, and the full AI-generated stack.",
6
6
  "type": "module",
7
7
  "bin": {
8
8
  "guardvibe": "build/cli.js",