guardvibe 3.1.19 → 3.1.20

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.
@@ -417,6 +417,13 @@ export function analyzeCode(code, language, framework, filePath, configDir, rule
417
417
  // Server-side batch context: scripts, migrations, seeds. These run offline or
418
418
  // on-deploy, not against user requests, so DoS-from-unbounded-results doesn't apply.
419
419
  const isBatchScriptFile = filePath && /\/(?:scripts?|migrations?|seeds?|fixtures?)\//i.test(filePath);
420
+ // Code-generator/scaffold templates. CLI tools (create-t3-app, create-next-app,
421
+ // create-react-app, etc.) bundle "Hello World" example files under cli/template/
422
+ // or templates/ that are intentionally minimal — no auth, no input validation,
423
+ // no rate limiting. These get copied into user projects where the user is
424
+ // expected to customize them. Flagging them in the CLI tool's own audit produces
425
+ // noise without surfacing real production risk.
426
+ const isTemplateFile = filePath && /\/(?:templates?|scaffolds?|stubs?|boilerplate)\//i.test(filePath);
420
427
  // Skip rate-limit rules when the file installs a global rate limiter via app.use().
421
428
  // Covers `app.use(rateLimit({...}))`, `app.use(limiter)`, `app.use('/api', rateLimit({...}))`,
422
429
  // and named middleware vars matching limiter naming conventions.
@@ -490,6 +497,11 @@ export function analyzeCode(code, language, framework, filePath, configDir, rule
490
497
  // request handler to authorize. Rule still fires inside route handlers and Server Actions.
491
498
  if (rule.id === "VG1008" && isBatchScriptFile)
492
499
  continue;
500
+ // Skip tRPC educational/scaffold rules (VG970 publicProcedure-DB, VG971 missing-input)
501
+ // in template/scaffold files. CLI tools like create-t3-app ship intentionally simple
502
+ // examples under cli/template/ that the user is expected to replace before deploying.
503
+ if ((rule.id === "VG970" || rule.id === "VG971") && isTemplateFile)
504
+ continue;
493
505
  // Skip VG961 (z.any/z.unknown) in batch scripts and cron routes — `data: z.any()` and
494
506
  // similar opaque fields in migration/seed scripts and cron job payloads are intentional
495
507
  // passthroughs (e.g. Tinybird `tb.buildPipe({ parameters: ..., data: z.any() })`),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "guardvibe",
3
- "version": "3.1.19",
3
+ "version": "3.1.20",
4
4
  "mcpName": "io.github.goklab/guardvibe",
5
5
  "description": "Security MCP for vibe coding. 390 rules, 36 tools, CLI + doctor. Host security, auth coverage mapping, LLM-powered deep scan (IDOR/business logic), taint analysis, +25 AI-native rules (MCP supply-chain, RAG/vector poisoning, agent loop DoS, public-prefix LLM keys, sandbox bypass). 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",