eslint-plugin-ai-guard 1.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/LICENSE +21 -0
- package/README.md +166 -0
- package/dist/index.d.mts +89 -0
- package/dist/index.d.ts +89 -0
- package/dist/index.js +928 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +898 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/rules/error-handling/no-empty-catch.ts","../src/rules/error-handling/no-broad-exception.ts","../src/rules/async/no-async-array-callback.ts","../src/rules/async/no-floating-promise.ts","../src/rules/async/no-await-in-loop.ts","../src/rules/security/no-hardcoded-secret.ts","../src/rules/security/no-eval-dynamic.ts","../src/rules/security/no-sql-string-concat.ts","../src/rules/security/require-auth-middleware.ts","../src/rules/index.ts","../src/configs/recommended.ts","../src/configs/strict.ts","../src/configs/security.ts"],"sourcesContent":["import { allRules } from './rules';\r\nimport recommended from './configs/recommended';\r\nimport strict from './configs/strict';\r\nimport security from './configs/security';\r\n\r\nconst plugin = {\r\n meta: {\r\n name: 'eslint-plugin-ai-guard',\r\n version: '1.0.0',\r\n },\r\n rules: allRules,\r\n configs: {\r\n recommended,\r\n strict,\r\n security,\r\n },\r\n};\r\n\r\nexport default plugin;\r\nexport { allRules as rules };\r\nexport { recommended, strict, security };\r\n","import { ESLintUtils } from '@typescript-eslint/utils';\r\n\r\nconst createRule = ESLintUtils.RuleCreator(\r\n (name) => `https://github.com/YashJadhav21/eslint-plugin-ai-guard/blob/main/docs/rules/${name}.md`\r\n);\r\n\r\nexport const noEmptyCatch = createRule({\r\n name: 'no-empty-catch',\r\n meta: {\r\n type: 'problem',\r\n docs: {\r\n description:\r\n 'Disallow empty catch blocks. AI tools frequently generate try/catch with empty catch bodies that silently swallow errors, hiding failures in production.',\r\n },\r\n fixable: undefined,\r\n schema: [],\r\n messages: {\r\n emptyCatch:\r\n 'Catch block is empty. AI tools frequently generate empty catch blocks that silently swallow errors. Handle the error (log, rethrow, or recover), or add a comment explaining why it is intentionally empty.',\r\n },\r\n },\r\n defaultOptions: [],\r\n create(context) {\r\n return {\r\n CatchClause(node) {\r\n // Flag catch clauses where the body block has zero statements\r\n if (node.body.body.length === 0) {\r\n // Check if there is a comment inside the catch block — if so, the developer\r\n // intentionally left it empty with a reason, so we don't flag it.\r\n const sourceCode = context.sourceCode;\r\n const comments = sourceCode.getCommentsInside(node.body);\r\n if (comments.length > 0) {\r\n return;\r\n }\r\n\r\n context.report({\r\n node,\r\n messageId: 'emptyCatch',\r\n });\r\n }\r\n },\r\n };\r\n },\r\n});\r\n\r\nexport default noEmptyCatch;\r\n","import { ESLintUtils, AST_NODE_TYPES } from '@typescript-eslint/utils';\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/YashJadhav21/eslint-plugin-ai-guard/blob/main/docs/rules/${name}.md`\n);\n\nexport const noBroadException = createRule({\n name: 'no-broad-exception',\n meta: {\n type: 'suggestion',\n docs: {\n description:\n 'Disallow overly broad catch clause types such as `catch (e: any)` or `catch (e: unknown)` without narrowing. AI tools frequently use `any` type annotations on catch parameters, hiding the actual error type and preventing proper error handling.',\n },\n fixable: undefined,\n schema: [],\n messages: {\n broadException:\n 'Catch parameter has an overly broad type annotation `{{type}}`. AI tools frequently generate `catch (e: any)` which hides the real error type. Use a specific error type or narrow with `instanceof` checks inside the catch block.',\n },\n },\n defaultOptions: [],\n create(context) {\n return {\n CatchClause(node) {\n const param = node.param;\n if (!param) return;\n\n // Check for explicit type annotation: catch (e: any), catch (e: unknown)\n if (\n param.type === AST_NODE_TYPES.Identifier &&\n param.typeAnnotation &&\n param.typeAnnotation.typeAnnotation\n ) {\n const typeAnnotation = param.typeAnnotation.typeAnnotation;\n\n // catch (e: any)\n if (typeAnnotation.type === AST_NODE_TYPES.TSAnyKeyword) {\n context.report({\n node: param,\n messageId: 'broadException',\n data: { type: 'any' },\n });\n return;\n }\n\n // catch (e: unknown) — only flag if the parameter is never narrowed in the body\n if (typeAnnotation.type === AST_NODE_TYPES.TSUnknownKeyword) {\n // Check if the catch body contains instanceof checks or type guards\n const hasNarrowing = checkForNarrowing(node, param.name);\n if (!hasNarrowing) {\n context.report({\n node: param,\n messageId: 'broadException',\n data: { type: 'unknown' },\n });\n }\n }\n }\n },\n };\n },\n});\n\n/**\n * Check if the catch block body contains instanceof checks or other narrowing\n * patterns for the given parameter name.\n */\nfunction checkForNarrowing(\n catchClause: { body: { body: readonly { type: string; [key: string]: any }[] } },\n paramName: string\n): boolean {\n const bodyStatements = catchClause.body.body;\n\n for (const stmt of bodyStatements) {\n if (containsInstanceofCheck(stmt, paramName)) {\n return true;\n }\n }\n return false;\n}\n\nfunction containsInstanceofCheck(node: any, paramName: string): boolean {\n if (!node || typeof node !== 'object') return false;\n\n // Check for: e instanceof SomeError\n if (\n node.type === AST_NODE_TYPES.BinaryExpression &&\n node.operator === 'instanceof' &&\n node.left?.type === AST_NODE_TYPES.Identifier &&\n node.left.name === paramName\n ) {\n return true;\n }\n\n // Recurse into child nodes\n for (const key of Object.keys(node)) {\n if (key === 'parent') continue;\n const child = node[key];\n if (Array.isArray(child)) {\n for (const item of child) {\n if (containsInstanceofCheck(item, paramName)) return true;\n }\n } else if (child && typeof child === 'object' && child.type) {\n if (containsInstanceofCheck(child, paramName)) return true;\n }\n }\n return false;\n}\n\nexport default noBroadException;\n","import { ESLintUtils, AST_NODE_TYPES } from '@typescript-eslint/utils';\r\nimport type { TSESTree } from '@typescript-eslint/utils';\r\n\r\nconst createRule = ESLintUtils.RuleCreator(\r\n (name) => `https://github.com/YashJadhav21/eslint-plugin-ai-guard/blob/main/docs/rules/${name}.md`\r\n);\r\n\r\nconst ARRAY_CALLBACK_METHODS = ['map', 'filter', 'forEach', 'reduce', 'flatMap', 'find', 'findIndex', 'some', 'every'] as const;\r\n\r\nconst PROMISE_COMBINATORS = ['all', 'allSettled', 'race', 'any'] as const;\r\n\r\n/**\r\n * Checks if the given CallExpression (e.g., arr.map(...)) is used as an argument\r\n * to Promise.all(), Promise.allSettled(), Promise.race(), or Promise.any().\r\n */\r\nfunction isWrappedInPromiseCombinator(\r\n node: TSESTree.CallExpression,\r\n context: Readonly<Parameters<ReturnType<typeof createRule>['create']>[0]>\r\n): boolean {\r\n const ancestors = context.sourceCode.getAncestors(node);\r\n // The immediate parent should be a CallExpression with callee Promise.all/etc.\r\n for (let i = ancestors.length - 1; i >= 0; i--) {\r\n const ancestor = ancestors[i];\r\n if (\r\n ancestor.type === AST_NODE_TYPES.CallExpression &&\r\n ancestor.callee.type === AST_NODE_TYPES.MemberExpression &&\r\n ancestor.callee.object.type === AST_NODE_TYPES.Identifier &&\r\n ancestor.callee.object.name === 'Promise' &&\r\n ancestor.callee.property.type === AST_NODE_TYPES.Identifier &&\r\n PROMISE_COMBINATORS.includes(\r\n ancestor.callee.property.name as (typeof PROMISE_COMBINATORS)[number]\r\n )\r\n ) {\r\n return true;\r\n }\r\n // Only look up to the immediate call expression ancestor, not further\r\n if (ancestor.type === AST_NODE_TYPES.CallExpression) {\r\n break;\r\n }\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * Checks if a node is an async function expression or arrow function.\r\n */\r\nfunction isAsyncCallback(node: TSESTree.Node): boolean {\r\n return (\r\n (node.type === AST_NODE_TYPES.FunctionExpression ||\r\n node.type === AST_NODE_TYPES.ArrowFunctionExpression) &&\r\n node.async\r\n );\r\n}\r\n\r\nexport const noAsyncArrayCallback = createRule({\r\n name: 'no-async-array-callback',\r\n meta: {\r\n type: 'problem',\r\n docs: {\r\n description:\r\n 'Disallow async callbacks in array iteration methods (map, filter, forEach, reduce). AI tools generate `array.map(async ...)` which returns `Promise[]` instead of resolved values — a silent bug.',\r\n },\r\n fixable: undefined,\r\n schema: [],\r\n messages: {\r\n asyncArrayCallback:\r\n 'Async callback passed to Array.{{method}}(). This returns an array of Promises, not resolved values. AI tools frequently generate this pattern. Wrap with `await Promise.all(array.{{method}}(...))` or use a for...of loop.',\r\n },\r\n },\r\n defaultOptions: [],\r\n create(context) {\r\n return {\r\n CallExpression(node) {\r\n // Check if this is a method call like something.map(...), something.filter(...), etc.\r\n if (\r\n node.callee.type !== AST_NODE_TYPES.MemberExpression ||\r\n node.callee.property.type !== AST_NODE_TYPES.Identifier\r\n ) {\r\n return;\r\n }\r\n\r\n const methodName = node.callee.property.name;\r\n\r\n if (\r\n !ARRAY_CALLBACK_METHODS.includes(\r\n methodName as (typeof ARRAY_CALLBACK_METHODS)[number]\r\n )\r\n ) {\r\n return;\r\n }\r\n\r\n // The callback is the first argument for all methods except reduce where it's also the first\r\n const callback = node.arguments[0];\r\n if (!callback) {\r\n return;\r\n }\r\n\r\n if (isAsyncCallback(callback)) {\r\n // Don't flag if the array method call is already wrapped in Promise.all/allSettled/race/any\r\n // e.g., Promise.all(arr.map(async ...)) — this is the correct pattern\r\n if (isWrappedInPromiseCombinator(node, context)) {\r\n return;\r\n }\r\n\r\n context.report({\r\n node: callback,\r\n messageId: 'asyncArrayCallback',\r\n data: {\r\n method: methodName,\r\n },\r\n });\r\n }\r\n },\r\n };\r\n },\r\n});\r\n\r\nexport default noAsyncArrayCallback;\r\n","import { ESLintUtils, AST_NODE_TYPES } from '@typescript-eslint/utils';\r\nimport type { TSESTree } from '@typescript-eslint/utils';\r\n\r\nconst createRule = ESLintUtils.RuleCreator(\r\n (name) => `https://github.com/YashJadhav21/eslint-plugin-ai-guard/blob/main/docs/rules/${name}.md`\r\n);\r\n\r\n/**\r\n * Heuristic: checks if a function name or callee suggests it returns a Promise.\r\n * This is a naming-convention-based approach for MVP (no type-checker needed).\r\n */\r\nfunction looksLikeAsyncCall(node: TSESTree.CallExpression): boolean {\r\n // Direct call: fetchData(), loadUser(), etc.\r\n if (node.callee.type === AST_NODE_TYPES.Identifier) {\r\n return hasAsyncishName(node.callee.name);\r\n }\r\n\r\n // Method call: this.fetchData(), service.loadUser(), etc.\r\n if (\r\n node.callee.type === AST_NODE_TYPES.MemberExpression &&\r\n node.callee.property.type === AST_NODE_TYPES.Identifier\r\n ) {\r\n return hasAsyncishName(node.callee.property.name);\r\n }\r\n\r\n return false;\r\n}\r\n\r\n/**\r\n * Heuristic naming patterns for async functions.\r\n * Common prefixes/names used by both humans and AI for async operations.\r\n */\r\nfunction hasAsyncishName(name: string): boolean {\r\n const lower = name.toLowerCase();\r\n return (\r\n lower.startsWith('fetch') ||\r\n lower.startsWith('load') ||\r\n lower.startsWith('save') ||\r\n lower.startsWith('delete') ||\r\n lower.startsWith('create') ||\r\n lower.startsWith('update') ||\r\n lower.startsWith('get') ||\r\n lower.startsWith('post') ||\r\n lower.startsWith('put') ||\r\n lower.startsWith('patch') ||\r\n lower.startsWith('send') ||\r\n lower.startsWith('upload') ||\r\n lower.startsWith('download') ||\r\n lower.startsWith('connect') ||\r\n lower.startsWith('disconnect') ||\r\n lower.startsWith('subscribe') ||\r\n lower.startsWith('publish') ||\r\n lower.startsWith('request') ||\r\n lower.startsWith('query') ||\r\n lower === 'axios' ||\r\n lower === 'fetch'\r\n );\r\n}\r\n\r\n/**\r\n * Check if a CallExpression's callee is known to be async — either via:\r\n * 1. The callee is defined as an async function in the current scope\r\n * 2. The callee name matches naming heuristics\r\n */\r\nfunction isCalleeAsync(\r\n node: TSESTree.CallExpression,\r\n asyncFunctionNames: Set<string>\r\n): boolean {\r\n // If the callee is an identifier and we've seen it declared as async\r\n if (node.callee.type === AST_NODE_TYPES.Identifier) {\r\n if (asyncFunctionNames.has(node.callee.name)) {\r\n return true;\r\n }\r\n }\r\n\r\n // Fall back to naming heuristics\r\n return looksLikeAsyncCall(node);\r\n}\r\n\r\n/**\r\n * Check if the ExpressionStatement is already handled:\r\n * - Used as argument to .then() or .catch()\r\n * - Inside an await\r\n * - Piped to void\r\n * - Result is assigned\r\n */\r\nfunction isExpressionHandled(node: TSESTree.ExpressionStatement): boolean {\r\n const expr = node.expression;\r\n\r\n // Check if the expression is a call chained with .then() or .catch()\r\n if (expr.type === AST_NODE_TYPES.CallExpression) {\r\n if (expr.callee.type === AST_NODE_TYPES.MemberExpression) {\r\n const prop = expr.callee.property;\r\n if (prop.type === AST_NODE_TYPES.Identifier) {\r\n if (prop.name === 'then' || prop.name === 'catch' || prop.name === 'finally') {\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // void operator suppresses the warning intentionally\r\n if (expr.type === AST_NODE_TYPES.UnaryExpression && expr.operator === 'void') {\r\n return true;\r\n }\r\n\r\n return false;\r\n}\r\n\r\nexport const noFloatingPromise = createRule({\r\n name: 'no-floating-promise',\r\n meta: {\r\n type: 'problem',\r\n docs: {\r\n description:\r\n 'Disallow calling an async function or Promise-returning function without awaiting or handling the result. AI tools frequently generate floating promises where errors disappear silently.',\r\n },\r\n fixable: undefined,\r\n schema: [],\r\n messages: {\r\n floatingPromise:\r\n 'This async call is not awaited, returned, or error-handled (.catch). AI tools frequently generate floating promises, causing errors to be silently lost. Add `await`, `.catch()`, or assign the result.',\r\n },\r\n },\r\n defaultOptions: [],\r\n create(context) {\r\n // Track function names declared with `async` keyword in the current file\r\n const asyncFunctionNames = new Set<string>();\r\n\r\n return {\r\n // Track async function declarations\r\n FunctionDeclaration(node) {\r\n if (node.async && node.id) {\r\n asyncFunctionNames.add(node.id.name);\r\n }\r\n },\r\n\r\n // Track async arrow functions assigned to variables\r\n VariableDeclarator(node) {\r\n if (\r\n node.init &&\r\n (node.init.type === AST_NODE_TYPES.ArrowFunctionExpression ||\r\n node.init.type === AST_NODE_TYPES.FunctionExpression) &&\r\n node.init.async &&\r\n node.id.type === AST_NODE_TYPES.Identifier\r\n ) {\r\n asyncFunctionNames.add(node.id.name);\r\n }\r\n },\r\n\r\n // Check ExpressionStatements — standalone call expressions\r\n ExpressionStatement(node) {\r\n // We only care about bare CallExpression statements\r\n if (node.expression.type !== AST_NODE_TYPES.CallExpression) {\r\n return;\r\n }\r\n\r\n // If it's already chained with .then()/.catch() or wrapped in void, skip\r\n if (isExpressionHandled(node)) {\r\n return;\r\n }\r\n\r\n const callExpr = node.expression;\r\n\r\n // Check if the callee is async\r\n if (isCalleeAsync(callExpr, asyncFunctionNames)) {\r\n context.report({\r\n node,\r\n messageId: 'floatingPromise',\r\n });\r\n }\r\n },\r\n };\r\n },\r\n});\r\n\r\nexport default noFloatingPromise;\r\n","import { ESLintUtils, AST_NODE_TYPES } from '@typescript-eslint/utils';\nimport type { TSESTree } from '@typescript-eslint/utils';\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/YashJadhav21/eslint-plugin-ai-guard/blob/main/docs/rules/${name}.md`\n);\n\nconst LOOP_TYPES = new Set([\n AST_NODE_TYPES.ForStatement,\n AST_NODE_TYPES.ForInStatement,\n AST_NODE_TYPES.ForOfStatement,\n AST_NODE_TYPES.WhileStatement,\n AST_NODE_TYPES.DoWhileStatement,\n]);\n\nexport const noAwaitInLoop = createRule({\n name: 'no-await-in-loop',\n meta: {\n type: 'suggestion',\n docs: {\n description:\n 'Disallow `await` inside loops. AI tools frequently generate sequential awaits inside for/while loops where `Promise.all()` would be more efficient and correct. Each iteration waits for the previous one to complete, causing O(n) latency instead of O(1).',\n },\n fixable: undefined,\n schema: [],\n messages: {\n awaitInLoop:\n 'Unexpected `await` inside a {{loopType}}. AI tools frequently generate sequential awaits in loops, causing O(n) latency. Consider collecting promises and using `Promise.all()` for parallel execution.',\n },\n },\n defaultOptions: [],\n create(context) {\n /**\n * Track ancestor scope boundaries (functions) so we don't flag await\n * expressions inside a nested async function that happens to be inside a loop.\n */\n const functionBoundary: TSESTree.Node[] = [];\n\n function enterFunction(node: TSESTree.Node) {\n functionBoundary.push(node);\n }\n function exitFunction() {\n functionBoundary.pop();\n }\n\n return {\n FunctionDeclaration: enterFunction,\n FunctionExpression: enterFunction,\n ArrowFunctionExpression: enterFunction,\n 'FunctionDeclaration:exit': exitFunction,\n 'FunctionExpression:exit': exitFunction,\n 'ArrowFunctionExpression:exit': exitFunction,\n\n AwaitExpression(node) {\n // Walk up ancestors looking for a loop, but stop at any function boundary\n const ancestors = context.sourceCode.getAncestors(node);\n const currentFunction = functionBoundary[functionBoundary.length - 1];\n\n for (let i = ancestors.length - 1; i >= 0; i--) {\n const ancestor = ancestors[i];\n\n // Stop if we hit the current function boundary\n if (ancestor === currentFunction) {\n break;\n }\n\n if (LOOP_TYPES.has(ancestor.type as AST_NODE_TYPES)) {\n const loopName = getLoopName(ancestor.type as AST_NODE_TYPES);\n context.report({\n node,\n messageId: 'awaitInLoop',\n data: { loopType: loopName },\n });\n return;\n }\n }\n },\n };\n },\n});\n\nfunction getLoopName(type: AST_NODE_TYPES): string {\n switch (type) {\n case AST_NODE_TYPES.ForStatement:\n return 'for loop';\n case AST_NODE_TYPES.ForInStatement:\n return 'for...in loop';\n case AST_NODE_TYPES.ForOfStatement:\n return 'for...of loop';\n case AST_NODE_TYPES.WhileStatement:\n return 'while loop';\n case AST_NODE_TYPES.DoWhileStatement:\n return 'do...while loop';\n default:\n return 'loop';\n }\n}\n\nexport default noAwaitInLoop;\n","import { ESLintUtils, AST_NODE_TYPES } from '@typescript-eslint/utils';\nimport type { TSESTree } from '@typescript-eslint/utils';\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/YashJadhav21/eslint-plugin-ai-guard/blob/main/docs/rules/${name}.md`\n);\n\n\n\n/**\n * Variable name patterns that suggest secrets.\n */\nconst SECRET_NAME_PATTERN = /(?:secret|password|passwd|api[_-]?key|auth[_-]?token|access[_-]?token|private[_-]?key|client[_-]?secret|jwt[_-]?secret|encryption[_-]?key|signing[_-]?key)/i;\n\n/**\n * Patterns that are definitely NOT secrets — common false positives.\n */\nconst FALSE_POSITIVE_VALUES = new Set([\n 'password',\n 'secret',\n 'token',\n 'key',\n 'api_key',\n 'apikey',\n '',\n 'undefined',\n 'null',\n 'test',\n 'example',\n 'placeholder',\n 'changeme',\n 'your-api-key',\n 'your-secret',\n 'YOUR_API_KEY',\n 'YOUR_SECRET',\n 'xxx',\n 'TODO',\n]);\n\nexport const noHardcodedSecret = createRule({\n name: 'no-hardcoded-secret',\n meta: {\n type: 'problem',\n docs: {\n description:\n 'Disallow hardcoded secrets, API keys, passwords, and tokens in source code. AI tools frequently generate placeholder credentials that get committed to version control, creating security vulnerabilities.',\n },\n fixable: undefined,\n schema: [],\n messages: {\n hardcodedSecret:\n 'Possible hardcoded secret in variable `{{name}}`. AI tools frequently generate placeholder credentials that get committed to version control. Use environment variables (e.g., `process.env.{{envName}}`) instead.',\n },\n },\n defaultOptions: [],\n create(context) {\n return {\n VariableDeclarator(node) {\n // Only check: const SECRET = 'literal_value'\n if (!node.init) return;\n if (!node.id || node.id.type !== AST_NODE_TYPES.Identifier) return;\n\n const varName = node.id.name;\n\n // Check if variable name suggests a secret\n if (!SECRET_NAME_PATTERN.test(varName)) return;\n\n // Only flag string literals and template literals with no expressions\n const value = getStringValue(node.init);\n if (value === null) return;\n\n // Skip obviously fake/placeholder values\n if (FALSE_POSITIVE_VALUES.has(value)) return;\n if (value.length < 8) return;\n\n // Skip process.env references (already using env vars)\n if (isProcessEnvAccess(node.init)) return;\n\n context.report({\n node: node.init,\n messageId: 'hardcodedSecret',\n data: {\n name: varName,\n envName: toEnvVarName(varName),\n },\n });\n },\n\n // Also check: obj.secret = 'literal_value'\n AssignmentExpression(node) {\n if (node.left.type !== AST_NODE_TYPES.MemberExpression) return;\n if (node.left.property.type !== AST_NODE_TYPES.Identifier) return;\n\n const propName = node.left.property.name;\n if (!SECRET_NAME_PATTERN.test(propName)) return;\n\n const value = getStringValue(node.right);\n if (value === null) return;\n if (FALSE_POSITIVE_VALUES.has(value)) return;\n if (value.length < 8) return;\n if (isProcessEnvAccess(node.right)) return;\n\n context.report({\n node: node.right,\n messageId: 'hardcodedSecret',\n data: {\n name: propName,\n envName: toEnvVarName(propName),\n },\n });\n },\n\n // Check property assignments in object literals: { secret: 'value' }\n Property(node) {\n if (node.key.type !== AST_NODE_TYPES.Identifier) return;\n\n const propName = node.key.name;\n if (!SECRET_NAME_PATTERN.test(propName)) return;\n\n const value = getStringValue(node.value as TSESTree.Expression);\n if (value === null) return;\n if (FALSE_POSITIVE_VALUES.has(value)) return;\n if (value.length < 8) return;\n if (isProcessEnvAccess(node.value as TSESTree.Expression)) return;\n\n context.report({\n node: node.value,\n messageId: 'hardcodedSecret',\n data: {\n name: propName,\n envName: toEnvVarName(propName),\n },\n });\n },\n };\n },\n});\n\nfunction getStringValue(node: TSESTree.Expression): string | null {\n if (node.type === AST_NODE_TYPES.Literal && typeof node.value === 'string') {\n return node.value;\n }\n if (\n node.type === AST_NODE_TYPES.TemplateLiteral &&\n node.expressions.length === 0 &&\n node.quasis.length === 1\n ) {\n return node.quasis[0].value.cooked ?? null;\n }\n return null;\n}\n\nfunction isProcessEnvAccess(node: TSESTree.Expression): boolean {\n return (\n node.type === AST_NODE_TYPES.MemberExpression &&\n node.object.type === AST_NODE_TYPES.MemberExpression &&\n node.object.object.type === AST_NODE_TYPES.Identifier &&\n node.object.object.name === 'process' &&\n node.object.property.type === AST_NODE_TYPES.Identifier &&\n node.object.property.name === 'env'\n );\n}\n\nfunction toEnvVarName(name: string): string {\n // Convert camelCase/PascalCase to UPPER_SNAKE_CASE\n return name\n .replace(/([a-z])([A-Z])/g, '$1_$2')\n .replace(/[-\\s]/g, '_')\n .toUpperCase();\n}\n\nexport default noHardcodedSecret;\n","import { ESLintUtils, AST_NODE_TYPES } from '@typescript-eslint/utils';\nimport type { TSESTree } from '@typescript-eslint/utils';\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/YashJadhav21/eslint-plugin-ai-guard/blob/main/docs/rules/${name}.md`\n);\n\nexport const noEvalDynamic = createRule({\n name: 'no-eval-dynamic',\n meta: {\n type: 'problem',\n docs: {\n description:\n 'Disallow `eval()` and `new Function()` with non-literal arguments. AI tools frequently generate dynamic code evaluation patterns that create serious security vulnerabilities including code injection and XSS.',\n },\n fixable: undefined,\n schema: [],\n messages: {\n evalDynamic:\n 'Dangerous use of `{{callee}}` with a dynamic argument. AI tools frequently generate `eval()` or `new Function()` patterns that enable code injection attacks. Use safer alternatives like JSON.parse(), a lookup table, or a sandboxed evaluator.',\n newFunctionDynamic:\n 'Dangerous use of `new Function()` with a dynamic argument. AI tools frequently generate this pattern which enables arbitrary code execution. Use safer alternatives like a lookup table or pre-defined functions.',\n },\n },\n defaultOptions: [],\n create(context) {\n return {\n CallExpression(node) {\n // Check for eval(...)\n if (\n node.callee.type === AST_NODE_TYPES.Identifier &&\n node.callee.name === 'eval'\n ) {\n // Allow eval() with no args (no-op) or with only literal string args\n if (node.arguments.length === 0) return;\n\n const firstArg = node.arguments[0];\n if (isLiteral(firstArg)) return;\n\n context.report({\n node,\n messageId: 'evalDynamic',\n data: { callee: 'eval()' },\n });\n return;\n }\n\n // Check for window.eval(...) or globalThis.eval(...)\n if (\n node.callee.type === AST_NODE_TYPES.MemberExpression &&\n node.callee.property.type === AST_NODE_TYPES.Identifier &&\n node.callee.property.name === 'eval' &&\n node.callee.object.type === AST_NODE_TYPES.Identifier &&\n (node.callee.object.name === 'window' || node.callee.object.name === 'globalThis')\n ) {\n if (node.arguments.length === 0) return;\n const firstArg = node.arguments[0];\n if (isLiteral(firstArg)) return;\n\n context.report({\n node,\n messageId: 'evalDynamic',\n data: { callee: `${node.callee.object.name}.eval()` },\n });\n }\n },\n\n NewExpression(node) {\n // Check for new Function(...)\n if (\n node.callee.type === AST_NODE_TYPES.Identifier &&\n node.callee.name === 'Function'\n ) {\n if (node.arguments.length === 0) return;\n\n // All arguments must be literals to be safe\n const allLiteral = node.arguments.every(isLiteral);\n if (allLiteral) return;\n\n context.report({\n node,\n messageId: 'newFunctionDynamic',\n });\n }\n },\n };\n },\n});\n\n/**\n * Check if a node is a static literal (string, number, boolean, null, template literal with no expressions).\n */\nfunction isLiteral(node: TSESTree.Node): boolean {\n if (node.type === AST_NODE_TYPES.Literal) return true;\n if (\n node.type === AST_NODE_TYPES.TemplateLiteral &&\n node.expressions.length === 0\n ) {\n return true;\n }\n return false;\n}\n\nexport default noEvalDynamic;\n","import { ESLintUtils, AST_NODE_TYPES } from '@typescript-eslint/utils';\nimport type { TSESTree } from '@typescript-eslint/utils';\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/YashJadhav21/eslint-plugin-ai-guard/blob/main/docs/rules/${name}.md`\n);\n\n/**\n * Keywords that strongly suggest SQL query context.\n */\nconst SQL_KEYWORDS = /\\b(SELECT|INSERT|UPDATE|DELETE|DROP|CREATE|ALTER|EXEC|EXECUTE|UNION|WHERE|FROM|JOIN|INTO|VALUES|SET|TABLE|DATABASE|GRANT|REVOKE|TRUNCATE)\\b/i;\n\nexport const noSqlStringConcat = createRule({\n name: 'no-sql-string-concat',\n meta: {\n type: 'problem',\n docs: {\n description:\n 'Disallow string concatenation or interpolation with variables in SQL query contexts. AI tools frequently generate SQL queries using template literals or string concatenation with user input, creating SQL injection vulnerabilities.',\n },\n fixable: undefined,\n schema: [],\n messages: {\n sqlStringConcat:\n 'Potential SQL injection: string concatenation or interpolation detected in a SQL query. AI tools frequently generate this pattern. Use parameterized queries (e.g., `db.query(\"SELECT * FROM users WHERE id = $1\", [id])`) instead.',\n },\n },\n defaultOptions: [],\n create(context) {\n return {\n // Template literals: `SELECT * FROM users WHERE id = ${userId}`\n TemplateLiteral(node) {\n // Must have at least one expression (interpolation)\n if (node.expressions.length === 0) return;\n\n // Check if the static parts contain SQL keywords\n const staticText = node.quasis.map((q) => q.value.raw).join('');\n if (SQL_KEYWORDS.test(staticText)) {\n context.report({\n node,\n messageId: 'sqlStringConcat',\n });\n }\n },\n\n // Binary expressions: \"SELECT * FROM users WHERE id = \" + userId\n BinaryExpression(node) {\n if (node.operator !== '+') return;\n\n // Check if either side is a string literal containing SQL keywords\n const leftStr = getStringLiteralValue(node.left);\n const rightStr = getStringLiteralValue(node.right);\n\n if (\n (leftStr && SQL_KEYWORDS.test(leftStr)) ||\n (rightStr && SQL_KEYWORDS.test(rightStr))\n ) {\n // Make sure the other side is NOT a string literal (needs to be dynamic)\n const leftIsDynamic = !isStaticString(node.left);\n const rightIsDynamic = !isStaticString(node.right);\n\n if (leftIsDynamic || rightIsDynamic) {\n context.report({\n node,\n messageId: 'sqlStringConcat',\n });\n }\n }\n },\n };\n },\n});\n\nfunction getStringLiteralValue(node: TSESTree.Expression | TSESTree.PrivateIdentifier): string | null {\n if (node.type === AST_NODE_TYPES.Literal && typeof node.value === 'string') {\n return node.value;\n }\n return null;\n}\n\nfunction isStaticString(node: TSESTree.Expression | TSESTree.PrivateIdentifier): boolean {\n if (node.type === AST_NODE_TYPES.Literal && typeof node.value === 'string') {\n return true;\n }\n if (\n node.type === AST_NODE_TYPES.TemplateLiteral &&\n node.expressions.length === 0\n ) {\n return true;\n }\n return false;\n}\n\nexport default noSqlStringConcat;\n","import { ESLintUtils, AST_NODE_TYPES } from '@typescript-eslint/utils';\nimport type { TSESTree } from '@typescript-eslint/utils';\n\nconst createRule = ESLintUtils.RuleCreator(\n (name) => `https://github.com/YashJadhav21/eslint-plugin-ai-guard/blob/main/docs/rules/${name}.md`\n);\n\n/**\n * HTTP methods that define routes in Express/Fastify.\n */\nconst HTTP_METHODS = new Set([\n 'get', 'post', 'put', 'patch', 'delete', 'all', 'options', 'head',\n]);\n\n/**\n * Default authentication middleware names to look for.\n */\nconst DEFAULT_AUTH_MIDDLEWARE_NAMES = new Set([\n 'authenticate',\n 'requireAuth',\n 'isAuthenticated',\n 'verifyToken',\n 'protect',\n 'authorized',\n 'authorize',\n 'isAdmin',\n 'ensureAuthenticated',\n 'ensureLoggedIn',\n 'auth',\n 'authMiddleware',\n 'requireLogin',\n 'checkAuth',\n 'validateToken',\n 'passport.authenticate',\n 'jwt',\n 'requireSession',\n]);\n\n/**\n * Route paths that are commonly public and should not require auth.\n */\nconst PUBLIC_ROUTE_PATTERNS = [\n /^\\/?$/, // '/' root\n /^\\/health/, // health checks\n /^\\/ping/, // ping\n /^\\/status/, // status\n /^\\/api\\/v\\d+\\/auth/, // auth routes\n /^\\/auth/, // auth routes\n /^\\/login/, // login\n /^\\/register/, // register\n /^\\/signup/, // signup\n /^\\/forgot/, // forgot password\n /^\\/reset/, // reset password\n /^\\/webhook/, // webhooks\n /^\\/public/, // explicitly public\n /^\\/assets/, // static assets\n /^\\/static/, // static files\n /^\\/favicon/, // favicon\n /^\\/robots/, // robots.txt\n /^\\/sitemap/, // sitemap\n];\n\nexport const requireAuthMiddleware = createRule({\n name: 'require-auth-middleware',\n meta: {\n type: 'suggestion',\n docs: {\n description:\n 'Require authentication middleware on Express/Fastify route definitions. AI tools frequently generate route handlers without auth middleware, creating unprotected endpoints that expose sensitive data or operations.',\n },\n fixable: undefined,\n schema: [\n {\n type: 'object',\n properties: {\n authMiddlewareNames: {\n type: 'array',\n items: { type: 'string' },\n description: 'Additional custom middleware names to recognize as authentication middleware.',\n },\n },\n additionalProperties: false,\n },\n ],\n messages: {\n missingAuth:\n 'Route `{{method}} {{path}}` appears to have no authentication middleware. AI tools frequently generate routes without auth checks, creating unprotected endpoints. Add authentication middleware (e.g., `protect`, `authenticate`) to the handler chain.',\n },\n },\n defaultOptions: [{}] as [{ authMiddlewareNames?: string[] }],\n create(context, [options]) {\n const customNames = new Set(options.authMiddlewareNames ?? []);\n const allAuthNames = new Set([...DEFAULT_AUTH_MIDDLEWARE_NAMES, ...customNames]);\n\n // Track if router.use(protect) is applied (route-level auth covers all subsequent routes)\n let hasRouterUseAuth = false;\n\n return {\n CallExpression(node) {\n // Detect router.use(protect) or app.use(protect) — blanket auth\n if (isRouterUseAuth(node, allAuthNames)) {\n hasRouterUseAuth = true;\n return;\n }\n\n // Check for: router.get('/path', handler) or app.post('/path', handler)\n if (!isRouteDefinition(node)) return;\n\n // If a blanket router.use(auth) was already applied, skip\n if (hasRouterUseAuth) return;\n\n const callee = node.callee as TSESTree.MemberExpression;\n const method = (callee.property as TSESTree.Identifier).name;\n const args = node.arguments;\n\n // First argument should be the route path\n if (args.length < 2) return;\n const pathArg = args[0];\n const pathStr = getPathString(pathArg);\n\n // Skip public routes\n if (pathStr && isPublicRoute(pathStr)) return;\n\n // Check if any argument (between path and final handler) is an auth middleware\n const middlewareArgs = args.slice(1, -1); // Exclude path and final handler\n\n // If only path + handler (no middleware at all)\n if (middlewareArgs.length === 0 && args.length === 2) {\n context.report({\n node,\n messageId: 'missingAuth',\n data: {\n method: method.toUpperCase(),\n path: pathStr || '<dynamic>',\n },\n });\n return;\n }\n\n // Check if any middleware in the chain is an auth middleware\n const hasAuth = middlewareArgs.some((arg) => isAuthMiddleware(arg, allAuthNames));\n\n if (!hasAuth) {\n context.report({\n node,\n messageId: 'missingAuth',\n data: {\n method: method.toUpperCase(),\n path: pathStr || '<dynamic>',\n },\n });\n }\n },\n };\n },\n});\n\nfunction isRouteDefinition(node: TSESTree.CallExpression): boolean {\n if (node.callee.type !== AST_NODE_TYPES.MemberExpression) return false;\n if (node.callee.property.type !== AST_NODE_TYPES.Identifier) return false;\n\n const methodName = node.callee.property.name;\n if (!HTTP_METHODS.has(methodName)) return false;\n\n // The object should be a router/app-like identifier\n const obj = node.callee.object;\n if (obj.type === AST_NODE_TYPES.Identifier) {\n const name = obj.name.toLowerCase();\n return name === 'router' || name === 'app' || name.includes('router');\n }\n // Also handle: express.Router() chains\n if (obj.type === AST_NODE_TYPES.CallExpression) return true;\n\n return false;\n}\n\nfunction isRouterUseAuth(node: TSESTree.CallExpression, authNames: Set<string>): boolean {\n if (node.callee.type !== AST_NODE_TYPES.MemberExpression) return false;\n if (node.callee.property.type !== AST_NODE_TYPES.Identifier) return false;\n if (node.callee.property.name !== 'use') return false;\n\n // Check if any argument is an auth middleware\n return node.arguments.some((arg) => isAuthMiddleware(arg, authNames));\n}\n\nfunction isAuthMiddleware(node: TSESTree.Node, authNames: Set<string>): boolean {\n // Direct identifier: protect, authenticate, etc.\n if (node.type === AST_NODE_TYPES.Identifier) {\n return authNames.has(node.name);\n }\n\n // Call expression: authenticate('jwt'), authorize('admin')\n if (node.type === AST_NODE_TYPES.CallExpression) {\n if (node.callee.type === AST_NODE_TYPES.Identifier) {\n return authNames.has(node.callee.name);\n }\n // passport.authenticate(...)\n if (\n node.callee.type === AST_NODE_TYPES.MemberExpression &&\n node.callee.object.type === AST_NODE_TYPES.Identifier &&\n node.callee.property.type === AST_NODE_TYPES.Identifier\n ) {\n const fullName = `${node.callee.object.name}.${node.callee.property.name}`;\n return authNames.has(fullName) || authNames.has(node.callee.property.name);\n }\n }\n\n return false;\n}\n\nfunction getPathString(node: TSESTree.Node): string | null {\n if (node.type === AST_NODE_TYPES.Literal && typeof node.value === 'string') {\n return node.value;\n }\n if (node.type === AST_NODE_TYPES.TemplateLiteral) {\n // If it has no expressions, just return the only quasi\n if (node.expressions.length === 0 && node.quasis.length === 1) {\n return node.quasis[0].value.cooked ?? null;\n }\n // If it has expressions (e.g., `/webhook/${dynamic}`), return the first literal part\n if (node.quasis.length > 0) {\n return node.quasis[0].value.cooked ?? null;\n }\n }\n return null;\n}\n\nfunction isPublicRoute(pathStr: string): boolean {\n return PUBLIC_ROUTE_PATTERNS.some((pattern) => pattern.test(pathStr));\n}\n\nexport default requireAuthMiddleware;\n","import { noEmptyCatch } from './error-handling/no-empty-catch';\nimport { noBroadException } from './error-handling/no-broad-exception';\nimport { noAsyncArrayCallback } from './async/no-async-array-callback';\nimport { noFloatingPromise } from './async/no-floating-promise';\nimport { noAwaitInLoop } from './async/no-await-in-loop';\nimport { noHardcodedSecret } from './security/no-hardcoded-secret';\nimport { noEvalDynamic } from './security/no-eval-dynamic';\nimport { noSqlStringConcat } from './security/no-sql-string-concat';\nimport { requireAuthMiddleware } from './security/require-auth-middleware';\n\n/**\n * All rules exported by the plugin.\n * Each key is the rule name (without the plugin prefix).\n */\nexport const allRules = {\n 'no-empty-catch': noEmptyCatch,\n 'no-broad-exception': noBroadException,\n 'no-async-array-callback': noAsyncArrayCallback,\n 'no-floating-promise': noFloatingPromise,\n 'no-await-in-loop': noAwaitInLoop,\n 'no-hardcoded-secret': noHardcodedSecret,\n 'no-eval-dynamic': noEvalDynamic,\n 'no-sql-string-concat': noSqlStringConcat,\n 'require-auth-middleware': requireAuthMiddleware,\n} as const;\n\nexport type RuleKey = keyof typeof allRules;\n","import type { TSESLint } from '@typescript-eslint/utils';\n\nconst recommended: TSESLint.ClassicConfig.Config = {\n plugins: ['ai-guard'],\n rules: {\n // Error Handling\n 'ai-guard/no-empty-catch': 'error',\n 'ai-guard/no-broad-exception': 'warn',\n // Async\n 'ai-guard/no-async-array-callback': 'error',\n 'ai-guard/no-floating-promise': 'error',\n 'ai-guard/no-await-in-loop': 'warn',\n // Security\n 'ai-guard/no-hardcoded-secret': 'error',\n 'ai-guard/no-eval-dynamic': 'error',\n 'ai-guard/no-sql-string-concat': 'error',\n 'ai-guard/require-auth-middleware': 'warn',\n },\n};\n\nexport default recommended;\n","import type { TSESLint } from '@typescript-eslint/utils';\n\nconst strict: TSESLint.ClassicConfig.Config = {\n plugins: ['ai-guard'],\n rules: {\n // Error Handling - all at error\n 'ai-guard/no-empty-catch': 'error',\n 'ai-guard/no-broad-exception': 'error',\n // Async - all at error\n 'ai-guard/no-async-array-callback': 'error',\n 'ai-guard/no-floating-promise': 'error',\n 'ai-guard/no-await-in-loop': 'error',\n // Security - all at error\n 'ai-guard/no-hardcoded-secret': 'error',\n 'ai-guard/no-eval-dynamic': 'error',\n 'ai-guard/no-sql-string-concat': 'error',\n 'ai-guard/require-auth-middleware': 'error',\n },\n};\n\nexport default strict;\n","import type { TSESLint } from '@typescript-eslint/utils';\n\nconst security: TSESLint.ClassicConfig.Config = {\n plugins: ['ai-guard'],\n rules: {\n 'ai-guard/no-hardcoded-secret': 'error',\n 'ai-guard/no-eval-dynamic': 'error',\n 'ai-guard/no-sql-string-concat': 'error',\n 'ai-guard/require-auth-middleware': 'error',\n },\n};\n\nexport default security;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mB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createRule","import_utils","createRule","import_utils","createRule","import_utils","createRule","import_utils","createRule","import_utils","createRule","import_utils","createRule","import_utils","createRule"]}
|