guardvibe 3.0.37 → 3.0.38
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.
|
@@ -618,10 +618,17 @@ export function analyzeCode(code, language, framework, filePath, configDir, rule
|
|
|
618
618
|
continue;
|
|
619
619
|
}
|
|
620
620
|
// Skip VG106 for non-secret variable names (TokenCount, tokenBalance, hashMap, etc.)
|
|
621
|
+
// and for comparisons against literals/null/undefined that are emptiness checks,
|
|
622
|
+
// not timing-sensitive secret equality (e.g. token !== '' or apiKey == null).
|
|
621
623
|
if (rule.id === "VG106") {
|
|
622
624
|
const varName = match[0].split(/\s*(?:===|!==|==|!=)/)[0].trim();
|
|
623
625
|
if (/(?:Count|Length|Balance|Map|List|Array|Index|Size|Total|Num|Id|Type|Name|Status|Data|Info|Error|Result|Response|Config|Option|Url|Path|Provider|Model|Limit|Quota|Rate|Max|Min)/i.test(varName))
|
|
624
626
|
continue;
|
|
627
|
+
// Look at what comes after the operator. If it's a string literal, null, undefined,
|
|
628
|
+
// or a number — this is an emptiness/type check, not a secret comparison.
|
|
629
|
+
const afterOp = code.substring(match.index + match[0].length).trimStart();
|
|
630
|
+
if (/^(?:''|""|``|null\b|undefined\b|\d|0x|true\b|false\b)/.test(afterOp))
|
|
631
|
+
continue;
|
|
625
632
|
}
|
|
626
633
|
// Skip VG1005 (.or() filter injection) when all interpolated variables are
|
|
627
634
|
// server-verified auth IDs (user.id, session.user.id, auth.uid, currentUser.id)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "guardvibe",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.38",
|
|
4
4
|
"mcpName": "io.github.goklab/guardvibe",
|
|
5
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",
|