@oculum/scanner 1.0.12 → 1.0.13
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/dist/detect/ai-code/agent-tools.d.ts +22 -0
- package/dist/detect/ai-code/agent-tools.d.ts.map +1 -0
- package/dist/detect/ai-code/agent-tools.js +1509 -0
- package/dist/detect/ai-code/agent-tools.js.map +1 -0
- package/dist/detect/ai-code/byok-patterns.d.ts +15 -0
- package/dist/detect/ai-code/byok-patterns.d.ts.map +1 -0
- package/dist/detect/ai-code/byok-patterns.js +313 -0
- package/dist/detect/ai-code/byok-patterns.js.map +1 -0
- package/dist/detect/ai-code/endpoint-protection.d.ts +38 -0
- package/dist/detect/ai-code/endpoint-protection.d.ts.map +1 -0
- package/dist/detect/ai-code/endpoint-protection.js +349 -0
- package/dist/detect/ai-code/endpoint-protection.js.map +1 -0
- package/dist/detect/ai-code/execution-sinks.d.ts +21 -0
- package/dist/detect/ai-code/execution-sinks.d.ts.map +1 -0
- package/dist/detect/ai-code/execution-sinks.js +1158 -0
- package/dist/detect/ai-code/execution-sinks.js.map +1 -0
- package/dist/detect/ai-code/fingerprinting.d.ts +10 -0
- package/dist/detect/ai-code/fingerprinting.d.ts.map +1 -0
- package/dist/detect/ai-code/fingerprinting.js +665 -0
- package/dist/detect/ai-code/fingerprinting.js.map +1 -0
- package/dist/detect/ai-code/index.d.ts +12 -0
- package/dist/detect/ai-code/index.d.ts.map +1 -0
- package/dist/detect/ai-code/index.js +26 -0
- package/dist/detect/ai-code/index.js.map +1 -0
- package/dist/detect/ai-code/mcp-security.d.ts +20 -0
- package/dist/detect/ai-code/mcp-security.d.ts.map +1 -0
- package/dist/detect/ai-code/mcp-security.js +880 -0
- package/dist/detect/ai-code/mcp-security.js.map +1 -0
- package/dist/detect/ai-code/model-supply-chain.d.ts +23 -0
- package/dist/detect/ai-code/model-supply-chain.d.ts.map +1 -0
- package/dist/detect/ai-code/model-supply-chain.js +447 -0
- package/dist/detect/ai-code/model-supply-chain.js.map +1 -0
- package/dist/detect/ai-code/package-hallucination.d.ts +22 -0
- package/dist/detect/ai-code/package-hallucination.d.ts.map +1 -0
- package/dist/detect/ai-code/package-hallucination.js +841 -0
- package/dist/detect/ai-code/package-hallucination.js.map +1 -0
- package/dist/detect/ai-code/prompt-hygiene.d.ts +22 -0
- package/dist/detect/ai-code/prompt-hygiene.d.ts.map +1 -0
- package/dist/detect/ai-code/prompt-hygiene.js +1177 -0
- package/dist/detect/ai-code/prompt-hygiene.js.map +1 -0
- package/dist/detect/ai-code/rag-safety.d.ts +24 -0
- package/dist/detect/ai-code/rag-safety.d.ts.map +1 -0
- package/dist/detect/ai-code/rag-safety.js +913 -0
- package/dist/detect/ai-code/rag-safety.js.map +1 -0
- package/dist/detect/ai-code/schema-validation.d.ts +28 -0
- package/dist/detect/ai-code/schema-validation.d.ts.map +1 -0
- package/dist/detect/ai-code/schema-validation.js +378 -0
- package/dist/detect/ai-code/schema-validation.js.map +1 -0
- package/dist/detect/config/agent-skill-injection.d.ts +27 -0
- package/dist/detect/config/agent-skill-injection.d.ts.map +1 -0
- package/dist/detect/config/agent-skill-injection.js +472 -0
- package/dist/detect/config/agent-skill-injection.js.map +1 -0
- package/dist/detect/config/comments.d.ts +11 -0
- package/dist/detect/config/comments.d.ts.map +1 -0
- package/dist/detect/config/comments.js +206 -0
- package/dist/detect/config/comments.js.map +1 -0
- package/dist/detect/config/file-flags.d.ts +10 -0
- package/dist/detect/config/file-flags.d.ts.map +1 -0
- package/dist/detect/config/file-flags.js +124 -0
- package/dist/detect/config/file-flags.js.map +1 -0
- package/dist/detect/config/index.d.ts +7 -0
- package/dist/detect/config/index.d.ts.map +1 -0
- package/dist/detect/config/index.js +17 -0
- package/dist/detect/config/index.js.map +1 -0
- package/dist/detect/config/osv-check.d.ts +75 -0
- package/dist/detect/config/osv-check.d.ts.map +1 -0
- package/dist/detect/config/osv-check.js +309 -0
- package/dist/detect/config/osv-check.js.map +1 -0
- package/dist/detect/config/package-check.d.ts +63 -0
- package/dist/detect/config/package-check.d.ts.map +1 -0
- package/dist/detect/config/package-check.js +509 -0
- package/dist/detect/config/package-check.js.map +1 -0
- package/dist/detect/config/urls.d.ts +11 -0
- package/dist/detect/config/urls.d.ts.map +1 -0
- package/dist/detect/config/urls.js +450 -0
- package/dist/detect/config/urls.js.map +1 -0
- package/dist/detect/index.d.ts +37 -0
- package/dist/detect/index.d.ts.map +1 -0
- package/dist/detect/index.js +77 -0
- package/dist/detect/index.js.map +1 -0
- package/dist/detect/secrets/config-audit.d.ts +11 -0
- package/dist/detect/secrets/config-audit.d.ts.map +1 -0
- package/dist/detect/secrets/config-audit.js +315 -0
- package/dist/detect/secrets/config-audit.js.map +1 -0
- package/dist/detect/secrets/config-mcp-audit.d.ts +23 -0
- package/dist/detect/secrets/config-mcp-audit.d.ts.map +1 -0
- package/dist/detect/secrets/config-mcp-audit.js +243 -0
- package/dist/detect/secrets/config-mcp-audit.js.map +1 -0
- package/dist/detect/secrets/entropy.d.ts +11 -0
- package/dist/detect/secrets/entropy.d.ts.map +1 -0
- package/dist/detect/secrets/entropy.js +751 -0
- package/dist/detect/secrets/entropy.js.map +1 -0
- package/dist/detect/secrets/index.d.ts +36 -0
- package/dist/detect/secrets/index.d.ts.map +1 -0
- package/dist/detect/secrets/index.js +174 -0
- package/dist/detect/secrets/index.js.map +1 -0
- package/dist/detect/secrets/patterns.d.ts +11 -0
- package/dist/detect/secrets/patterns.d.ts.map +1 -0
- package/dist/detect/secrets/patterns.js +518 -0
- package/dist/detect/secrets/patterns.js.map +1 -0
- package/dist/detect/secrets/weak-crypto.d.ts +10 -0
- package/dist/detect/secrets/weak-crypto.d.ts.map +1 -0
- package/dist/detect/secrets/weak-crypto.js +432 -0
- package/dist/detect/secrets/weak-crypto.js.map +1 -0
- package/dist/detect/structural/auth-patterns.d.ts +22 -0
- package/dist/detect/structural/auth-patterns.d.ts.map +1 -0
- package/dist/detect/structural/auth-patterns.js +533 -0
- package/dist/detect/structural/auth-patterns.js.map +1 -0
- package/dist/detect/structural/dangerous-functions/child-process.d.ts +16 -0
- package/dist/detect/structural/dangerous-functions/child-process.d.ts.map +1 -0
- package/dist/detect/structural/dangerous-functions/child-process.js +74 -0
- package/dist/detect/structural/dangerous-functions/child-process.js.map +1 -0
- package/dist/detect/structural/dangerous-functions/dom-xss.d.ts +34 -0
- package/dist/detect/structural/dangerous-functions/dom-xss.d.ts.map +1 -0
- package/dist/detect/structural/dangerous-functions/dom-xss.js +230 -0
- package/dist/detect/structural/dangerous-functions/dom-xss.js.map +1 -0
- package/dist/detect/structural/dangerous-functions/index.d.ts +16 -0
- package/dist/detect/structural/dangerous-functions/index.d.ts.map +1 -0
- package/dist/detect/structural/dangerous-functions/index.js +1193 -0
- package/dist/detect/structural/dangerous-functions/index.js.map +1 -0
- package/dist/detect/structural/dangerous-functions/json-parse.d.ts +31 -0
- package/dist/detect/structural/dangerous-functions/json-parse.d.ts.map +1 -0
- package/dist/detect/structural/dangerous-functions/json-parse.js +326 -0
- package/dist/detect/structural/dangerous-functions/json-parse.js.map +1 -0
- package/dist/detect/structural/dangerous-functions/math-random.d.ts +111 -0
- package/dist/detect/structural/dangerous-functions/math-random.d.ts.map +1 -0
- package/dist/detect/structural/dangerous-functions/math-random.js +684 -0
- package/dist/detect/structural/dangerous-functions/math-random.js.map +1 -0
- package/dist/detect/structural/dangerous-functions/patterns.d.ts +21 -0
- package/dist/detect/structural/dangerous-functions/patterns.d.ts.map +1 -0
- package/dist/detect/structural/dangerous-functions/patterns.js +163 -0
- package/dist/detect/structural/dangerous-functions/patterns.js.map +1 -0
- package/dist/detect/structural/dangerous-functions/request-validation.d.ts +13 -0
- package/dist/detect/structural/dangerous-functions/request-validation.d.ts.map +1 -0
- package/dist/detect/structural/dangerous-functions/request-validation.js +126 -0
- package/dist/detect/structural/dangerous-functions/request-validation.js.map +1 -0
- package/dist/detect/structural/dangerous-functions/utils/control-flow.d.ts +24 -0
- package/dist/detect/structural/dangerous-functions/utils/control-flow.d.ts.map +1 -0
- package/dist/detect/structural/dangerous-functions/utils/control-flow.js +70 -0
- package/dist/detect/structural/dangerous-functions/utils/control-flow.js.map +1 -0
- package/dist/detect/structural/dangerous-functions/utils/helpers.d.ts +31 -0
- package/dist/detect/structural/dangerous-functions/utils/helpers.d.ts.map +1 -0
- package/dist/detect/structural/dangerous-functions/utils/helpers.js +147 -0
- package/dist/detect/structural/dangerous-functions/utils/helpers.js.map +1 -0
- package/dist/detect/structural/dangerous-functions/utils/index.d.ts +9 -0
- package/dist/detect/structural/dangerous-functions/utils/index.d.ts.map +1 -0
- package/dist/detect/structural/dangerous-functions/utils/index.js +23 -0
- package/dist/detect/structural/dangerous-functions/utils/index.js.map +1 -0
- package/dist/detect/structural/dangerous-functions/utils/schema-validation.d.ts +22 -0
- package/dist/detect/structural/dangerous-functions/utils/schema-validation.d.ts.map +1 -0
- package/dist/detect/structural/dangerous-functions/utils/schema-validation.js +102 -0
- package/dist/detect/structural/dangerous-functions/utils/schema-validation.js.map +1 -0
- package/dist/detect/structural/data-exposure.d.ts +19 -0
- package/dist/detect/structural/data-exposure.d.ts.map +1 -0
- package/dist/detect/structural/data-exposure.js +262 -0
- package/dist/detect/structural/data-exposure.js.map +1 -0
- package/dist/detect/structural/framework-checks.d.ts +10 -0
- package/dist/detect/structural/framework-checks.d.ts.map +1 -0
- package/dist/detect/structural/framework-checks.js +389 -0
- package/dist/detect/structural/framework-checks.js.map +1 -0
- package/dist/detect/structural/index.d.ts +71 -0
- package/dist/detect/structural/index.d.ts.map +1 -0
- package/dist/detect/structural/index.js +510 -0
- package/dist/detect/structural/index.js.map +1 -0
- package/dist/detect/structural/log-injection.d.ts +18 -0
- package/dist/detect/structural/log-injection.d.ts.map +1 -0
- package/dist/detect/structural/log-injection.js +217 -0
- package/dist/detect/structural/log-injection.js.map +1 -0
- package/dist/detect/structural/logic-gates.d.ts +10 -0
- package/dist/detect/structural/logic-gates.d.ts.map +1 -0
- package/dist/detect/structural/logic-gates.js +227 -0
- package/dist/detect/structural/logic-gates.js.map +1 -0
- package/dist/detect/structural/risky-imports.d.ts +10 -0
- package/dist/detect/structural/risky-imports.d.ts.map +1 -0
- package/dist/detect/structural/risky-imports.js +168 -0
- package/dist/detect/structural/risky-imports.js.map +1 -0
- package/dist/detect/structural/security-headers.d.ts +18 -0
- package/dist/detect/structural/security-headers.d.ts.map +1 -0
- package/dist/detect/structural/security-headers.js +196 -0
- package/dist/detect/structural/security-headers.js.map +1 -0
- package/dist/detect/structural/ssrf-detection.d.ts +18 -0
- package/dist/detect/structural/ssrf-detection.d.ts.map +1 -0
- package/dist/detect/structural/ssrf-detection.js +263 -0
- package/dist/detect/structural/ssrf-detection.js.map +1 -0
- package/dist/detect/structural/variables.d.ts +11 -0
- package/dist/detect/structural/variables.d.ts.map +1 -0
- package/dist/detect/structural/variables.js +159 -0
- package/dist/detect/structural/variables.js.map +1 -0
- package/dist/detect/structural/xxe-detection.d.ts +18 -0
- package/dist/detect/structural/xxe-detection.d.ts.map +1 -0
- package/dist/detect/structural/xxe-detection.js +245 -0
- package/dist/detect/structural/xxe-detection.js.map +1 -0
- package/dist/index.d.ts +17 -64
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +49 -1034
- package/dist/index.js.map +1 -1
- package/dist/layer2/framework-checks.d.ts.map +1 -1
- package/dist/layer2/framework-checks.js +1 -8
- package/dist/layer2/framework-checks.js.map +1 -1
- package/dist/layer2/index.d.ts +4 -0
- package/dist/layer2/index.d.ts.map +1 -1
- package/dist/layer2/index.js +50 -1
- package/dist/layer2/index.js.map +1 -1
- package/dist/layer2/log-injection.d.ts +18 -0
- package/dist/layer2/log-injection.d.ts.map +1 -0
- package/dist/layer2/log-injection.js +214 -0
- package/dist/layer2/log-injection.js.map +1 -0
- package/dist/layer2/security-headers.d.ts +18 -0
- package/dist/layer2/security-headers.d.ts.map +1 -0
- package/dist/layer2/security-headers.js +187 -0
- package/dist/layer2/security-headers.js.map +1 -0
- package/dist/layer2/ssrf-detection.d.ts +18 -0
- package/dist/layer2/ssrf-detection.d.ts.map +1 -0
- package/dist/layer2/ssrf-detection.js +252 -0
- package/dist/layer2/ssrf-detection.js.map +1 -0
- package/dist/layer2/xxe-detection.d.ts +18 -0
- package/dist/layer2/xxe-detection.d.ts.map +1 -0
- package/dist/layer2/xxe-detection.js +242 -0
- package/dist/layer2/xxe-detection.js.map +1 -0
- package/dist/layer3/anthropic/prompts/index.d.ts +1 -1
- package/dist/layer3/anthropic/prompts/index.d.ts.map +1 -1
- package/dist/layer3/anthropic/prompts/index.js +3 -1
- package/dist/layer3/anthropic/prompts/index.js.map +1 -1
- package/dist/layer3/anthropic/prompts/modules/ai-patterns.d.ts +19 -0
- package/dist/layer3/anthropic/prompts/modules/ai-patterns.d.ts.map +1 -0
- package/dist/layer3/anthropic/prompts/modules/ai-patterns.js +156 -0
- package/dist/layer3/anthropic/prompts/modules/ai-patterns.js.map +1 -0
- package/dist/layer3/anthropic/prompts/modules/auth-access.d.ts +9 -0
- package/dist/layer3/anthropic/prompts/modules/auth-access.d.ts.map +1 -0
- package/dist/layer3/anthropic/prompts/modules/auth-access.js +25 -0
- package/dist/layer3/anthropic/prompts/modules/auth-access.js.map +1 -0
- package/dist/layer3/anthropic/prompts/modules/common.d.ts +11 -0
- package/dist/layer3/anthropic/prompts/modules/common.d.ts.map +1 -0
- package/dist/layer3/anthropic/prompts/modules/common.js +152 -0
- package/dist/layer3/anthropic/prompts/modules/common.js.map +1 -0
- package/dist/layer3/anthropic/prompts/modules/index.d.ts +54 -0
- package/dist/layer3/anthropic/prompts/modules/index.d.ts.map +1 -0
- package/dist/layer3/anthropic/prompts/modules/index.js +185 -0
- package/dist/layer3/anthropic/prompts/modules/index.js.map +1 -0
- package/dist/layer3/anthropic/prompts/modules/owasp-classic.d.ts +8 -0
- package/dist/layer3/anthropic/prompts/modules/owasp-classic.d.ts.map +1 -0
- package/dist/layer3/anthropic/prompts/modules/owasp-classic.js +84 -0
- package/dist/layer3/anthropic/prompts/modules/owasp-classic.js.map +1 -0
- package/dist/layer3/anthropic/prompts/modules/secrets-crypto.d.ts +8 -0
- package/dist/layer3/anthropic/prompts/modules/secrets-crypto.d.ts.map +1 -0
- package/dist/layer3/anthropic/prompts/modules/secrets-crypto.js +68 -0
- package/dist/layer3/anthropic/prompts/modules/secrets-crypto.js.map +1 -0
- package/dist/layer3/anthropic/prompts/modules/xss-prompt.d.ts +8 -0
- package/dist/layer3/anthropic/prompts/modules/xss-prompt.d.ts.map +1 -0
- package/dist/layer3/anthropic/prompts/modules/xss-prompt.js +22 -0
- package/dist/layer3/anthropic/prompts/modules/xss-prompt.js.map +1 -0
- package/dist/layer3/anthropic/prompts/validation.d.ts +9 -3
- package/dist/layer3/anthropic/prompts/validation.d.ts.map +1 -1
- package/dist/layer3/anthropic/prompts/validation.js +14 -410
- package/dist/layer3/anthropic/prompts/validation.js.map +1 -1
- package/dist/layer3/anthropic/providers/anthropic.d.ts.map +1 -1
- package/dist/layer3/anthropic/providers/anthropic.js +6 -3
- package/dist/layer3/anthropic/providers/anthropic.js.map +1 -1
- package/dist/layer3/anthropic/providers/openai.d.ts.map +1 -1
- package/dist/layer3/anthropic/providers/openai.js +6 -3
- package/dist/layer3/anthropic/providers/openai.js.map +1 -1
- package/dist/layer3/anthropic/request-builder.d.ts +11 -4
- package/dist/layer3/anthropic/request-builder.d.ts.map +1 -1
- package/dist/layer3/anthropic/request-builder.js +32 -16
- package/dist/layer3/anthropic/request-builder.js.map +1 -1
- package/dist/layer3/anthropic/utils/context-extractor.d.ts +55 -0
- package/dist/layer3/anthropic/utils/context-extractor.d.ts.map +1 -0
- package/dist/layer3/anthropic/utils/context-extractor.js +161 -0
- package/dist/layer3/anthropic/utils/context-extractor.js.map +1 -0
- package/dist/layer3/anthropic/utils/index.d.ts +2 -0
- package/dist/layer3/anthropic/utils/index.d.ts.map +1 -1
- package/dist/layer3/anthropic/utils/index.js +4 -1
- package/dist/layer3/anthropic/utils/index.js.map +1 -1
- package/dist/model/auth-helper-detector.d.ts +56 -0
- package/dist/model/auth-helper-detector.d.ts.map +1 -0
- package/dist/model/auth-helper-detector.js +360 -0
- package/dist/model/auth-helper-detector.js.map +1 -0
- package/dist/model/cross-file-taint.d.ts +40 -0
- package/dist/model/cross-file-taint.d.ts.map +1 -0
- package/dist/model/cross-file-taint.js +290 -0
- package/dist/model/cross-file-taint.js.map +1 -0
- package/dist/model/framework-models/django.d.ts +9 -0
- package/dist/model/framework-models/django.d.ts.map +1 -0
- package/dist/model/framework-models/django.js +82 -0
- package/dist/model/framework-models/django.js.map +1 -0
- package/dist/model/framework-models/express.d.ts +9 -0
- package/dist/model/framework-models/express.d.ts.map +1 -0
- package/dist/model/framework-models/express.js +52 -0
- package/dist/model/framework-models/express.js.map +1 -0
- package/dist/model/framework-models/index.d.ts +20 -0
- package/dist/model/framework-models/index.d.ts.map +1 -0
- package/dist/model/framework-models/index.js +102 -0
- package/dist/model/framework-models/index.js.map +1 -0
- package/dist/model/framework-models/nextjs.d.ts +9 -0
- package/dist/model/framework-models/nextjs.d.ts.map +1 -0
- package/dist/model/framework-models/nextjs.js +71 -0
- package/dist/model/framework-models/nextjs.js.map +1 -0
- package/dist/model/framework-models/prisma.d.ts +10 -0
- package/dist/model/framework-models/prisma.d.ts.map +1 -0
- package/dist/model/framework-models/prisma.js +54 -0
- package/dist/model/framework-models/prisma.js.map +1 -0
- package/dist/model/framework-models/react.d.ts +9 -0
- package/dist/model/framework-models/react.d.ts.map +1 -0
- package/dist/model/framework-models/react.js +67 -0
- package/dist/model/framework-models/react.js.map +1 -0
- package/dist/model/framework-models/sequelize.d.ts +9 -0
- package/dist/model/framework-models/sequelize.d.ts.map +1 -0
- package/dist/model/framework-models/sequelize.js +62 -0
- package/dist/model/framework-models/sequelize.js.map +1 -0
- package/dist/model/framework-models/types.d.ts +43 -0
- package/dist/model/framework-models/types.d.ts.map +1 -0
- package/dist/model/framework-models/types.js +10 -0
- package/dist/model/framework-models/types.js.map +1 -0
- package/dist/model/function-classifier.d.ts +32 -0
- package/dist/model/function-classifier.d.ts.map +1 -0
- package/dist/model/function-classifier.js +143 -0
- package/dist/model/function-classifier.js.map +1 -0
- package/dist/model/import-resolver.d.ts +45 -0
- package/dist/model/import-resolver.d.ts.map +1 -0
- package/dist/model/import-resolver.js +410 -0
- package/dist/model/import-resolver.js.map +1 -0
- package/dist/model/imported-auth-detector.d.ts +38 -0
- package/dist/model/imported-auth-detector.d.ts.map +1 -0
- package/dist/model/imported-auth-detector.js +199 -0
- package/dist/model/imported-auth-detector.js.map +1 -0
- package/dist/model/index.d.ts +63 -0
- package/dist/model/index.d.ts.map +1 -0
- package/dist/model/index.js +272 -0
- package/dist/model/index.js.map +1 -0
- package/dist/model/middleware-detector.d.ts +55 -0
- package/dist/model/middleware-detector.d.ts.map +1 -0
- package/dist/model/middleware-detector.js +382 -0
- package/dist/model/middleware-detector.js.map +1 -0
- package/dist/model/module-graph.d.ts +46 -0
- package/dist/model/module-graph.d.ts.map +1 -0
- package/dist/model/module-graph.js +187 -0
- package/dist/model/module-graph.js.map +1 -0
- package/dist/model/oauth-flow-detector.d.ts +41 -0
- package/dist/model/oauth-flow-detector.d.ts.map +1 -0
- package/dist/model/oauth-flow-detector.js +202 -0
- package/dist/model/oauth-flow-detector.js.map +1 -0
- package/dist/model/project-context.d.ts +119 -0
- package/dist/model/project-context.d.ts.map +1 -0
- package/dist/model/project-context.js +534 -0
- package/dist/model/project-context.js.map +1 -0
- package/dist/model/route-auth-resolver.d.ts +27 -0
- package/dist/model/route-auth-resolver.d.ts.map +1 -0
- package/dist/model/route-auth-resolver.js +182 -0
- package/dist/model/route-auth-resolver.js.map +1 -0
- package/dist/model/route-discovery/express.d.ts +25 -0
- package/dist/model/route-discovery/express.d.ts.map +1 -0
- package/dist/model/route-discovery/express.js +225 -0
- package/dist/model/route-discovery/express.js.map +1 -0
- package/dist/model/route-discovery/index.d.ts +21 -0
- package/dist/model/route-discovery/index.d.ts.map +1 -0
- package/dist/model/route-discovery/index.js +67 -0
- package/dist/model/route-discovery/index.js.map +1 -0
- package/dist/model/route-discovery/nextjs.d.ts +16 -0
- package/dist/model/route-discovery/nextjs.d.ts.map +1 -0
- package/dist/model/route-discovery/nextjs.js +179 -0
- package/dist/model/route-discovery/nextjs.js.map +1 -0
- package/dist/model/route-discovery/python.d.ts +16 -0
- package/dist/model/route-discovery/python.d.ts.map +1 -0
- package/dist/model/route-discovery/python.js +181 -0
- package/dist/model/route-discovery/python.js.map +1 -0
- package/dist/model/route-discovery/types.d.ts +36 -0
- package/dist/model/route-discovery/types.d.ts.map +1 -0
- package/dist/model/route-discovery/types.js +16 -0
- package/dist/model/route-discovery/types.js.map +1 -0
- package/dist/model/route-discovery/utils.d.ts +18 -0
- package/dist/model/route-discovery/utils.d.ts.map +1 -0
- package/dist/model/route-discovery/utils.js +55 -0
- package/dist/model/route-discovery/utils.js.map +1 -0
- package/dist/model/route-hierarchy.d.ts +50 -0
- package/dist/model/route-hierarchy.d.ts.map +1 -0
- package/dist/model/route-hierarchy.js +226 -0
- package/dist/model/route-hierarchy.js.map +1 -0
- package/dist/model/sanitiser-detection.d.ts +27 -0
- package/dist/model/sanitiser-detection.d.ts.map +1 -0
- package/dist/model/sanitiser-detection.js +224 -0
- package/dist/model/sanitiser-detection.js.map +1 -0
- package/dist/model/sink-matcher.d.ts +17 -0
- package/dist/model/sink-matcher.d.ts.map +1 -0
- package/dist/model/sink-matcher.js +141 -0
- package/dist/model/sink-matcher.js.map +1 -0
- package/dist/model/sink-patterns.d.ts +19 -0
- package/dist/model/sink-patterns.d.ts.map +1 -0
- package/dist/model/sink-patterns.js +88 -0
- package/dist/model/sink-patterns.js.map +1 -0
- package/dist/model/source-discovery.d.ts +15 -0
- package/dist/model/source-discovery.d.ts.map +1 -0
- package/dist/model/source-discovery.js +170 -0
- package/dist/model/source-discovery.js.map +1 -0
- package/dist/model/taint-tracker.d.ts +21 -0
- package/dist/model/taint-tracker.d.ts.map +1 -0
- package/dist/model/taint-tracker.js +281 -0
- package/dist/model/taint-tracker.js.map +1 -0
- package/dist/model/taint-types.d.ts +74 -0
- package/dist/model/taint-types.d.ts.map +1 -0
- package/dist/model/taint-types.js +9 -0
- package/dist/model/taint-types.js.map +1 -0
- package/dist/model/trpc-analyzer.d.ts +78 -0
- package/dist/model/trpc-analyzer.d.ts.map +1 -0
- package/dist/model/trpc-analyzer.js +297 -0
- package/dist/model/trpc-analyzer.js.map +1 -0
- package/dist/parse/file-classifier.d.ts +228 -0
- package/dist/parse/file-classifier.d.ts.map +1 -0
- package/dist/parse/file-classifier.js +933 -0
- package/dist/parse/file-classifier.js.map +1 -0
- package/dist/parse/path-exclusions.d.ts +55 -0
- package/dist/parse/path-exclusions.d.ts.map +1 -0
- package/dist/parse/path-exclusions.js +224 -0
- package/dist/parse/path-exclusions.js.map +1 -0
- package/dist/pipeline/config.d.ts +39 -0
- package/dist/pipeline/config.d.ts.map +1 -0
- package/dist/pipeline/config.js +46 -0
- package/dist/pipeline/config.js.map +1 -0
- package/dist/pipeline/index.d.ts +34 -0
- package/dist/pipeline/index.d.ts.map +1 -0
- package/dist/pipeline/index.js +377 -0
- package/dist/pipeline/index.js.map +1 -0
- package/dist/pipeline/modes/incremental.d.ts +66 -0
- package/dist/pipeline/modes/incremental.d.ts.map +1 -0
- package/dist/pipeline/modes/incremental.js +200 -0
- package/dist/pipeline/modes/incremental.js.map +1 -0
- package/dist/postprocess/aggregation.d.ts +14 -0
- package/dist/postprocess/aggregation.d.ts.map +1 -0
- package/dist/postprocess/aggregation.js +63 -0
- package/dist/postprocess/aggregation.js.map +1 -0
- package/dist/postprocess/contradictions.d.ts +18 -0
- package/dist/postprocess/contradictions.d.ts.map +1 -0
- package/dist/postprocess/contradictions.js +99 -0
- package/dist/postprocess/contradictions.js.map +1 -0
- package/dist/postprocess/dedup.d.ts +13 -0
- package/dist/postprocess/dedup.d.ts.map +1 -0
- package/dist/postprocess/dedup.js +58 -0
- package/dist/postprocess/dedup.js.map +1 -0
- package/dist/postprocess/filtering/context-adjustments.d.ts +23 -0
- package/dist/postprocess/filtering/context-adjustments.d.ts.map +1 -0
- package/dist/postprocess/filtering/context-adjustments.js +100 -0
- package/dist/postprocess/filtering/context-adjustments.js.map +1 -0
- package/dist/postprocess/filtering/index.d.ts +3 -0
- package/dist/postprocess/filtering/index.d.ts.map +1 -0
- package/dist/postprocess/filtering/index.js +8 -0
- package/dist/postprocess/filtering/index.js.map +1 -0
- package/dist/postprocess/filtering/pipeline.d.ts +48 -0
- package/dist/postprocess/filtering/pipeline.d.ts.map +1 -0
- package/dist/postprocess/filtering/pipeline.js +76 -0
- package/dist/postprocess/filtering/pipeline.js.map +1 -0
- package/dist/postprocess/index.d.ts +41 -0
- package/dist/postprocess/index.d.ts.map +1 -0
- package/dist/postprocess/index.js +85 -0
- package/dist/postprocess/index.js.map +1 -0
- package/dist/postprocess/suppression/config-loader.d.ts +74 -0
- package/dist/postprocess/suppression/config-loader.d.ts.map +1 -0
- package/dist/postprocess/suppression/config-loader.js +424 -0
- package/dist/postprocess/suppression/config-loader.js.map +1 -0
- package/dist/postprocess/suppression/hash.d.ts +48 -0
- package/dist/postprocess/suppression/hash.d.ts.map +1 -0
- package/dist/postprocess/suppression/hash.js +88 -0
- package/dist/postprocess/suppression/hash.js.map +1 -0
- package/dist/postprocess/suppression/index.d.ts +11 -0
- package/dist/postprocess/suppression/index.d.ts.map +1 -0
- package/dist/postprocess/suppression/index.js +39 -0
- package/dist/postprocess/suppression/index.js.map +1 -0
- package/dist/postprocess/suppression/inline-parser.d.ts +39 -0
- package/dist/postprocess/suppression/inline-parser.d.ts.map +1 -0
- package/dist/postprocess/suppression/inline-parser.js +218 -0
- package/dist/postprocess/suppression/inline-parser.js.map +1 -0
- package/dist/postprocess/suppression/manager.d.ts +94 -0
- package/dist/postprocess/suppression/manager.d.ts.map +1 -0
- package/dist/postprocess/suppression/manager.js +292 -0
- package/dist/postprocess/suppression/manager.js.map +1 -0
- package/dist/postprocess/suppression/types.d.ts +151 -0
- package/dist/postprocess/suppression/types.d.ts.map +1 -0
- package/dist/postprocess/suppression/types.js +28 -0
- package/dist/postprocess/suppression/types.js.map +1 -0
- package/dist/postprocess/validation-cap.d.ts +17 -0
- package/dist/postprocess/validation-cap.d.ts.map +1 -0
- package/dist/postprocess/validation-cap.js +64 -0
- package/dist/postprocess/validation-cap.js.map +1 -0
- package/dist/report/build-result.d.ts +33 -0
- package/dist/report/build-result.d.ts.map +1 -0
- package/dist/report/build-result.js +59 -0
- package/dist/report/build-result.js.map +1 -0
- package/dist/report/enrichment.d.ts +19 -0
- package/dist/report/enrichment.d.ts.map +1 -0
- package/dist/report/enrichment.js +44 -0
- package/dist/report/enrichment.js.map +1 -0
- package/dist/report/formatters/ai-context.d.ts +23 -0
- package/dist/report/formatters/ai-context.d.ts.map +1 -0
- package/dist/report/formatters/ai-context.js +238 -0
- package/dist/report/formatters/ai-context.js.map +1 -0
- package/dist/report/formatters/cli-terminal.d.ts +65 -0
- package/dist/report/formatters/cli-terminal.d.ts.map +1 -0
- package/dist/report/formatters/cli-terminal.js +735 -0
- package/dist/report/formatters/cli-terminal.js.map +1 -0
- package/dist/report/formatters/github-comment.d.ts +41 -0
- package/dist/report/formatters/github-comment.d.ts.map +1 -0
- package/dist/report/formatters/github-comment.js +370 -0
- package/dist/report/formatters/github-comment.js.map +1 -0
- package/dist/report/formatters/grouping.d.ts +52 -0
- package/dist/report/formatters/grouping.d.ts.map +1 -0
- package/dist/report/formatters/grouping.js +152 -0
- package/dist/report/formatters/grouping.js.map +1 -0
- package/dist/report/formatters/ide/claude-code.d.ts +17 -0
- package/dist/report/formatters/ide/claude-code.d.ts.map +1 -0
- package/dist/report/formatters/ide/claude-code.js +94 -0
- package/dist/report/formatters/ide/claude-code.js.map +1 -0
- package/dist/report/formatters/ide/cursor.d.ts +13 -0
- package/dist/report/formatters/ide/cursor.d.ts.map +1 -0
- package/dist/report/formatters/ide/cursor.js +125 -0
- package/dist/report/formatters/ide/cursor.js.map +1 -0
- package/dist/report/formatters/ide/index.d.ts +62 -0
- package/dist/report/formatters/ide/index.d.ts.map +1 -0
- package/dist/report/formatters/ide/index.js +184 -0
- package/dist/report/formatters/ide/index.js.map +1 -0
- package/dist/report/formatters/ide/windsurf.d.ts +13 -0
- package/dist/report/formatters/ide/windsurf.d.ts.map +1 -0
- package/dist/report/formatters/ide/windsurf.js +117 -0
- package/dist/report/formatters/ide/windsurf.js.map +1 -0
- package/dist/report/formatters/index.d.ts +11 -0
- package/dist/report/formatters/index.d.ts.map +1 -0
- package/dist/report/formatters/index.js +54 -0
- package/dist/report/formatters/index.js.map +1 -0
- package/dist/report/formatters/vscode-diagnostic.d.ts +103 -0
- package/dist/report/formatters/vscode-diagnostic.d.ts.map +1 -0
- package/dist/report/formatters/vscode-diagnostic.js +151 -0
- package/dist/report/formatters/vscode-diagnostic.js.map +1 -0
- package/dist/report/summary.d.ts +27 -0
- package/dist/report/summary.d.ts.map +1 -0
- package/dist/report/summary.js +57 -0
- package/dist/report/summary.js.map +1 -0
- package/dist/rules/metadata.d.ts.map +1 -1
- package/dist/rules/metadata.js +66 -0
- package/dist/rules/metadata.js.map +1 -1
- package/dist/score/adjustments.d.ts +22 -0
- package/dist/score/adjustments.d.ts.map +1 -0
- package/dist/score/adjustments.js +373 -0
- package/dist/score/adjustments.js.map +1 -0
- package/dist/score/auto-dismiss.d.ts +28 -0
- package/dist/score/auto-dismiss.d.ts.map +1 -0
- package/dist/score/auto-dismiss.js +200 -0
- package/dist/score/auto-dismiss.js.map +1 -0
- package/dist/score/confidence.d.ts +19 -0
- package/dist/score/confidence.d.ts.map +1 -0
- package/dist/score/confidence.js +52 -0
- package/dist/score/confidence.js.map +1 -0
- package/dist/score/index.d.ts +61 -0
- package/dist/score/index.d.ts.map +1 -0
- package/dist/score/index.js +250 -0
- package/dist/score/index.js.map +1 -0
- package/dist/score/types.d.ts +160 -0
- package/dist/score/types.d.ts.map +1 -0
- package/dist/score/types.js +14 -0
- package/dist/score/types.js.map +1 -0
- package/dist/shared/ai-context/index.d.ts +6 -0
- package/dist/shared/ai-context/index.d.ts.map +1 -0
- package/dist/shared/ai-context/index.js +13 -0
- package/dist/shared/ai-context/index.js.map +1 -0
- package/dist/shared/ai-context/manager.d.ts +67 -0
- package/dist/shared/ai-context/manager.d.ts.map +1 -0
- package/dist/shared/ai-context/manager.js +104 -0
- package/dist/shared/ai-context/manager.js.map +1 -0
- package/dist/shared/baseline/diff.d.ts +32 -0
- package/dist/shared/baseline/diff.d.ts.map +1 -0
- package/dist/shared/baseline/diff.js +119 -0
- package/dist/shared/baseline/diff.js.map +1 -0
- package/dist/shared/baseline/index.d.ts +9 -0
- package/dist/shared/baseline/index.d.ts.map +1 -0
- package/dist/shared/baseline/index.js +19 -0
- package/dist/shared/baseline/index.js.map +1 -0
- package/dist/shared/baseline/manager.d.ts +67 -0
- package/dist/shared/baseline/manager.d.ts.map +1 -0
- package/dist/shared/baseline/manager.js +180 -0
- package/dist/shared/baseline/manager.js.map +1 -0
- package/dist/shared/baseline/types.d.ts +91 -0
- package/dist/shared/baseline/types.d.ts.map +1 -0
- package/dist/shared/baseline/types.js +12 -0
- package/dist/shared/baseline/types.js.map +1 -0
- package/dist/shared/category-filter.d.ts +125 -0
- package/dist/shared/category-filter.d.ts.map +1 -0
- package/dist/shared/category-filter.js +360 -0
- package/dist/shared/category-filter.js.map +1 -0
- package/dist/shared/code-analysis.d.ts +39 -0
- package/dist/shared/code-analysis.d.ts.map +1 -0
- package/dist/shared/code-analysis.js +159 -0
- package/dist/shared/code-analysis.js.map +1 -0
- package/dist/shared/comment-analyzer.d.ts +38 -0
- package/dist/shared/comment-analyzer.d.ts.map +1 -0
- package/dist/shared/comment-analyzer.js +218 -0
- package/dist/shared/comment-analyzer.js.map +1 -0
- package/dist/shared/diff-detector.d.ts +53 -0
- package/dist/shared/diff-detector.d.ts.map +1 -0
- package/dist/shared/diff-detector.js +104 -0
- package/dist/shared/diff-detector.js.map +1 -0
- package/dist/shared/diff-parser.d.ts +80 -0
- package/dist/shared/diff-parser.d.ts.map +1 -0
- package/dist/shared/diff-parser.js +202 -0
- package/dist/shared/diff-parser.js.map +1 -0
- package/dist/shared/environment-context.d.ts +76 -0
- package/dist/shared/environment-context.d.ts.map +1 -0
- package/dist/shared/environment-context.js +271 -0
- package/dist/shared/environment-context.js.map +1 -0
- package/dist/shared/intent-detector.d.ts +66 -0
- package/dist/shared/intent-detector.d.ts.map +1 -0
- package/dist/shared/intent-detector.js +282 -0
- package/dist/shared/intent-detector.js.map +1 -0
- package/dist/shared/parsed-file.d.ts +51 -0
- package/dist/shared/parsed-file.d.ts.map +1 -0
- package/dist/shared/parsed-file.js +95 -0
- package/dist/shared/parsed-file.js.map +1 -0
- package/dist/shared/registry-clients.d.ts +93 -0
- package/dist/shared/registry-clients.d.ts.map +1 -0
- package/dist/shared/registry-clients.js +273 -0
- package/dist/shared/registry-clients.js.map +1 -0
- package/dist/shared/rules/framework-fixes.d.ts +48 -0
- package/dist/shared/rules/framework-fixes.d.ts.map +1 -0
- package/dist/shared/rules/framework-fixes.js +439 -0
- package/dist/shared/rules/framework-fixes.js.map +1 -0
- package/dist/shared/rules/index.d.ts +8 -0
- package/dist/shared/rules/index.d.ts.map +1 -0
- package/dist/shared/rules/index.js +18 -0
- package/dist/shared/rules/index.js.map +1 -0
- package/dist/shared/rules/metadata.d.ts +43 -0
- package/dist/shared/rules/metadata.d.ts.map +1 -0
- package/dist/shared/rules/metadata.js +819 -0
- package/dist/shared/rules/metadata.js.map +1 -0
- package/dist/shared/schema-semantics.d.ts +45 -0
- package/dist/shared/schema-semantics.d.ts.map +1 -0
- package/dist/shared/schema-semantics.js +193 -0
- package/dist/shared/schema-semantics.js.map +1 -0
- package/dist/shared/types.d.ts +337 -0
- package/dist/shared/types.d.ts.map +1 -0
- package/dist/shared/types.js +126 -0
- package/dist/shared/types.js.map +1 -0
- package/dist/tiers.d.ts +2 -2
- package/dist/tiers.d.ts.map +1 -1
- package/dist/tiers.js +10 -0
- package/dist/tiers.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/validate/clients.d.ts +44 -0
- package/dist/validate/clients.d.ts.map +1 -0
- package/dist/validate/clients.js +81 -0
- package/dist/validate/clients.js.map +1 -0
- package/dist/validate/index.d.ts +41 -0
- package/dist/validate/index.d.ts.map +1 -0
- package/dist/validate/index.js +141 -0
- package/dist/validate/index.js.map +1 -0
- package/dist/validate/prompts/index.d.ts +8 -0
- package/dist/validate/prompts/index.d.ts.map +1 -0
- package/dist/validate/prompts/index.js +16 -0
- package/dist/validate/prompts/index.js.map +1 -0
- package/dist/validate/prompts/modules/ai-patterns.d.ts +19 -0
- package/dist/validate/prompts/modules/ai-patterns.d.ts.map +1 -0
- package/dist/validate/prompts/modules/ai-patterns.js +156 -0
- package/dist/validate/prompts/modules/ai-patterns.js.map +1 -0
- package/dist/validate/prompts/modules/auth-access.d.ts +9 -0
- package/dist/validate/prompts/modules/auth-access.d.ts.map +1 -0
- package/dist/validate/prompts/modules/auth-access.js +25 -0
- package/dist/validate/prompts/modules/auth-access.js.map +1 -0
- package/dist/validate/prompts/modules/common.d.ts +11 -0
- package/dist/validate/prompts/modules/common.d.ts.map +1 -0
- package/dist/validate/prompts/modules/common.js +186 -0
- package/dist/validate/prompts/modules/common.js.map +1 -0
- package/dist/validate/prompts/modules/index.d.ts +54 -0
- package/dist/validate/prompts/modules/index.d.ts.map +1 -0
- package/dist/validate/prompts/modules/index.js +186 -0
- package/dist/validate/prompts/modules/index.js.map +1 -0
- package/dist/validate/prompts/modules/owasp-classic.d.ts +8 -0
- package/dist/validate/prompts/modules/owasp-classic.d.ts.map +1 -0
- package/dist/validate/prompts/modules/owasp-classic.js +84 -0
- package/dist/validate/prompts/modules/owasp-classic.js.map +1 -0
- package/dist/validate/prompts/modules/secrets-crypto.d.ts +8 -0
- package/dist/validate/prompts/modules/secrets-crypto.d.ts.map +1 -0
- package/dist/validate/prompts/modules/secrets-crypto.js +68 -0
- package/dist/validate/prompts/modules/secrets-crypto.js.map +1 -0
- package/dist/validate/prompts/modules/xss-prompt.d.ts +8 -0
- package/dist/validate/prompts/modules/xss-prompt.d.ts.map +1 -0
- package/dist/validate/prompts/modules/xss-prompt.js +22 -0
- package/dist/validate/prompts/modules/xss-prompt.js.map +1 -0
- package/dist/validate/prompts/semantic-analysis.d.ts +15 -0
- package/dist/validate/prompts/semantic-analysis.d.ts.map +1 -0
- package/dist/validate/prompts/semantic-analysis.js +169 -0
- package/dist/validate/prompts/semantic-analysis.js.map +1 -0
- package/dist/validate/prompts/validation.d.ts +18 -0
- package/dist/validate/prompts/validation.d.ts.map +1 -0
- package/dist/validate/prompts/validation.js +25 -0
- package/dist/validate/prompts/validation.js.map +1 -0
- package/dist/validate/providers/anthropic.d.ts +17 -0
- package/dist/validate/providers/anthropic.d.ts.map +1 -0
- package/dist/validate/providers/anthropic.js +260 -0
- package/dist/validate/providers/anthropic.js.map +1 -0
- package/dist/validate/providers/index.d.ts +8 -0
- package/dist/validate/providers/index.d.ts.map +1 -0
- package/dist/validate/providers/index.js +13 -0
- package/dist/validate/providers/index.js.map +1 -0
- package/dist/validate/providers/openai.d.ts +14 -0
- package/dist/validate/providers/openai.d.ts.map +1 -0
- package/dist/validate/providers/openai.js +336 -0
- package/dist/validate/providers/openai.js.map +1 -0
- package/dist/validate/request-builder.d.ts +61 -0
- package/dist/validate/request-builder.d.ts.map +1 -0
- package/dist/validate/request-builder.js +346 -0
- package/dist/validate/request-builder.js.map +1 -0
- package/dist/validate/types.d.ts +88 -0
- package/dist/validate/types.d.ts.map +1 -0
- package/dist/validate/types.js +38 -0
- package/dist/validate/types.js.map +1 -0
- package/dist/validate/utils/context-extractor.d.ts +55 -0
- package/dist/validate/utils/context-extractor.d.ts.map +1 -0
- package/dist/validate/utils/context-extractor.js +161 -0
- package/dist/validate/utils/context-extractor.js.map +1 -0
- package/dist/validate/utils/index.d.ts +11 -0
- package/dist/validate/utils/index.d.ts.map +1 -0
- package/dist/validate/utils/index.js +27 -0
- package/dist/validate/utils/index.js.map +1 -0
- package/dist/validate/utils/path-helpers.d.ts +21 -0
- package/dist/validate/utils/path-helpers.d.ts.map +1 -0
- package/dist/validate/utils/path-helpers.js +69 -0
- package/dist/validate/utils/path-helpers.js.map +1 -0
- package/dist/validate/utils/response-parser.d.ts +40 -0
- package/dist/validate/utils/response-parser.d.ts.map +1 -0
- package/dist/validate/utils/response-parser.js +286 -0
- package/dist/validate/utils/response-parser.js.map +1 -0
- package/dist/validate/utils/retry.d.ts +15 -0
- package/dist/validate/utils/retry.d.ts.map +1 -0
- package/dist/validate/utils/retry.js +62 -0
- package/dist/validate/utils/retry.js.map +1 -0
- package/package.json +8 -7
- package/src/__tests__/benchmark/fixtures/layer1/agent-skill-injection.ts +204 -0
- package/src/__tests__/benchmark/fixtures/layer1/index.ts +3 -0
- package/src/__tests__/benchmark/fixtures/layer2/index.ts +15 -0
- package/src/__tests__/benchmark/fixtures/layer2/log-injection.ts +147 -0
- package/src/__tests__/benchmark/fixtures/layer2/security-headers.ts +197 -0
- package/src/__tests__/benchmark/fixtures/layer2/ssrf-detection.ts +210 -0
- package/src/__tests__/benchmark/fixtures/layer2/xxe-detection.ts +195 -0
- package/src/__tests__/benchmark/run-depth-validation.ts +3 -3
- package/src/__tests__/benchmark/run-real-world-test.ts +4 -4
- package/src/__tests__/benchmark/types.ts +1 -1
- package/src/__tests__/benchmark/utils/test-runner.ts +3 -3
- package/src/__tests__/category-filter.test.ts +2 -2
- package/src/__tests__/context-engine/cross-file-taint.test.ts +284 -0
- package/src/__tests__/context-engine/framework-models.test.ts +457 -0
- package/src/__tests__/context-engine/function-classifier.test.ts +146 -0
- package/src/__tests__/context-engine/import-resolver.test.ts +328 -0
- package/src/__tests__/context-engine/integration.test.ts +320 -0
- package/src/__tests__/context-engine/module-graph.test.ts +159 -0
- package/src/__tests__/context-engine/route-discovery/auth-resolver.test.ts +353 -0
- package/src/__tests__/context-engine/route-discovery/express.test.ts +150 -0
- package/src/__tests__/context-engine/route-discovery/nextjs.test.ts +138 -0
- package/src/__tests__/context-engine/route-discovery/python.test.ts +95 -0
- package/src/__tests__/context-engine/sanitiser-detection.test.ts +187 -0
- package/src/__tests__/context-engine/sink-matcher.test.ts +251 -0
- package/src/__tests__/context-engine/source-discovery.test.ts +186 -0
- package/src/__tests__/context-engine/taint-tracker.test.ts +182 -0
- package/src/__tests__/regression/agent-skill-benign.test.ts +174 -0
- package/src/__tests__/regression/known-false-positives.test.ts +312 -4
- package/src/__tests__/score/adjustments.test.ts +385 -0
- package/src/__tests__/score/confidence.test.ts +283 -0
- package/src/__tests__/score/framework-scoring.test.ts +275 -0
- package/src/__tests__/score/route-scoring.test.ts +156 -0
- package/src/__tests__/score/scoring-integration.test.ts +165 -0
- package/src/__tests__/score/taint-adjustments.test.ts +244 -0
- package/src/__tests__/snapshots/__snapshots__/anthropic-validation-refactor.test.ts.snap +37 -49
- package/src/__tests__/snapshots/__snapshots__/dangerous-functions-refactor.test.ts.snap +52 -0
- package/src/__tests__/snapshots/__snapshots__/scan-depth.test.ts.snap +3 -3
- package/src/__tests__/snapshots/anthropic-validation-refactor.test.ts +2 -2
- package/src/__tests__/snapshots/dangerous-functions-refactor.test.ts +1 -1
- package/src/__tests__/snapshots/scan-depth.test.ts +3 -3
- package/src/__tests__/validate/route-annotations.test.ts +138 -0
- package/src/__tests__/validation/analyze-results.ts +1 -1
- package/src/__tests__/validation/extract-for-triage.ts +1 -1
- package/src/__tests__/validation/fp-deep-analysis.ts +1 -1
- package/src/{layer2/ai-agent-tools.ts → detect/ai-code/agent-tools.ts} +23 -3
- package/src/{layer2 → detect/ai-code}/byok-patterns.ts +17 -5
- package/src/{layer2/ai-endpoint-protection.ts → detect/ai-code/endpoint-protection.ts} +8 -4
- package/src/{layer2/ai-execution-sinks.ts → detect/ai-code/execution-sinks.ts} +8 -4
- package/src/{layer2/ai-fingerprinting.ts → detect/ai-code/fingerprinting.ts} +20 -4
- package/src/detect/ai-code/index.ts +11 -0
- package/src/{layer2/ai-mcp-security.ts → detect/ai-code/mcp-security.ts} +7 -3
- package/src/{layer2 → detect/ai-code}/model-supply-chain.ts +7 -3
- package/src/{layer2/ai-package-hallucination.ts → detect/ai-code/package-hallucination.ts} +18 -3
- package/src/{layer2/ai-prompt-hygiene.ts → detect/ai-code/prompt-hygiene.ts} +25 -3
- package/src/{layer2/ai-rag-safety.ts → detect/ai-code/rag-safety.ts} +7 -3
- package/src/{layer2/ai-schema-validation.ts → detect/ai-code/schema-validation.ts} +7 -3
- package/src/detect/config/agent-skill-injection.ts +551 -0
- package/src/{layer1 → detect/config}/comments.ts +6 -2
- package/src/{layer1 → detect/config}/file-flags.ts +9 -3
- package/src/detect/config/index.ts +6 -0
- package/src/{layer3 → detect/config}/osv-check.ts +3 -2
- package/src/{layer3 → detect/config}/package-check.ts +3 -2
- package/src/{layer1 → detect/config}/urls.ts +12 -5
- package/src/detect/index.ts +131 -0
- package/src/{layer1 → detect/secrets}/config-audit.ts +7 -2
- package/src/{layer1 → detect/secrets}/config-mcp-audit.ts +8 -3
- package/src/{layer1 → detect/secrets}/entropy.ts +23 -11
- package/src/{layer1 → detect/secrets}/index.ts +31 -30
- package/src/{layer1 → detect/secrets}/patterns.ts +10 -3
- package/src/{layer1 → detect/secrets}/weak-crypto.ts +7 -2
- package/src/{layer2/auth-antipatterns.ts → detect/structural/auth-patterns.ts} +23 -11
- package/src/{layer2 → detect/structural}/dangerous-functions/dom-xss.ts +1 -1
- package/src/{layer2 → detect/structural}/dangerous-functions/index.ts +47 -24
- package/src/{layer2 → detect/structural}/dangerous-functions/json-parse.ts +10 -2
- package/src/{layer2 → detect/structural}/dangerous-functions/math-random.ts +2 -2
- package/src/{layer2 → detect/structural}/dangerous-functions/patterns.ts +1 -1
- package/src/{layer2 → detect/structural}/dangerous-functions/request-validation.ts +10 -2
- package/src/{layer2 → detect/structural}/dangerous-functions/utils/control-flow.ts +2 -2
- package/src/{layer2 → detect/structural}/data-exposure.ts +11 -3
- package/src/{layer2 → detect/structural}/framework-checks.ts +10 -11
- package/src/{layer2 → detect/structural}/index.ts +80 -77
- package/src/detect/structural/log-injection.ts +254 -0
- package/src/{layer2 → detect/structural}/logic-gates.ts +13 -5
- package/src/{layer2 → detect/structural}/risky-imports.ts +7 -3
- package/src/detect/structural/security-headers.ts +231 -0
- package/src/detect/structural/ssrf-detection.ts +300 -0
- package/src/{layer2 → detect/structural}/variables.ts +7 -3
- package/src/detect/structural/xxe-detection.ts +295 -0
- package/src/index.ts +39 -1291
- package/src/{utils → model}/auth-helper-detector.ts +1 -1
- package/src/model/cross-file-taint.ts +374 -0
- package/src/model/framework-models/django.ts +82 -0
- package/src/model/framework-models/express.ts +54 -0
- package/src/model/framework-models/index.ts +116 -0
- package/src/model/framework-models/nextjs.ts +69 -0
- package/src/model/framework-models/prisma.ts +57 -0
- package/src/model/framework-models/react.ts +63 -0
- package/src/model/framework-models/sequelize.ts +63 -0
- package/src/model/framework-models/types.ts +46 -0
- package/src/model/function-classifier.ts +184 -0
- package/src/model/import-resolver.ts +453 -0
- package/src/{utils → model}/imported-auth-detector.ts +21 -85
- package/src/model/index.ts +353 -0
- package/src/{utils → model}/middleware-detector.ts +156 -17
- package/src/model/module-graph.ts +254 -0
- package/src/{utils → model}/oauth-flow-detector.ts +1 -1
- package/src/{utils/project-context-builder.ts → model/project-context.ts} +1 -1
- package/src/model/route-auth-resolver.ts +216 -0
- package/src/model/route-discovery/express.ts +251 -0
- package/src/model/route-discovery/index.ts +83 -0
- package/src/model/route-discovery/nextjs.ts +216 -0
- package/src/model/route-discovery/python.ts +214 -0
- package/src/model/route-discovery/types.ts +48 -0
- package/src/model/route-discovery/utils.ts +54 -0
- package/src/model/sanitiser-detection.ts +268 -0
- package/src/model/sink-matcher.ts +178 -0
- package/src/model/sink-patterns.ts +109 -0
- package/src/model/source-discovery.ts +209 -0
- package/src/model/taint-tracker.ts +333 -0
- package/src/model/taint-types.ts +149 -0
- package/src/{utils → model}/trpc-analyzer.ts +1 -1
- package/src/{utils/context-helpers.ts → parse/file-classifier.ts} +54 -0
- package/src/{utils → parse}/path-exclusions.ts +1 -1
- package/src/pipeline/config.ts +81 -0
- package/src/pipeline/index.ts +437 -0
- package/src/{modes → pipeline/modes}/incremental.ts +5 -5
- package/src/postprocess/aggregation.ts +74 -0
- package/src/postprocess/contradictions.ts +128 -0
- package/src/postprocess/dedup.ts +62 -0
- package/src/{filtering → postprocess/filtering}/__tests__/pipeline.test.ts +1 -1
- package/src/{filtering → postprocess/filtering}/context-adjustments.ts +2 -2
- package/src/{filtering → postprocess/filtering}/pipeline.ts +2 -2
- package/src/postprocess/index.ts +118 -0
- package/src/{suppression → postprocess/suppression}/config-loader.ts +1 -1
- package/src/{suppression → postprocess/suppression}/hash.ts +1 -1
- package/src/{suppression → postprocess/suppression}/inline-parser.ts +1 -1
- package/src/{suppression → postprocess/suppression}/manager.ts +1 -1
- package/src/{suppression → postprocess/suppression}/types.ts +2 -2
- package/src/postprocess/validation-cap.ts +66 -0
- package/src/report/build-result.ts +94 -0
- package/src/report/enrichment.ts +52 -0
- package/src/{formatters → report/formatters}/ai-context.ts +1 -1
- package/src/{formatters → report/formatters}/cli-terminal.ts +11 -11
- package/src/{formatters → report/formatters}/github-comment.ts +1 -1
- package/src/{formatters → report/formatters}/grouping.ts +8 -8
- package/src/{formatters → report/formatters}/ide/claude-code.ts +1 -1
- package/src/{formatters → report/formatters}/ide/cursor.ts +1 -1
- package/src/{formatters → report/formatters}/ide/windsurf.ts +1 -1
- package/src/{formatters → report/formatters}/vscode-diagnostic.ts +1 -1
- package/src/report/summary.ts +70 -0
- package/src/score/adjustments.ts +387 -0
- package/src/{layer3/anthropic → score}/auto-dismiss.ts +15 -14
- package/src/score/confidence.ts +66 -0
- package/src/score/index.ts +316 -0
- package/src/score/types.ts +187 -0
- package/src/{baseline → shared/baseline}/__tests__/diff.test.ts +2 -2
- package/src/{baseline → shared/baseline}/diff.ts +1 -1
- package/src/{baseline → shared/baseline}/manager.ts +1 -1
- package/src/{category-filter.ts → shared/category-filter.ts} +1 -1
- package/src/{utils → shared}/code-analysis.ts +1 -1
- package/src/{rules → shared/rules}/__tests__/metadata.test.ts +7 -0
- package/src/{rules → shared/rules}/framework-fixes.ts +1 -1
- package/src/{rules → shared/rules}/metadata.ts +94 -0
- package/src/{types.ts → shared/types.ts} +22 -5
- package/src/tiers.ts +18 -1
- package/src/validate/__tests__/context-extractor.test.ts +191 -0
- package/src/validate/__tests__/prompt-assembly.test.ts +233 -0
- package/src/validate/__tests__/request-builder.test.ts +347 -0
- package/src/{layer3/anthropic → validate}/index.ts +8 -7
- package/src/{layer3/anthropic → validate}/prompts/index.ts +2 -0
- package/src/validate/prompts/modules/ai-patterns.ts +153 -0
- package/src/validate/prompts/modules/auth-access.ts +22 -0
- package/src/validate/prompts/modules/common.ts +183 -0
- package/src/validate/prompts/modules/index.ts +204 -0
- package/src/validate/prompts/modules/owasp-classic.ts +81 -0
- package/src/validate/prompts/modules/secrets-crypto.ts +65 -0
- package/src/validate/prompts/modules/xss-prompt.ts +19 -0
- package/src/validate/prompts/validation.ts +20 -0
- package/src/{layer3/anthropic → validate}/providers/anthropic.ts +28 -27
- package/src/validate/providers/index.ts +8 -0
- package/src/{layer3/anthropic → validate}/providers/openai.ts +30 -25
- package/src/validate/request-builder.ts +448 -0
- package/src/{layer3/anthropic → validate}/types.ts +1 -1
- package/src/validate/utils/context-extractor.ts +220 -0
- package/src/{layer3/anthropic → validate}/utils/index.ts +10 -0
- package/src/{layer3/anthropic → validate}/utils/response-parser.ts +2 -1
- package/src/layer3/anthropic/prompts/validation.ts +0 -419
- package/src/layer3/anthropic/providers/index.ts +0 -8
- package/src/layer3/anthropic/request-builder.ts +0 -150
- package/src/layer3/index.ts +0 -168
- /package/src/{layer3 → detect/config}/__tests__/osv-check.test.ts +0 -0
- /package/src/{layer2 → detect/structural}/__tests__/math-random-enhanced.test.ts +0 -0
- /package/src/{layer2 → detect/structural}/dangerous-functions/child-process.ts +0 -0
- /package/src/{layer2 → detect/structural}/dangerous-functions/utils/helpers.ts +0 -0
- /package/src/{layer2 → detect/structural}/dangerous-functions/utils/index.ts +0 -0
- /package/src/{layer2 → detect/structural}/dangerous-functions/utils/schema-validation.ts +0 -0
- /package/src/{utils → model}/route-hierarchy.ts +0 -0
- /package/src/{filtering → postprocess/filtering}/index.ts +0 -0
- /package/src/{suppression → postprocess/suppression}/__tests__/config-loader.test.ts +0 -0
- /package/src/{suppression → postprocess/suppression}/__tests__/hash.test.ts +0 -0
- /package/src/{suppression → postprocess/suppression}/__tests__/inline-parser.test.ts +0 -0
- /package/src/{suppression → postprocess/suppression}/__tests__/manager.test.ts +0 -0
- /package/src/{suppression → postprocess/suppression}/index.ts +0 -0
- /package/src/{formatters → report/formatters}/__tests__/ai-context.test.ts +0 -0
- /package/src/{formatters → report/formatters}/ide/__tests__/ide.test.ts +0 -0
- /package/src/{formatters → report/formatters}/ide/index.ts +0 -0
- /package/src/{formatters → report/formatters}/index.ts +0 -0
- /package/src/{utils → shared}/__tests__/code-analysis.test.ts +0 -0
- /package/src/{utils → shared}/__tests__/parsed-file.test.ts +0 -0
- /package/src/{ai-context → shared/ai-context}/__tests__/manager.test.ts +0 -0
- /package/src/{ai-context → shared/ai-context}/index.ts +0 -0
- /package/src/{ai-context → shared/ai-context}/manager.ts +0 -0
- /package/src/{baseline → shared/baseline}/__tests__/manager.test.ts +0 -0
- /package/src/{baseline → shared/baseline}/index.ts +0 -0
- /package/src/{baseline → shared/baseline}/types.ts +0 -0
- /package/src/{utils → shared}/comment-analyzer.ts +0 -0
- /package/src/{utils → shared}/diff-detector.ts +0 -0
- /package/src/{utils → shared}/diff-parser.ts +0 -0
- /package/src/{utils → shared}/environment-context.ts +0 -0
- /package/src/{utils → shared}/intent-detector.ts +0 -0
- /package/src/{utils → shared}/parsed-file.ts +0 -0
- /package/src/{utils → shared}/registry-clients.ts +0 -0
- /package/src/{rules → shared/rules}/__tests__/framework-fixes.test.ts +0 -0
- /package/src/{rules → shared/rules}/index.ts +0 -0
- /package/src/{utils → shared}/schema-semantics.ts +0 -0
- /package/src/{layer3/anthropic → validate}/clients.ts +0 -0
- /package/src/{layer3/anthropic → validate}/prompts/semantic-analysis.ts +0 -0
- /package/src/{layer3/anthropic → validate}/utils/path-helpers.ts +0 -0
- /package/src/{layer3/anthropic → validate}/utils/retry.ts +0 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* General Helper Utilities
|
|
4
|
+
*
|
|
5
|
+
* Small utility functions used across the dangerous functions detection module.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.getLineContent = getLineContent;
|
|
9
|
+
exports.getLineRange = getLineRange;
|
|
10
|
+
exports.hasOnlyStaticInputs = hasOnlyStaticInputs;
|
|
11
|
+
exports.hasPathTraversalProtection = hasPathTraversalProtection;
|
|
12
|
+
exports.hasThrowingAuthHelper = hasThrowingAuthHelper;
|
|
13
|
+
/**
|
|
14
|
+
* Get a specific line from content by line number (0-indexed)
|
|
15
|
+
*/
|
|
16
|
+
function getLineContent(content, lineNumber) {
|
|
17
|
+
const lines = content.split('\n');
|
|
18
|
+
return lines[lineNumber] || '';
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get a range of lines from content
|
|
22
|
+
*/
|
|
23
|
+
function getLineRange(content, startLine, endLine) {
|
|
24
|
+
const lines = content.split('\n');
|
|
25
|
+
const start = Math.max(0, startLine);
|
|
26
|
+
const end = Math.min(lines.length, endLine);
|
|
27
|
+
return lines.slice(start, end).join('\n');
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Check if eval/exec/Function has only static literal inputs (no user data)
|
|
31
|
+
* Static inputs like eval('({ mode: "production" })') are low risk
|
|
32
|
+
*
|
|
33
|
+
* Returns true ONLY if the argument is a string literal (not a variable)
|
|
34
|
+
*/
|
|
35
|
+
function hasOnlyStaticInputs(lineContent, content, lineNumber) {
|
|
36
|
+
// Check if the argument to eval/exec/Function is a string literal ONLY
|
|
37
|
+
// If it's a variable, it's NOT static (could come from anywhere)
|
|
38
|
+
//
|
|
39
|
+
// String literal patterns:
|
|
40
|
+
// - Single quotes: 'content with "double quotes" inside' (no $ interpolation)
|
|
41
|
+
// - Double quotes: "content" (no $ interpolation)
|
|
42
|
+
// - Backticks without ${}: `content` (template literal but no interpolation)
|
|
43
|
+
//
|
|
44
|
+
// Note: We allow quotes INSIDE the string (e.g., 'text "with" quotes')
|
|
45
|
+
// but NOT $ (which would indicate interpolation)
|
|
46
|
+
const staticPatterns = [
|
|
47
|
+
// Single-quoted string: eval('...') - can contain anything except single quotes and $
|
|
48
|
+
/eval\s*\(\s*'[^'$]*'\s*\)/,
|
|
49
|
+
// Double-quoted string: eval("...") - can contain anything except double quotes and $
|
|
50
|
+
/eval\s*\(\s*"[^"$]*"\s*\)/,
|
|
51
|
+
// Backtick without interpolation: eval(`...`) - must not have ${ inside
|
|
52
|
+
/eval\s*\(\s*`[^`$]*`\s*\)/,
|
|
53
|
+
// Function constructor with string literal
|
|
54
|
+
/new\s+Function\s*\(\s*'[^'$]*'\s*\)/,
|
|
55
|
+
/new\s+Function\s*\(\s*"[^"$]*"\s*\)/,
|
|
56
|
+
// execSync with string literal
|
|
57
|
+
/execSync\s*\(\s*'[^'$]*'\s*\)/,
|
|
58
|
+
/execSync\s*\(\s*"[^"$]*"\s*\)/,
|
|
59
|
+
// exec with string literal
|
|
60
|
+
/exec\s*\(\s*'[^'$]*'/,
|
|
61
|
+
/exec\s*\(\s*"[^"$]*"/,
|
|
62
|
+
];
|
|
63
|
+
// Only return true if it matches a static pattern (string literal)
|
|
64
|
+
// If it's a variable like eval(code), we can't assume it's static
|
|
65
|
+
return staticPatterns.some(p => p.test(lineContent));
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Check if path traversal protection is in place
|
|
69
|
+
* Looks for common sanitization patterns that prevent directory traversal attacks
|
|
70
|
+
*/
|
|
71
|
+
function hasPathTraversalProtection(context, lineContent) {
|
|
72
|
+
const protectionPatterns = [
|
|
73
|
+
// Path normalization with base directory check (same line)
|
|
74
|
+
/path\.resolve\s*\([^)]+\).*\.startsWith\s*\(/i,
|
|
75
|
+
// startsWith check with common safe directory variable names
|
|
76
|
+
/\.startsWith\s*\([^)]*(?:baseDir|basePath|rootDir|uploadDir|allowedDir|safeDir|SAFE_)/i,
|
|
77
|
+
// MULTI-LINE PATTERN: path.resolve followed by startsWith check in context
|
|
78
|
+
// This handles the common case where resolve and startsWith are on separate lines:
|
|
79
|
+
// const resolved = path.resolve(baseDir, userPath)
|
|
80
|
+
// if (!resolved.startsWith(baseDir)) throw new Error()
|
|
81
|
+
// We check for BOTH patterns being present in the context
|
|
82
|
+
// (handled below as combined check)
|
|
83
|
+
// Explicit ".." rejection
|
|
84
|
+
/\.includes\s*\(\s*['"`]\.\.['"`]\s*\)/i,
|
|
85
|
+
/\.indexOf\s*\(\s*['"`]\.\.['"`]\s*\)/i,
|
|
86
|
+
/['"`]\.\.['"`].*(?:throw|reject|return|error)/i,
|
|
87
|
+
// Replace ".." pattern (sanitization)
|
|
88
|
+
/\.replace\s*\([^)]*\\?\.\\?\.\s*[^)]*,\s*['"`]['"`]\s*\)/i,
|
|
89
|
+
// Path sanitization libraries
|
|
90
|
+
/sanitizePath|sanitizeFilename|sanitize-filename/i,
|
|
91
|
+
/path-sanitizer|secure-path/i,
|
|
92
|
+
// Explicit path validation
|
|
93
|
+
/validatePath|isValidPath|checkPath|verifyPath/i,
|
|
94
|
+
/isPathAllowed|isAllowedPath|pathIsAllowed/i,
|
|
95
|
+
// Normalize and check pattern
|
|
96
|
+
/path\.normalize\s*\([^)]+\).*(?:startsWith|includes|indexOf)/i,
|
|
97
|
+
// Regex validation for safe characters only
|
|
98
|
+
/\/\^?\[a-zA-Z0-9_\-\.\\\/\]\+\$?\//, // Only alphanumeric, dash, underscore, dot
|
|
99
|
+
// Allowlist/whitelist patterns
|
|
100
|
+
/allowedExtensions|allowedTypes|whitelist/i,
|
|
101
|
+
/\.endsWith\s*\(\s*['"`]\.\w+['"`]\s*\)/i, // Extension check
|
|
102
|
+
// Path.basename to strip directory
|
|
103
|
+
/path\.basename\s*\(/i,
|
|
104
|
+
// Zod/validation for filename patterns
|
|
105
|
+
/z\.string\s*\(\s*\)\.regex\s*\(/i,
|
|
106
|
+
];
|
|
107
|
+
// Check single-line patterns
|
|
108
|
+
if (protectionPatterns.some(p => p.test(context) || p.test(lineContent))) {
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
// Multi-line pattern: path.resolve + startsWith check on separate lines
|
|
112
|
+
// This is a very common secure pattern:
|
|
113
|
+
// const resolved = path.resolve(safeBaseDir, userInput)
|
|
114
|
+
// if (!resolved.startsWith(safeBaseDir)) { throw ... }
|
|
115
|
+
const hasPathResolve = /path\.resolve\s*\(/i.test(context);
|
|
116
|
+
const hasStartsWithCheck = /\.startsWith\s*\(/i.test(context);
|
|
117
|
+
const hasThrowOnFailure = /(throw|return|reject)\s+.*(error|invalid|denied)/i.test(context);
|
|
118
|
+
if (hasPathResolve && hasStartsWithCheck && hasThrowOnFailure) {
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Check if route has throwing auth helper (getCurrentUserId, requireAuth, etc.)
|
|
125
|
+
* Routes with throwing auth helpers are already protected
|
|
126
|
+
*/
|
|
127
|
+
function hasThrowingAuthHelper(content) {
|
|
128
|
+
const throwingAuthPatterns = [
|
|
129
|
+
/\bgetCurrentUserId\s*\(/i,
|
|
130
|
+
/\brequireAuth\s*\(/i,
|
|
131
|
+
/\bensureAuth\s*\(/i,
|
|
132
|
+
/\bauth\s*\(\s*\)\s*\.protect\s*\(/i, // Clerk: auth().protect()
|
|
133
|
+
/\bcurrentUser\s*\(\s*\)/i, // Clerk: currentUser()
|
|
134
|
+
/\bgetServerSession\s*\([^)]*\)/i, // NextAuth
|
|
135
|
+
/\bauth\s*\(\s*\)/i, // Generic auth() call
|
|
136
|
+
/\bcheckAuth\s*\(/i,
|
|
137
|
+
/\bverifyAuth\s*\(/i,
|
|
138
|
+
/\bvalidateAuth\s*\(/i,
|
|
139
|
+
/\bassertAuth\s*\(/i,
|
|
140
|
+
/\bgetAuth\s*\(/i,
|
|
141
|
+
/\brequireUser\s*\(/i,
|
|
142
|
+
/\bgetUser\s*\(\s*\)/i, // supabase.auth.getUser()
|
|
143
|
+
/const\s+\{\s*user\s*\}\s*=\s*await/i, // Destructuring pattern
|
|
144
|
+
];
|
|
145
|
+
return throwingAuthPatterns.some(p => p.test(content));
|
|
146
|
+
}
|
|
147
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../src/detect/structural/dangerous-functions/utils/helpers.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAKH,wCAGC;AAKD,oCASC;AAQD,kDAoCC;AAMD,gEAoEC;AAMD,sDAmBC;AAnKD;;GAEG;AACH,SAAgB,cAAc,CAAC,OAAe,EAAE,UAAkB;IAChE,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACjC,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,CAAA;AAChC,CAAC;AAED;;GAEG;AACH,SAAgB,YAAY,CAC1B,OAAe,EACf,SAAiB,EACjB,OAAe;IAEf,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACjC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAA;IACpC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC3C,OAAO,KAAK,CA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
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility Functions Index
|
|
3
|
+
*
|
|
4
|
+
* Re-exports all utility functions from the dangerous-functions module.
|
|
5
|
+
*/
|
|
6
|
+
export { isInsideTryCatch, hasTryCatchNearby, extractFunctionContext, } from './control-flow';
|
|
7
|
+
export { hasSchemaValidationNearby, hasManualValidation, hasSQLWhitelistValidation, } from './schema-validation';
|
|
8
|
+
export { getLineContent, getLineRange, hasOnlyStaticInputs, hasPathTraversalProtection, hasThrowingAuthHelper, } from './helpers';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/detect/structural/dangerous-functions/utils/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EACL,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,WAAW,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Utility Functions Index
|
|
4
|
+
*
|
|
5
|
+
* Re-exports all utility functions from the dangerous-functions module.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.hasThrowingAuthHelper = exports.hasPathTraversalProtection = exports.hasOnlyStaticInputs = exports.getLineRange = exports.getLineContent = exports.hasSQLWhitelistValidation = exports.hasManualValidation = exports.hasSchemaValidationNearby = exports.extractFunctionContext = exports.hasTryCatchNearby = exports.isInsideTryCatch = void 0;
|
|
9
|
+
var control_flow_1 = require("./control-flow");
|
|
10
|
+
Object.defineProperty(exports, "isInsideTryCatch", { enumerable: true, get: function () { return control_flow_1.isInsideTryCatch; } });
|
|
11
|
+
Object.defineProperty(exports, "hasTryCatchNearby", { enumerable: true, get: function () { return control_flow_1.hasTryCatchNearby; } });
|
|
12
|
+
Object.defineProperty(exports, "extractFunctionContext", { enumerable: true, get: function () { return control_flow_1.extractFunctionContext; } });
|
|
13
|
+
var schema_validation_1 = require("./schema-validation");
|
|
14
|
+
Object.defineProperty(exports, "hasSchemaValidationNearby", { enumerable: true, get: function () { return schema_validation_1.hasSchemaValidationNearby; } });
|
|
15
|
+
Object.defineProperty(exports, "hasManualValidation", { enumerable: true, get: function () { return schema_validation_1.hasManualValidation; } });
|
|
16
|
+
Object.defineProperty(exports, "hasSQLWhitelistValidation", { enumerable: true, get: function () { return schema_validation_1.hasSQLWhitelistValidation; } });
|
|
17
|
+
var helpers_1 = require("./helpers");
|
|
18
|
+
Object.defineProperty(exports, "getLineContent", { enumerable: true, get: function () { return helpers_1.getLineContent; } });
|
|
19
|
+
Object.defineProperty(exports, "getLineRange", { enumerable: true, get: function () { return helpers_1.getLineRange; } });
|
|
20
|
+
Object.defineProperty(exports, "hasOnlyStaticInputs", { enumerable: true, get: function () { return helpers_1.hasOnlyStaticInputs; } });
|
|
21
|
+
Object.defineProperty(exports, "hasPathTraversalProtection", { enumerable: true, get: function () { return helpers_1.hasPathTraversalProtection; } });
|
|
22
|
+
Object.defineProperty(exports, "hasThrowingAuthHelper", { enumerable: true, get: function () { return helpers_1.hasThrowingAuthHelper; } });
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/detect/structural/dangerous-functions/utils/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,+CAIuB;AAHrB,gHAAA,gBAAgB,OAAA;AAChB,iHAAA,iBAAiB,OAAA;AACjB,sHAAA,sBAAsB,OAAA;AAGxB,yDAI4B;AAH1B,8HAAA,yBAAyB,OAAA;AACzB,wHAAA,mBAAmB,OAAA;AACnB,8HAAA,yBAAyB,OAAA;AAG3B,qCAMkB;AALhB,yGAAA,cAAc,OAAA;AACd,uGAAA,YAAY,OAAA;AACZ,8GAAA,mBAAmB,OAAA;AACnB,qHAAA,0BAA0B,OAAA;AAC1B,gHAAA,qBAAqB,OAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schema Validation Detection Utilities
|
|
3
|
+
*
|
|
4
|
+
* Functions for detecting schema validation patterns (zod, yup, joi, etc.)
|
|
5
|
+
* and manual validation patterns.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Check if schema validation is applied near a JSON.parse call
|
|
9
|
+
* Looks for zod, yup, joi, or similar validation patterns
|
|
10
|
+
*/
|
|
11
|
+
export declare function hasSchemaValidationNearby(content: string, lineNumber: number): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Check if this file appears to have form/input validation elsewhere
|
|
14
|
+
* (manual checks on body fields, type guards, etc.)
|
|
15
|
+
*/
|
|
16
|
+
export declare function hasManualValidation(content: string): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Check if SQL query uses whitelist validation pattern
|
|
19
|
+
* e.g., columns validated against allowedColumns array before use
|
|
20
|
+
*/
|
|
21
|
+
export declare function hasSQLWhitelistValidation(content: string, lineNumber: number): boolean;
|
|
22
|
+
//# sourceMappingURL=schema-validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-validation.d.ts","sourceRoot":"","sources":["../../../../../src/detect/structural/dangerous-functions/utils/schema-validation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAkCtF;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAe5D;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAiCtF"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Schema Validation Detection Utilities
|
|
4
|
+
*
|
|
5
|
+
* Functions for detecting schema validation patterns (zod, yup, joi, etc.)
|
|
6
|
+
* and manual validation patterns.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.hasSchemaValidationNearby = hasSchemaValidationNearby;
|
|
10
|
+
exports.hasManualValidation = hasManualValidation;
|
|
11
|
+
exports.hasSQLWhitelistValidation = hasSQLWhitelistValidation;
|
|
12
|
+
/**
|
|
13
|
+
* Check if schema validation is applied near a JSON.parse call
|
|
14
|
+
* Looks for zod, yup, joi, or similar validation patterns
|
|
15
|
+
*/
|
|
16
|
+
function hasSchemaValidationNearby(content, lineNumber) {
|
|
17
|
+
const lines = content.split('\n');
|
|
18
|
+
const start = Math.max(0, lineNumber - 5);
|
|
19
|
+
const end = Math.min(lines.length, lineNumber + 10);
|
|
20
|
+
const context = lines.slice(start, end).join('\n');
|
|
21
|
+
const schemaValidationPatterns = [
|
|
22
|
+
// Zod patterns
|
|
23
|
+
/z\.(object|string|number|array|boolean)\s*\(/i,
|
|
24
|
+
/\.parse\s*\(/i,
|
|
25
|
+
/\.safeParse\s*\(/i,
|
|
26
|
+
/schema\.parse/i,
|
|
27
|
+
/Schema\.parse/i,
|
|
28
|
+
// Yup patterns
|
|
29
|
+
/yup\.(object|string|number|array|boolean)\s*\(/i,
|
|
30
|
+
/\.validate\s*\(/i,
|
|
31
|
+
/\.validateSync\s*\(/i,
|
|
32
|
+
// Joi patterns
|
|
33
|
+
/Joi\.(object|string|number|array|boolean)\s*\(/i,
|
|
34
|
+
/\.validateAsync\s*\(/i,
|
|
35
|
+
// Valibot patterns
|
|
36
|
+
/v\.(object|string|number|array|boolean)\s*\(/i,
|
|
37
|
+
// AJV patterns
|
|
38
|
+
/ajv\.compile/i,
|
|
39
|
+
/validate\s*\(\s*schema/i,
|
|
40
|
+
// TypeBox patterns
|
|
41
|
+
/Type\.(Object|String|Number|Array|Boolean)\s*\(/i,
|
|
42
|
+
// Generic validation patterns
|
|
43
|
+
/validateSchema/i,
|
|
44
|
+
/schemaValidator/i,
|
|
45
|
+
/parseAndValidate/i,
|
|
46
|
+
];
|
|
47
|
+
return schemaValidationPatterns.some(p => p.test(context));
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Check if this file appears to have form/input validation elsewhere
|
|
51
|
+
* (manual checks on body fields, type guards, etc.)
|
|
52
|
+
*/
|
|
53
|
+
function hasManualValidation(content) {
|
|
54
|
+
const manualValidationPatterns = [
|
|
55
|
+
// Type checking / type guards
|
|
56
|
+
/typeof\s+\w+\s*[!=]==?\s*['"](?:string|number|boolean|object)['"]|Array\.isArray\s*\(/i,
|
|
57
|
+
// Field existence checks followed by throws/returns
|
|
58
|
+
/if\s*\(\s*!(?:body|data|input)\.\w+\s*\)\s*\{?\s*(throw|return)/i,
|
|
59
|
+
// Property access with type assertion comments or inline validation
|
|
60
|
+
/\b(body|data|input)\s*as\s+\w+/i, // Type assertion
|
|
61
|
+
// Manual validation with error handling
|
|
62
|
+
/if\s*\(\s*![\w.]+\s*\|\|\s*typeof\s+[\w.]+/i,
|
|
63
|
+
// Using type predicates
|
|
64
|
+
/is\w+\s*\([\w.]+\)/i, // isFoo(bar) pattern
|
|
65
|
+
];
|
|
66
|
+
return manualValidationPatterns.some(p => p.test(content));
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Check if SQL query uses whitelist validation pattern
|
|
70
|
+
* e.g., columns validated against allowedColumns array before use
|
|
71
|
+
*/
|
|
72
|
+
function hasSQLWhitelistValidation(content, lineNumber) {
|
|
73
|
+
const lines = content.split('\n');
|
|
74
|
+
const contextStart = Math.max(0, lineNumber - 20);
|
|
75
|
+
const contextEnd = Math.min(lines.length, lineNumber + 5);
|
|
76
|
+
const context = lines.slice(contextStart, contextEnd).join('\n');
|
|
77
|
+
// Whitelist/allowlist validation patterns
|
|
78
|
+
const whitelistPatterns = [
|
|
79
|
+
// Array-based whitelists
|
|
80
|
+
/allowed\w*\s*=\s*\[/i, // allowedColumns = [...]
|
|
81
|
+
/whitelist\w*\s*=\s*\[/i, // whitelistFields = [...]
|
|
82
|
+
/valid\w*\s*=\s*\[/i, // validColumns = [...]
|
|
83
|
+
/\.filter\s*\([^)]*\.includes\s*\(/i, // .filter(c => allowed.includes(c))
|
|
84
|
+
/\.includes\s*\([^)]*\)/i, // allowedColumns.includes(col)
|
|
85
|
+
/\.every\s*\([^)]*\.includes/i, // columns.every(c => allowed.includes(c))
|
|
86
|
+
/if\s*\(\s*!.*\.includes/i, // if (!allowed.includes(...))
|
|
87
|
+
// Object-based whitelists (Record<string, string>)
|
|
88
|
+
/\w+\s+in\s+\w*(?:sortable|allowed|valid|whitelist)\w*/i, // sorter in sortableFields
|
|
89
|
+
/\w+\s+in\s+\w+Fields/i, // key in someFields
|
|
90
|
+
/:\s*Record<string,\s*string>/i, // Type annotation: Record<string, string>
|
|
91
|
+
/const\s+\w+Fields\s*:\s*\{[^}]*\}\s*=/i, // const xyzFields: {...} = (inline type)
|
|
92
|
+
/const\s+\w+Fields\s*=\s*\{[^}]*\}/i, // const xyzFields = { ... }
|
|
93
|
+
/if\s*\([^)]*\s+in\s+\w+Fields\s*\)/i, // if (x in yFields)
|
|
94
|
+
/&&\s*\w+\s+in\s+\w+/i, // && sorter in sortableFields
|
|
95
|
+
// Enum-based validation (ASC/DESC, etc.)
|
|
96
|
+
/===?\s*['"](?:ASC|DESC)['"]/i, // === 'ASC' or === 'DESC'
|
|
97
|
+
/===?\s*\w+\.(?:Asc|Desc|ASC|DESC)/i, // === SortType.Asc
|
|
98
|
+
/toLowerCase\s*\(\s*\)\s*===?\s*\w+\.(?:asc|desc)/i, // .toLowerCase() === SortType.asc
|
|
99
|
+
];
|
|
100
|
+
return whitelistPatterns.some(p => p.test(context));
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=schema-validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-validation.js","sourceRoot":"","sources":["../../../../../src/detect/structural/dangerous-functions/utils/schema-validation.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAMH,8DAkCC;AAMD,kDAeC;AAMD,8DAiCC;AAlGD;;;GAGG;AACH,SAAgB,yBAAyB,CAAC,OAAe,EAAE,UAAkB;IAC3E,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACjC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,GAAG,CAAC,CAAC,CAAA;IACzC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,UAAU,GAAG,EAAE,CAAC,CAAA;IACnD,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAElD,MAAM,wBAAwB,GAAG;QAC/B,eAAe;QACf,+CAA+C;QAC/C,eAAe;QACf,mBAAmB;QACnB,gBAAgB;QAChB,gBAAgB;QAChB,eAAe;QACf,iDAAiD;QACjD,kBAAkB;QAClB,sBAAsB;QACtB,eAAe;QACf,iDAAiD;QACjD,uBAAuB;QACvB,mBAAmB;QACnB,+CAA+C;QAC/C,eAAe;QACf,eAAe;QACf,yBAAyB;QACzB,mBAAmB;QACnB,kDAAkD;QAClD,8BAA8B;QAC9B,iBAAiB;QACjB,kBAAkB;QAClB,mBAAmB;KACpB,CAAA;IAED,OAAO,wBAAwB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAA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CAAoC,EAAE,4BAA4B;QAClE,qCAAqC,EAAE,oBAAoB;QAC3D,sBAAsB,EAAE,8BAA8B;QAEtD,yCAAyC;QACzC,8BAA8B,EAAE,0BAA0B;QAC1D,oCAAoC,EAAE,mBAAmB;QACzD,mDAAmD,EAAE,kCAAkC;KACxF,CAAA;IAED,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAA;AACrD,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layer 2: Data Exposure Detection
|
|
3
|
+
* Identifies sensitive data in logs vs API responses with appropriate severity
|
|
4
|
+
* Separates "logging concerns" from "response exposure" which have different risk profiles
|
|
5
|
+
*/
|
|
6
|
+
import type { Vulnerability } from '../../shared/types';
|
|
7
|
+
import type { ParsedFile } from '../../shared/parsed-file';
|
|
8
|
+
/**
|
|
9
|
+
* Detect sensitive data exposure in logs and API responses
|
|
10
|
+
*/
|
|
11
|
+
export declare function detectDataExposure(content: string, filePath: string, options?: {
|
|
12
|
+
parsed?: ParsedFile;
|
|
13
|
+
}): Vulnerability[];
|
|
14
|
+
/**
|
|
15
|
+
* Check if error handling follows safe patterns
|
|
16
|
+
* Returns true if the error handling appears safe
|
|
17
|
+
*/
|
|
18
|
+
export declare function isSafeErrorHandling(lineContent: string, surroundingLines: string[]): boolean;
|
|
19
|
+
//# sourceMappingURL=data-exposure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-exposure.d.ts","sourceRoot":"","sources":["../../../src/detect/structural/data-exposure.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAyB,MAAM,oBAAoB,CAAA;AAC9E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAyI1D;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,UAAU,CAAA;CAAE,GAChC,aAAa,EAAE,CAqIjB;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,GAAG,OAAO,CAW5F"}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Layer 2: Data Exposure Detection
|
|
4
|
+
* Identifies sensitive data in logs vs API responses with appropriate severity
|
|
5
|
+
* Separates "logging concerns" from "response exposure" which have different risk profiles
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.detectDataExposure = detectDataExposure;
|
|
9
|
+
exports.isSafeErrorHandling = isSafeErrorHandling;
|
|
10
|
+
const file_classifier_1 = require("../../parse/file-classifier");
|
|
11
|
+
const BASE_CONFIDENCE = 0.40;
|
|
12
|
+
const DATA_EXPOSURE_PATTERNS = [
|
|
13
|
+
// ============================================================================
|
|
14
|
+
// LOG SINKS - DISABLED
|
|
15
|
+
// Server logs are never exposed to users. After analysis of real codebases,
|
|
16
|
+
// 100% of console.error/warn findings were false positives.
|
|
17
|
+
// Logging is a standard debugging practice, not a security vulnerability.
|
|
18
|
+
// ============================================================================
|
|
19
|
+
// NOTE: The following patterns have been REMOVED to eliminate false positives:
|
|
20
|
+
// - 'Logging user ID' - user IDs in logs are standard practice
|
|
21
|
+
// - 'Logging error objects' - console.error(err) is correct error handling
|
|
22
|
+
// - 'Logging request body' - server logs are not exposed to clients
|
|
23
|
+
// - 'JSON.stringify error to log' - serializing errors for logs is fine
|
|
24
|
+
// ============================================================================
|
|
25
|
+
// RESPONSE SINKS (higher severity - exposed to clients)
|
|
26
|
+
// These are actual information disclosure risks
|
|
27
|
+
// ============================================================================
|
|
28
|
+
// Error stack traces in responses - CRITICAL
|
|
29
|
+
{
|
|
30
|
+
name: 'Stack trace in response',
|
|
31
|
+
pattern: /res\.(json|send|status\(\d+\)\.json)\s*\([^)]*\.stack|NextResponse\.json\s*\([^)]*\.stack/gi,
|
|
32
|
+
sink: 'response',
|
|
33
|
+
severity: 'high',
|
|
34
|
+
description: 'Stack trace exposed in API response. Reveals internal code paths and file structure to clients.',
|
|
35
|
+
suggestedFix: 'Never return stack traces to clients. Log server-side, return generic error message.',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'Full error object in response',
|
|
39
|
+
pattern: /res\.(json|send)\s*\(\s*(err|error|e)\s*\)|NextResponse\.json\s*\(\s*(err|error|e)\s*\)/gi,
|
|
40
|
+
sink: 'response',
|
|
41
|
+
severity: 'high',
|
|
42
|
+
description: 'Entire error object returned to client. May expose stack traces, internal paths, and sensitive details.',
|
|
43
|
+
suggestedFix: 'Return only { error: message } or a structured error response. Never return raw error objects.',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'Error object spread in response',
|
|
47
|
+
pattern: /res\.(json|send)\s*\(\s*\{[^}]*\.\.\.\s*(err|error|e)[^}]*\}|NextResponse\.json\s*\(\s*\{[^}]*\.\.\.\s*(err|error|e)/gi,
|
|
48
|
+
sink: 'response',
|
|
49
|
+
severity: 'high',
|
|
50
|
+
description: 'Error object spread into response. May expose stack traces and internal details.',
|
|
51
|
+
suggestedFix: 'Pick only safe properties: { error: err.message, code: err.code }',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'Detailed error in response',
|
|
55
|
+
pattern: /res\.(json|send|status\(\d+\)\.json)\s*\(\s*\{[^}]*(details|internal|debug|trace|stack)/gi,
|
|
56
|
+
sink: 'response',
|
|
57
|
+
severity: 'medium',
|
|
58
|
+
description: 'Detailed/internal error information in response may leak implementation details.',
|
|
59
|
+
suggestedFix: 'Remove detailed/internal/debug/trace information from client-facing error responses.',
|
|
60
|
+
},
|
|
61
|
+
// Error message in response - SAFE PATTERN (info only)
|
|
62
|
+
{
|
|
63
|
+
name: 'Error message in response (safe pattern)',
|
|
64
|
+
pattern: /res\.(json|send)\s*\([^)]*error:\s*(error|err|e)\.message|NextResponse\.json\s*\([^)]*error:\s*(error|err|e)\.message/gi,
|
|
65
|
+
sink: 'response',
|
|
66
|
+
severity: 'info',
|
|
67
|
+
description: 'Error message returned to client. Generally safe - this is the recommended error response pattern.',
|
|
68
|
+
suggestedFix: 'Verify error messages don\'t contain sensitive data. Consider using generic messages for auth errors.',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: 'Error message with toString',
|
|
72
|
+
pattern: /res\.(json|send)\s*\([^)]*error:\s*(error|err|e)\.toString|NextResponse\.json\s*\([^)]*error:\s*(error|err|e)\.toString/gi,
|
|
73
|
+
sink: 'response',
|
|
74
|
+
severity: 'low',
|
|
75
|
+
description: 'Error.toString() returned to client. May include error name and message - verify no sensitive data.',
|
|
76
|
+
suggestedFix: 'Prefer error.message over error.toString() for cleaner output.',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: 'String error message in response',
|
|
80
|
+
pattern: /res\.(json|send|status\(\d+\)\.json)\s*\(\s*\{\s*(error|message):\s*['"`][^'"`]+['"`]\s*\}/gi,
|
|
81
|
+
sink: 'response',
|
|
82
|
+
severity: 'info',
|
|
83
|
+
description: 'Static/string error message returned to client. This is the safest error response pattern.',
|
|
84
|
+
suggestedFix: 'No action needed - static error messages are safe.',
|
|
85
|
+
},
|
|
86
|
+
// ============================================================================
|
|
87
|
+
// BOTH SINKS (depends on context)
|
|
88
|
+
// ============================================================================
|
|
89
|
+
// Sensitive data exposure patterns
|
|
90
|
+
{
|
|
91
|
+
name: 'Exposing user object',
|
|
92
|
+
pattern: /res\.(json|send)\s*\([^)]*user\s*\)|NextResponse\.json\s*\([^)]*user\s*\)/gi,
|
|
93
|
+
sink: 'response',
|
|
94
|
+
severity: 'low',
|
|
95
|
+
description: 'User object returned in response. Ensure password hashes and sensitive fields are excluded.',
|
|
96
|
+
suggestedFix: 'Select only necessary user fields. Never expose password hashes, tokens, or internal IDs.',
|
|
97
|
+
},
|
|
98
|
+
];
|
|
99
|
+
/**
|
|
100
|
+
* Check if file path indicates low-risk logging context
|
|
101
|
+
*/
|
|
102
|
+
function isLowRiskLoggingFile(filePath) {
|
|
103
|
+
// Test files
|
|
104
|
+
if ((0, file_classifier_1.isTestOrMockFile)(filePath)) {
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
// Scripts, tools, CLI utilities
|
|
108
|
+
if (/\/(scripts?|tools?|cli|bin)\//i.test(filePath)) {
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
// Internal services/utilities (not API-facing)
|
|
112
|
+
if (/\/(services?|lib|utils?|helpers?)\//i.test(filePath) &&
|
|
113
|
+
!/\/(api|routes?)\//i.test(filePath)) {
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
116
|
+
// Component files (client-side, not API)
|
|
117
|
+
if (/\/(components?|pages?|views?)\//i.test(filePath) &&
|
|
118
|
+
!/route\.(ts|js)$/i.test(filePath)) {
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Detect sensitive data exposure in logs and API responses
|
|
125
|
+
*/
|
|
126
|
+
function detectDataExposure(content, filePath, options) {
|
|
127
|
+
const vulnerabilities = [];
|
|
128
|
+
// Skip scanner/fixture files to avoid self-detection
|
|
129
|
+
if ((0, file_classifier_1.isScannerOrFixtureFile)(filePath))
|
|
130
|
+
return vulnerabilities;
|
|
131
|
+
const lines = options?.parsed?.lines ?? content.split('\n');
|
|
132
|
+
const isTestFile = (0, file_classifier_1.isTestOrMockFile)(filePath);
|
|
133
|
+
const isLowRiskFile = isLowRiskLoggingFile(filePath);
|
|
134
|
+
// Determine if this is likely an API route file
|
|
135
|
+
const isApiFile = /\/(api|routes?|handlers?|controllers?)\//i.test(filePath) ||
|
|
136
|
+
/route\.(ts|js)$/i.test(filePath);
|
|
137
|
+
// Track log findings for aggregation
|
|
138
|
+
const logFindings = [];
|
|
139
|
+
lines.forEach((line, index) => {
|
|
140
|
+
// Skip comments
|
|
141
|
+
if ((0, file_classifier_1.isComment)(line))
|
|
142
|
+
return;
|
|
143
|
+
for (const pattern of DATA_EXPOSURE_PATTERNS) {
|
|
144
|
+
const regex = new RegExp(pattern.pattern.source, pattern.pattern.flags);
|
|
145
|
+
if (regex.test(line)) {
|
|
146
|
+
let severity = pattern.severity;
|
|
147
|
+
let description = pattern.description;
|
|
148
|
+
// Adjust severity based on context
|
|
149
|
+
if (isTestFile) {
|
|
150
|
+
severity = 'info';
|
|
151
|
+
description = `${description} (in test file)`;
|
|
152
|
+
}
|
|
153
|
+
// Log sinks get special handling for aggregation
|
|
154
|
+
if (pattern.sink === 'log') {
|
|
155
|
+
// In low-risk files, just aggregate without reporting individual findings
|
|
156
|
+
if (isLowRiskFile && severity === 'info') {
|
|
157
|
+
logFindings.push({ lineNumber: index + 1, lineContent: line.trim(), name: pattern.name });
|
|
158
|
+
break;
|
|
159
|
+
}
|
|
160
|
+
// Log sinks in non-API files are lower priority
|
|
161
|
+
if (!isApiFile) {
|
|
162
|
+
if (severity === 'low')
|
|
163
|
+
severity = 'info';
|
|
164
|
+
}
|
|
165
|
+
// Track for aggregation if info severity
|
|
166
|
+
if (severity === 'info') {
|
|
167
|
+
logFindings.push({ lineNumber: index + 1, lineContent: line.trim(), name: pattern.name });
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
// Response sinks in API files are higher priority
|
|
172
|
+
if (pattern.sink === 'response' && isApiFile) {
|
|
173
|
+
// Keep original severity - these are more critical in API routes
|
|
174
|
+
}
|
|
175
|
+
vulnerabilities.push({
|
|
176
|
+
id: `data-exposure-${filePath}-${index + 1}-${pattern.name}`,
|
|
177
|
+
filePath,
|
|
178
|
+
lineNumber: index + 1,
|
|
179
|
+
lineContent: line.trim(),
|
|
180
|
+
severity,
|
|
181
|
+
category: 'data_exposure',
|
|
182
|
+
title: pattern.name,
|
|
183
|
+
description,
|
|
184
|
+
suggestedFix: pattern.suggestedFix,
|
|
185
|
+
confidence: isTestFile ? 'low' : 'medium',
|
|
186
|
+
baseConfidence: BASE_CONFIDENCE,
|
|
187
|
+
layer: 2,
|
|
188
|
+
source: 'structural',
|
|
189
|
+
});
|
|
190
|
+
break; // Only one finding per line
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
// Aggregate info-level log findings if there are many
|
|
195
|
+
if (logFindings.length >= 3) {
|
|
196
|
+
const lineNumbers = logFindings.map(f => f.lineNumber).slice(0, 5);
|
|
197
|
+
const moreText = logFindings.length > 5 ? `... (${logFindings.length} total)` : '';
|
|
198
|
+
// Group by pattern name
|
|
199
|
+
const patternCounts = new Map();
|
|
200
|
+
for (const finding of logFindings) {
|
|
201
|
+
patternCounts.set(finding.name, (patternCounts.get(finding.name) || 0) + 1);
|
|
202
|
+
}
|
|
203
|
+
const patternSummary = Array.from(patternCounts.entries())
|
|
204
|
+
.map(([name, count]) => `${count}x ${name}`)
|
|
205
|
+
.join(', ');
|
|
206
|
+
vulnerabilities.push({
|
|
207
|
+
id: `data-exposure-aggregated-${filePath}`,
|
|
208
|
+
filePath,
|
|
209
|
+
lineNumber: logFindings[0].lineNumber,
|
|
210
|
+
lineContent: `${logFindings.length} instances across this file`,
|
|
211
|
+
severity: 'info',
|
|
212
|
+
category: 'data_exposure',
|
|
213
|
+
title: `Logging patterns (${logFindings.length} instances)`,
|
|
214
|
+
description: `${patternSummary}. Review for sensitive data exposure.\n\nFound ${logFindings.length} occurrences at lines: ${lineNumbers.join(', ')}${moreText}`,
|
|
215
|
+
suggestedFix: 'Ensure logs have appropriate access controls and do not contain sensitive user data.',
|
|
216
|
+
confidence: 'low',
|
|
217
|
+
baseConfidence: BASE_CONFIDENCE,
|
|
218
|
+
layer: 2,
|
|
219
|
+
source: 'structural',
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
else if (logFindings.length > 0) {
|
|
223
|
+
// Report individually for small counts
|
|
224
|
+
for (const finding of logFindings) {
|
|
225
|
+
const pattern = DATA_EXPOSURE_PATTERNS.find(p => p.name === finding.name);
|
|
226
|
+
if (pattern) {
|
|
227
|
+
vulnerabilities.push({
|
|
228
|
+
id: `data-exposure-${filePath}-${finding.lineNumber}-${finding.name}`,
|
|
229
|
+
filePath,
|
|
230
|
+
lineNumber: finding.lineNumber,
|
|
231
|
+
lineContent: finding.lineContent,
|
|
232
|
+
severity: 'info',
|
|
233
|
+
category: 'data_exposure',
|
|
234
|
+
title: pattern.name,
|
|
235
|
+
description: pattern.description,
|
|
236
|
+
suggestedFix: pattern.suggestedFix,
|
|
237
|
+
confidence: 'low',
|
|
238
|
+
baseConfidence: BASE_CONFIDENCE,
|
|
239
|
+
layer: 2,
|
|
240
|
+
source: 'structural',
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return vulnerabilities;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Check if error handling follows safe patterns
|
|
249
|
+
* Returns true if the error handling appears safe
|
|
250
|
+
*/
|
|
251
|
+
function isSafeErrorHandling(lineContent, surroundingLines) {
|
|
252
|
+
// Safe patterns: only returning error.message, using generic messages
|
|
253
|
+
const safePatterns = [
|
|
254
|
+
/error:\s*['"`].*['"`]/, // Generic string message
|
|
255
|
+
/error:\s*error\.message/, // Only message property
|
|
256
|
+
/error:\s*err\.message/,
|
|
257
|
+
/message:\s*(error|err)\.message/,
|
|
258
|
+
/status\(\d+\)\.json\(\s*\{\s*error:/, // Status code + error object (common pattern)
|
|
259
|
+
];
|
|
260
|
+
return safePatterns.some(p => p.test(lineContent));
|
|
261
|
+
}
|
|
262
|
+
//# sourceMappingURL=data-exposure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-exposure.js","sourceRoot":"","sources":["../../../src/detect/structural/data-ex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F,sEAAsE;IACtE,MAAM,YAAY,GAAG;QACnB,uBAAuB,EAAG,yBAAyB;QACnD,yBAAyB,EAAG,wBAAwB;QACpD,uBAAuB;QACvB,iCAAiC;QACjC,qCAAqC,EAAG,8CAA8C;KACvF,CAAA;IAED,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAA;AACpD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layer 2: Framework-Specific Security Checks
|
|
3
|
+
* Detects security issues specific to popular frameworks (Next.js, Express, React, etc.)
|
|
4
|
+
*/
|
|
5
|
+
import type { Vulnerability } from '../../shared/types';
|
|
6
|
+
import type { ParsedFile } from '../../shared/parsed-file';
|
|
7
|
+
export declare function detectFrameworkIssues(content: string, filePath: string, options?: {
|
|
8
|
+
parsed?: ParsedFile;
|
|
9
|
+
}): Vulnerability[];
|
|
10
|
+
//# sourceMappingURL=framework-checks.d.ts.map
|