@oculum/scanner 1.0.11 → 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/ai-context/index.d.ts +6 -0
- package/dist/ai-context/index.d.ts.map +1 -0
- package/dist/ai-context/index.js +13 -0
- package/dist/ai-context/index.js.map +1 -0
- package/dist/ai-context/manager.d.ts +67 -0
- package/dist/ai-context/manager.d.ts.map +1 -0
- package/dist/ai-context/manager.js +104 -0
- package/dist/ai-context/manager.js.map +1 -0
- package/dist/category-filter.d.ts +125 -0
- package/dist/category-filter.d.ts.map +1 -0
- package/dist/category-filter.js +360 -0
- package/dist/category-filter.js.map +1 -0
- 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/filtering/context-adjustments.d.ts +23 -0
- package/dist/filtering/context-adjustments.d.ts.map +1 -0
- package/dist/filtering/context-adjustments.js +100 -0
- package/dist/filtering/context-adjustments.js.map +1 -0
- package/dist/filtering/index.d.ts +3 -0
- package/dist/filtering/index.d.ts.map +1 -0
- package/dist/filtering/index.js +8 -0
- package/dist/filtering/index.js.map +1 -0
- package/dist/filtering/pipeline.d.ts +48 -0
- package/dist/filtering/pipeline.d.ts.map +1 -0
- package/dist/filtering/pipeline.js +76 -0
- package/dist/filtering/pipeline.js.map +1 -0
- package/dist/formatters/ai-context.d.ts +23 -0
- package/dist/formatters/ai-context.d.ts.map +1 -0
- package/dist/formatters/ai-context.js +238 -0
- package/dist/formatters/ai-context.js.map +1 -0
- package/dist/formatters/github-comment.d.ts +1 -1
- package/dist/formatters/github-comment.d.ts.map +1 -1
- package/dist/formatters/github-comment.js +2 -2
- package/dist/formatters/github-comment.js.map +1 -1
- package/dist/formatters/ide/claude-code.d.ts +17 -0
- package/dist/formatters/ide/claude-code.d.ts.map +1 -0
- package/dist/formatters/ide/claude-code.js +94 -0
- package/dist/formatters/ide/claude-code.js.map +1 -0
- package/dist/formatters/ide/cursor.d.ts +13 -0
- package/dist/formatters/ide/cursor.d.ts.map +1 -0
- package/dist/formatters/ide/cursor.js +125 -0
- package/dist/formatters/ide/cursor.js.map +1 -0
- package/dist/formatters/ide/index.d.ts +62 -0
- package/dist/formatters/ide/index.d.ts.map +1 -0
- package/dist/formatters/ide/index.js +184 -0
- package/dist/formatters/ide/index.js.map +1 -0
- package/dist/formatters/ide/windsurf.d.ts +13 -0
- package/dist/formatters/ide/windsurf.d.ts.map +1 -0
- package/dist/formatters/ide/windsurf.js +117 -0
- package/dist/formatters/ide/windsurf.js.map +1 -0
- package/dist/formatters/index.d.ts +2 -0
- package/dist/formatters/index.d.ts.map +1 -1
- package/dist/formatters/index.js +17 -1
- package/dist/formatters/index.js.map +1 -1
- package/dist/index.d.ts +17 -60
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +67 -824
- package/dist/index.js.map +1 -1
- package/dist/layer1/comments.d.ts +4 -1
- package/dist/layer1/comments.d.ts.map +1 -1
- package/dist/layer1/comments.js +1 -1
- package/dist/layer1/comments.js.map +1 -1
- package/dist/layer1/config-audit.d.ts +4 -1
- package/dist/layer1/config-audit.d.ts.map +1 -1
- package/dist/layer1/config-audit.js +45 -11
- package/dist/layer1/config-audit.js.map +1 -1
- package/dist/layer1/config-mcp-audit.d.ts +4 -1
- package/dist/layer1/config-mcp-audit.d.ts.map +1 -1
- package/dist/layer1/config-mcp-audit.js +2 -2
- package/dist/layer1/config-mcp-audit.js.map +1 -1
- package/dist/layer1/entropy.d.ts +4 -1
- package/dist/layer1/entropy.d.ts.map +1 -1
- package/dist/layer1/entropy.js +212 -1
- package/dist/layer1/entropy.js.map +1 -1
- package/dist/layer1/file-flags.d.ts +4 -1
- package/dist/layer1/file-flags.d.ts.map +1 -1
- package/dist/layer1/file-flags.js +12 -5
- package/dist/layer1/file-flags.js.map +1 -1
- package/dist/layer1/index.d.ts.map +1 -1
- package/dist/layer1/index.js +14 -19
- package/dist/layer1/index.js.map +1 -1
- package/dist/layer1/patterns.d.ts +4 -1
- package/dist/layer1/patterns.d.ts.map +1 -1
- package/dist/layer1/patterns.js +34 -4
- package/dist/layer1/patterns.js.map +1 -1
- package/dist/layer1/urls.d.ts +4 -1
- package/dist/layer1/urls.d.ts.map +1 -1
- package/dist/layer1/urls.js +162 -14
- package/dist/layer1/urls.js.map +1 -1
- package/dist/layer1/weak-crypto.d.ts +4 -1
- package/dist/layer1/weak-crypto.d.ts.map +1 -1
- package/dist/layer1/weak-crypto.js +144 -7
- package/dist/layer1/weak-crypto.js.map +1 -1
- package/dist/layer2/ai-agent-tools.d.ts +4 -1
- package/dist/layer2/ai-agent-tools.d.ts.map +1 -1
- package/dist/layer2/ai-agent-tools.js +661 -2
- package/dist/layer2/ai-agent-tools.js.map +1 -1
- package/dist/layer2/ai-endpoint-protection.d.ts +2 -0
- package/dist/layer2/ai-endpoint-protection.d.ts.map +1 -1
- package/dist/layer2/ai-endpoint-protection.js +1 -1
- package/dist/layer2/ai-endpoint-protection.js.map +1 -1
- package/dist/layer2/ai-execution-sinks.d.ts +4 -1
- package/dist/layer2/ai-execution-sinks.d.ts.map +1 -1
- package/dist/layer2/ai-execution-sinks.js +252 -43
- package/dist/layer2/ai-execution-sinks.js.map +1 -1
- package/dist/layer2/ai-fingerprinting.d.ts +4 -1
- package/dist/layer2/ai-fingerprinting.d.ts.map +1 -1
- package/dist/layer2/ai-fingerprinting.js +25 -32
- package/dist/layer2/ai-fingerprinting.js.map +1 -1
- package/dist/layer2/ai-mcp-security.d.ts +4 -1
- package/dist/layer2/ai-mcp-security.d.ts.map +1 -1
- package/dist/layer2/ai-mcp-security.js +200 -2
- package/dist/layer2/ai-mcp-security.js.map +1 -1
- package/dist/layer2/ai-package-hallucination.d.ts +4 -1
- package/dist/layer2/ai-package-hallucination.d.ts.map +1 -1
- package/dist/layer2/ai-package-hallucination.js +136 -4
- package/dist/layer2/ai-package-hallucination.js.map +1 -1
- package/dist/layer2/ai-prompt-hygiene.d.ts +4 -1
- package/dist/layer2/ai-prompt-hygiene.d.ts.map +1 -1
- package/dist/layer2/ai-prompt-hygiene.js +342 -28
- package/dist/layer2/ai-prompt-hygiene.js.map +1 -1
- package/dist/layer2/ai-rag-safety.d.ts +4 -1
- package/dist/layer2/ai-rag-safety.d.ts.map +1 -1
- package/dist/layer2/ai-rag-safety.js +82 -2
- package/dist/layer2/ai-rag-safety.js.map +1 -1
- package/dist/layer2/ai-schema-validation.d.ts +4 -1
- package/dist/layer2/ai-schema-validation.d.ts.map +1 -1
- package/dist/layer2/ai-schema-validation.js +2 -2
- package/dist/layer2/ai-schema-validation.js.map +1 -1
- package/dist/layer2/auth-antipatterns.d.ts +2 -0
- package/dist/layer2/auth-antipatterns.d.ts.map +1 -1
- package/dist/layer2/auth-antipatterns.js +205 -20
- package/dist/layer2/auth-antipatterns.js.map +1 -1
- package/dist/layer2/byok-patterns.d.ts +4 -1
- package/dist/layer2/byok-patterns.d.ts.map +1 -1
- package/dist/layer2/byok-patterns.js +2 -2
- package/dist/layer2/byok-patterns.js.map +1 -1
- package/dist/layer2/dangerous-functions/dom-xss.d.ts +9 -4
- package/dist/layer2/dangerous-functions/dom-xss.d.ts.map +1 -1
- package/dist/layer2/dangerous-functions/dom-xss.js +73 -22
- package/dist/layer2/dangerous-functions/dom-xss.js.map +1 -1
- package/dist/layer2/dangerous-functions/index.d.ts +4 -1
- package/dist/layer2/dangerous-functions/index.d.ts.map +1 -1
- package/dist/layer2/dangerous-functions/index.js +551 -20
- package/dist/layer2/dangerous-functions/index.js.map +1 -1
- package/dist/layer2/dangerous-functions/math-random.d.ts +54 -4
- package/dist/layer2/dangerous-functions/math-random.d.ts.map +1 -1
- package/dist/layer2/dangerous-functions/math-random.js +241 -16
- package/dist/layer2/dangerous-functions/math-random.js.map +1 -1
- package/dist/layer2/dangerous-functions/patterns.d.ts.map +1 -1
- package/dist/layer2/dangerous-functions/patterns.js +3 -1
- package/dist/layer2/dangerous-functions/patterns.js.map +1 -1
- package/dist/layer2/dangerous-functions/utils/control-flow.d.ts +3 -2
- package/dist/layer2/dangerous-functions/utils/control-flow.d.ts.map +1 -1
- package/dist/layer2/dangerous-functions/utils/control-flow.js +41 -120
- package/dist/layer2/dangerous-functions/utils/control-flow.js.map +1 -1
- package/dist/layer2/dangerous-functions/utils/helpers.d.ts.map +1 -1
- package/dist/layer2/dangerous-functions/utils/helpers.js +26 -3
- package/dist/layer2/dangerous-functions/utils/helpers.js.map +1 -1
- package/dist/layer2/dangerous-functions/utils/schema-validation.d.ts.map +1 -1
- package/dist/layer2/dangerous-functions/utils/schema-validation.js +14 -1
- package/dist/layer2/dangerous-functions/utils/schema-validation.js.map +1 -1
- package/dist/layer2/data-exposure.d.ts +4 -1
- package/dist/layer2/data-exposure.d.ts.map +1 -1
- package/dist/layer2/data-exposure.js +11 -38
- package/dist/layer2/data-exposure.js.map +1 -1
- package/dist/layer2/framework-checks.d.ts +4 -1
- package/dist/layer2/framework-checks.d.ts.map +1 -1
- package/dist/layer2/framework-checks.js +3 -10
- package/dist/layer2/framework-checks.js.map +1 -1
- package/dist/layer2/index.d.ts +13 -1
- package/dist/layer2/index.d.ts.map +1 -1
- package/dist/layer2/index.js +107 -52
- 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/logic-gates.d.ts +4 -1
- package/dist/layer2/logic-gates.d.ts.map +1 -1
- package/dist/layer2/logic-gates.js +54 -20
- package/dist/layer2/logic-gates.js.map +1 -1
- package/dist/layer2/model-supply-chain.d.ts +4 -1
- package/dist/layer2/model-supply-chain.d.ts.map +1 -1
- package/dist/layer2/model-supply-chain.js +72 -4
- package/dist/layer2/model-supply-chain.js.map +1 -1
- package/dist/layer2/risky-imports.d.ts +4 -1
- package/dist/layer2/risky-imports.d.ts.map +1 -1
- package/dist/layer2/risky-imports.js +2 -2
- package/dist/layer2/risky-imports.js.map +1 -1
- 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/variables.d.ts +4 -1
- package/dist/layer2/variables.d.ts.map +1 -1
- package/dist/layer2/variables.js +2 -2
- package/dist/layer2/variables.js.map +1 -1
- 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/auto-dismiss.d.ts.map +1 -1
- package/dist/layer3/anthropic/auto-dismiss.js +11 -0
- package/dist/layer3/anthropic/auto-dismiss.js.map +1 -1
- 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/modes/incremental.js +1 -1
- 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 +4 -4
- package/dist/tiers.d.ts.map +1 -1
- package/dist/tiers.js +17 -7
- package/dist/tiers.js.map +1 -1
- package/dist/types.d.ts +79 -9
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +34 -0
- package/dist/types.js.map +1 -1
- package/dist/utils/code-analysis.d.ts +39 -0
- package/dist/utils/code-analysis.d.ts.map +1 -0
- package/dist/utils/code-analysis.js +159 -0
- package/dist/utils/code-analysis.js.map +1 -0
- package/dist/utils/comment-analyzer.d.ts +38 -0
- package/dist/utils/comment-analyzer.d.ts.map +1 -0
- package/dist/utils/comment-analyzer.js +218 -0
- package/dist/utils/comment-analyzer.js.map +1 -0
- package/dist/utils/context-helpers.d.ts +108 -1
- package/dist/utils/context-helpers.d.ts.map +1 -1
- package/dist/utils/context-helpers.js +351 -2
- package/dist/utils/context-helpers.js.map +1 -1
- package/dist/utils/environment-context.d.ts +76 -0
- package/dist/utils/environment-context.d.ts.map +1 -0
- package/dist/utils/environment-context.js +271 -0
- package/dist/utils/environment-context.js.map +1 -0
- package/dist/utils/intent-detector.d.ts +66 -0
- package/dist/utils/intent-detector.d.ts.map +1 -0
- package/dist/utils/intent-detector.js +282 -0
- package/dist/utils/intent-detector.js.map +1 -0
- package/dist/utils/parsed-file.d.ts +51 -0
- package/dist/utils/parsed-file.d.ts.map +1 -0
- package/dist/utils/parsed-file.js +95 -0
- package/dist/utils/parsed-file.js.map +1 -0
- package/dist/utils/route-hierarchy.d.ts +50 -0
- package/dist/utils/route-hierarchy.d.ts.map +1 -0
- package/dist/utils/route-hierarchy.js +226 -0
- package/dist/utils/route-hierarchy.js.map +1 -0
- package/dist/utils/schema-semantics.d.ts +45 -0
- package/dist/utils/schema-semantics.d.ts.map +1 -0
- package/dist/utils/schema-semantics.js +193 -0
- package/dist/utils/schema-semantics.js.map +1 -0
- 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 +27 -0
- package/src/__tests__/benchmark/fixtures/layer2/log-injection.ts +147 -0
- package/src/__tests__/benchmark/fixtures/layer2/phase5-excessive-agency.ts +580 -0
- package/src/__tests__/benchmark/fixtures/layer2/security-headers.ts +197 -0
- package/src/__tests__/benchmark/fixtures/layer2/sprint6-ai-enhancements.ts +515 -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 +12 -12
- 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 +478 -0
- 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 +801 -3
- 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 +50 -58
- package/src/__tests__/snapshots/__snapshots__/dangerous-functions-refactor.test.ts.snap +52 -0
- package/src/__tests__/snapshots/__snapshots__/scan-depth.test.ts.snap +3 -12
- package/src/__tests__/snapshots/anthropic-validation-refactor.test.ts +3 -3
- 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/__tests__/validation/run-validation.ts +7 -7
- package/src/{layer2/ai-agent-tools.ts → detect/ai-code/agent-tools.ts} +729 -4
- package/src/{layer2 → detect/ai-code}/byok-patterns.ts +20 -6
- package/src/{layer2/ai-endpoint-protection.ts → detect/ai-code/endpoint-protection.ts} +10 -4
- package/src/{layer2/ai-execution-sinks.ts → detect/ai-code/execution-sinks.ts} +272 -46
- package/src/{layer2/ai-fingerprinting.ts → detect/ai-code/fingerprinting.ts} +46 -34
- package/src/detect/ai-code/index.ts +11 -0
- package/src/{layer2/ai-mcp-security.ts → detect/ai-code/mcp-security.ts} +212 -5
- package/src/{layer2 → detect/ai-code}/model-supply-chain.ts +85 -6
- package/src/{layer2/ai-package-hallucination.ts → detect/ai-code/package-hallucination.ts} +170 -6
- package/src/{layer2/ai-prompt-hygiene.ts → detect/ai-code/prompt-hygiene.ts} +393 -28
- package/src/{layer2/ai-rag-safety.ts → detect/ai-code/rag-safety.ts} +91 -4
- package/src/{layer2/ai-schema-validation.ts → detect/ai-code/schema-validation.ts} +10 -4
- package/src/detect/config/agent-skill-injection.ts +551 -0
- package/src/{layer1 → detect/config}/comments.ts +8 -2
- package/src/{layer1 → detect/config}/file-flags.ts +23 -6
- 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 +196 -15
- package/src/detect/index.ts +131 -0
- package/src/{layer1 → detect/secrets}/config-audit.ts +56 -12
- package/src/{layer1 → detect/secrets}/config-mcp-audit.ts +11 -4
- package/src/{layer1 → detect/secrets}/entropy.ts +256 -11
- package/src/{layer1 → detect/secrets}/index.ts +43 -46
- package/src/{layer1 → detect/secrets}/patterns.ts +51 -6
- package/src/{layer1 → detect/secrets}/weak-crypto.ts +174 -17
- package/src/{layer2/auth-antipatterns.ts → detect/structural/auth-patterns.ts} +249 -27
- package/src/{layer2 → detect/structural}/dangerous-functions/dom-xss.ts +94 -22
- package/src/{layer2 → detect/structural}/dangerous-functions/index.ts +672 -65
- package/src/{layer2 → detect/structural}/dangerous-functions/json-parse.ts +10 -2
- package/src/{layer2 → detect/structural}/dangerous-functions/math-random.ts +269 -17
- package/src/{layer2 → detect/structural}/dangerous-functions/patterns.ts +4 -2
- package/src/{layer2 → detect/structural}/dangerous-functions/request-validation.ts +10 -2
- package/src/detect/structural/dangerous-functions/utils/control-flow.ts +35 -0
- package/src/{layer2 → detect/structural}/dangerous-functions/utils/schema-validation.ts +16 -1
- package/src/{layer2 → detect/structural}/data-exposure.ts +23 -40
- package/src/{layer2 → detect/structural}/framework-checks.ts +13 -12
- package/src/{layer2 → detect/structural}/index.ts +144 -122
- package/src/detect/structural/log-injection.ts +254 -0
- package/src/{layer2 → detect/structural}/logic-gates.ts +69 -24
- package/src/{layer2 → detect/structural}/risky-imports.ts +10 -4
- 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 +10 -4
- package/src/detect/structural/xxe-detection.ts +295 -0
- package/src/index.ts +64 -1038
- 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/route-hierarchy.ts +250 -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} +462 -2
- 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 +6 -6
- package/src/postprocess/aggregation.ts +74 -0
- package/src/postprocess/contradictions.ts +128 -0
- package/src/postprocess/dedup.ts +62 -0
- package/src/postprocess/filtering/__tests__/pipeline.test.ts +134 -0
- package/src/postprocess/filtering/context-adjustments.ts +111 -0
- package/src/postprocess/filtering/index.ts +10 -0
- package/src/postprocess/filtering/pipeline.ts +130 -0
- 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/report/formatters/__tests__/ai-context.test.ts +254 -0
- package/src/report/formatters/ai-context.ts +302 -0
- package/src/{formatters → report/formatters}/cli-terminal.ts +11 -11
- package/src/{formatters → report/formatters}/github-comment.ts +4 -4
- package/src/{formatters → report/formatters}/grouping.ts +8 -8
- package/src/report/formatters/ide/__tests__/ide.test.ts +319 -0
- package/src/report/formatters/ide/claude-code.ts +110 -0
- package/src/report/formatters/ide/cursor.ts +147 -0
- package/src/report/formatters/ide/index.ts +216 -0
- package/src/report/formatters/ide/windsurf.ts +135 -0
- package/src/{formatters → report/formatters}/index.ts +24 -0
- 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 +26 -14
- package/src/score/confidence.ts +66 -0
- package/src/score/index.ts +316 -0
- package/src/score/types.ts +187 -0
- package/src/shared/__tests__/code-analysis.test.ts +165 -0
- package/src/shared/__tests__/parsed-file.test.ts +124 -0
- package/src/shared/ai-context/__tests__/manager.test.ts +193 -0
- package/src/shared/ai-context/index.ts +15 -0
- package/src/shared/ai-context/manager.ts +145 -0
- package/src/{baseline → shared/baseline}/__tests__/diff.test.ts +2 -2
- package/src/{baseline → shared/baseline}/__tests__/manager.test.ts +2 -2
- package/src/{baseline → shared/baseline}/diff.ts +1 -1
- package/src/{baseline → shared/baseline}/manager.ts +1 -1
- package/src/shared/category-filter.ts +400 -0
- package/src/{layer2/dangerous-functions/utils/control-flow.ts → shared/code-analysis.ts} +56 -39
- package/src/shared/comment-analyzer.ts +249 -0
- package/src/shared/environment-context.ts +304 -0
- package/src/shared/intent-detector.ts +318 -0
- package/src/shared/parsed-file.ts +103 -0
- 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/shared/schema-semantics.ts +233 -0
- package/src/{types.ts → shared/types.ts} +142 -11
- package/src/tiers.ts +27 -10
- 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/{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/{baseline → shared/baseline}/index.ts +0 -0
- /package/src/{baseline → shared/baseline}/types.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}/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/{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
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
exports[`Refactor Safety - dangerous-functions.ts Deserialization detection should detect pickle.loads (Python) 1`] = `
|
|
4
4
|
Array [
|
|
5
5
|
Object {
|
|
6
|
+
"baseConfidence": 0.4,
|
|
6
7
|
"category": "dangerous_function",
|
|
7
8
|
"confidence": "high",
|
|
8
9
|
"description": "Unsafe deserialization can lead to remote code execution",
|
|
@@ -12,6 +13,7 @@ Array [
|
|
|
12
13
|
"lineContent": "data = pickle.loads(user_data)",
|
|
13
14
|
"lineNumber": 2,
|
|
14
15
|
"severity": "critical",
|
|
16
|
+
"source": "structural",
|
|
15
17
|
"suggestedFix": "Use safe loaders (yaml.safe_load) or validate input before deserializing",
|
|
16
18
|
"title": "Unsafe deserialization",
|
|
17
19
|
},
|
|
@@ -23,6 +25,7 @@ exports[`Refactor Safety - dangerous-functions.ts Deserialization detection shou
|
|
|
23
25
|
exports[`Refactor Safety - dangerous-functions.ts File path detection should detect dynamic file path in API handlers 1`] = `
|
|
24
26
|
Array [
|
|
25
27
|
Object {
|
|
28
|
+
"baseConfidence": 0.4,
|
|
26
29
|
"category": "dangerous_function",
|
|
27
30
|
"confidence": "high",
|
|
28
31
|
"description": "Dynamic file paths can lead to path traversal attacks",
|
|
@@ -32,6 +35,7 @@ Array [
|
|
|
32
35
|
"lineContent": "const file = fs.readFileSync(req.params.filename);",
|
|
33
36
|
"lineNumber": 2,
|
|
34
37
|
"severity": "medium",
|
|
38
|
+
"source": "structural",
|
|
35
39
|
"suggestedFix": "Validate and sanitize file paths, use path.resolve with a base directory",
|
|
36
40
|
"title": "Dynamic file path",
|
|
37
41
|
},
|
|
@@ -41,6 +45,7 @@ Array [
|
|
|
41
45
|
exports[`Refactor Safety - dangerous-functions.ts File path detection should detect path traversal risk 1`] = `
|
|
42
46
|
Array [
|
|
43
47
|
Object {
|
|
48
|
+
"baseConfidence": 0.4,
|
|
44
49
|
"category": "dangerous_function",
|
|
45
50
|
"confidence": "high",
|
|
46
51
|
"description": "User input in file paths can lead to path traversal attacks",
|
|
@@ -50,6 +55,7 @@ Array [
|
|
|
50
55
|
"lineContent": "const fullPath = path.join(uploadDir, req.query.path);",
|
|
51
56
|
"lineNumber": 2,
|
|
52
57
|
"severity": "high",
|
|
58
|
+
"source": "structural",
|
|
53
59
|
"suggestedFix": "Validate paths and ensure they stay within allowed directories",
|
|
54
60
|
"title": "Path traversal risk",
|
|
55
61
|
},
|
|
@@ -59,6 +65,7 @@ Array [
|
|
|
59
65
|
exports[`Refactor Safety - dangerous-functions.ts File path detection should detect path traversal with sanitization as lower severity 1`] = `
|
|
60
66
|
Array [
|
|
61
67
|
Object {
|
|
68
|
+
"baseConfidence": 0.4,
|
|
62
69
|
"category": "dangerous_function",
|
|
63
70
|
"confidence": "low",
|
|
64
71
|
"description": "Dynamic file path with path traversal protection detected. Verify the protection is complete and covers all attack vectors.",
|
|
@@ -68,6 +75,7 @@ Array [
|
|
|
68
75
|
"lineContent": "fs.readFileSync(fullPath);",
|
|
69
76
|
"lineNumber": 5,
|
|
70
77
|
"severity": "info",
|
|
78
|
+
"source": "structural",
|
|
71
79
|
"suggestedFix": "Ensure path normalization and base directory checks are applied consistently.",
|
|
72
80
|
"title": "Dynamic file path (protected)",
|
|
73
81
|
},
|
|
@@ -77,6 +85,7 @@ Array [
|
|
|
77
85
|
exports[`Refactor Safety - dangerous-functions.ts File path detection should skip dynamic paths in CLI tools 1`] = `
|
|
78
86
|
Array [
|
|
79
87
|
Object {
|
|
88
|
+
"baseConfidence": 0.4,
|
|
80
89
|
"category": "dangerous_function",
|
|
81
90
|
"confidence": "low",
|
|
82
91
|
"description": "Dynamic file path in CLI tool. CLI tools typically have trusted operators, but consider adding path validation if user input is involved.",
|
|
@@ -86,6 +95,7 @@ Array [
|
|
|
86
95
|
"lineContent": "const content = fs.readFileSync(filePath);",
|
|
87
96
|
"lineNumber": 2,
|
|
88
97
|
"severity": "info",
|
|
98
|
+
"source": "structural",
|
|
89
99
|
"suggestedFix": "Add path validation if accepting paths from untrusted sources.",
|
|
90
100
|
"title": "Dynamic file path (CLI tool)",
|
|
91
101
|
},
|
|
@@ -109,6 +119,7 @@ exports[`Refactor Safety - dangerous-functions.ts LLM prompt context detection s
|
|
|
109
119
|
exports[`Refactor Safety - dangerous-functions.ts Math.random detection should classify Math.random for UI IDs as info 1`] = `
|
|
110
120
|
Array [
|
|
111
121
|
Object {
|
|
122
|
+
"baseConfidence": 0.4,
|
|
112
123
|
"category": "dangerous_function",
|
|
113
124
|
"confidence": "low",
|
|
114
125
|
"description": "Math.random() generating short UI identifier (7-char string). Acceptable for React keys, temp IDs.",
|
|
@@ -118,6 +129,7 @@ Array [
|
|
|
118
129
|
"lineContent": "const key = Math.random().toString(36).substring(2, 9);",
|
|
119
130
|
"lineNumber": 2,
|
|
120
131
|
"severity": "info",
|
|
132
|
+
"source": "structural",
|
|
121
133
|
"suggestedFix": "For security tokens, use crypto.randomBytes(). For unique IDs, crypto.randomUUID().",
|
|
122
134
|
"title": "Math.random() in UI identifier generation (7-char string)",
|
|
123
135
|
},
|
|
@@ -127,6 +139,7 @@ Array [
|
|
|
127
139
|
exports[`Refactor Safety - dangerous-functions.ts Math.random detection should classify business IDs as low severity 1`] = `
|
|
128
140
|
Array [
|
|
129
141
|
Object {
|
|
142
|
+
"baseConfidence": 0.4,
|
|
130
143
|
"category": "dangerous_function",
|
|
131
144
|
"confidence": "low",
|
|
132
145
|
"description": "Math.random() generating business identifier (variable: orderId). Verify this is not used for security purposes.",
|
|
@@ -136,6 +149,7 @@ Array [
|
|
|
136
149
|
"lineContent": "const orderId = 'ORD-' + Math.random().toString(36).substring(2, 12);",
|
|
137
150
|
"lineNumber": 2,
|
|
138
151
|
"severity": "low",
|
|
152
|
+
"source": "structural",
|
|
139
153
|
"suggestedFix": "For business IDs, crypto.randomUUID() is preferred. For security tokens, use crypto.randomBytes().",
|
|
140
154
|
"title": "Math.random() in non-security usage (variable: orderId)",
|
|
141
155
|
},
|
|
@@ -145,6 +159,7 @@ Array [
|
|
|
145
159
|
exports[`Refactor Safety - dangerous-functions.ts Math.random detection should detect Math.random for security tokens as high 1`] = `
|
|
146
160
|
Array [
|
|
147
161
|
Object {
|
|
162
|
+
"baseConfidence": 0.4,
|
|
148
163
|
"category": "dangerous_function",
|
|
149
164
|
"confidence": "high",
|
|
150
165
|
"description": "Math.random() is being used in a security-sensitive context. This is NOT cryptographically secure and should be replaced.",
|
|
@@ -154,6 +169,7 @@ Array [
|
|
|
154
169
|
"lineContent": "return Math.random().toString(36);",
|
|
155
170
|
"lineNumber": 3,
|
|
156
171
|
"severity": "high",
|
|
172
|
+
"source": "structural",
|
|
157
173
|
"suggestedFix": "Use crypto.randomBytes() for Node.js or crypto.getRandomValues() for browsers.",
|
|
158
174
|
"title": "Math.random() in security-sensitive function",
|
|
159
175
|
},
|
|
@@ -163,6 +179,7 @@ Array [
|
|
|
163
179
|
exports[`Refactor Safety - dangerous-functions.ts Math.random detection should detect Math.random in security context as high 1`] = `
|
|
164
180
|
Array [
|
|
165
181
|
Object {
|
|
182
|
+
"baseConfidence": 0.4,
|
|
166
183
|
"category": "dangerous_function",
|
|
167
184
|
"confidence": "high",
|
|
168
185
|
"description": "Math.random() assigned to security-sensitive variable 'secret'. Math.random() is NOT cryptographically secure.",
|
|
@@ -172,6 +189,7 @@ Array [
|
|
|
172
189
|
"lineContent": "const secret = Math.random().toString(36).substring(2);",
|
|
173
190
|
"lineNumber": 2,
|
|
174
191
|
"severity": "high",
|
|
192
|
+
"source": "structural",
|
|
175
193
|
"suggestedFix": "Use crypto.randomBytes() or crypto.getRandomValues() for security-sensitive values.",
|
|
176
194
|
"title": "Math.random() in security-sensitive variable",
|
|
177
195
|
},
|
|
@@ -185,6 +203,7 @@ exports[`Refactor Safety - dangerous-functions.ts Math.random detection should s
|
|
|
185
203
|
exports[`Refactor Safety - dangerous-functions.ts Prototype pollution detection should detect Object.assign with user input 1`] = `
|
|
186
204
|
Array [
|
|
187
205
|
Object {
|
|
206
|
+
"baseConfidence": 0.4,
|
|
188
207
|
"category": "dangerous_function",
|
|
189
208
|
"confidence": "high",
|
|
190
209
|
"description": "Object.assign with user input can lead to prototype pollution",
|
|
@@ -194,6 +213,7 @@ Array [
|
|
|
194
213
|
"lineContent": "const merged = Object.assign({}, req.body);",
|
|
195
214
|
"lineNumber": 2,
|
|
196
215
|
"severity": "high",
|
|
216
|
+
"source": "structural",
|
|
197
217
|
"suggestedFix": "Validate and sanitize input, or use a safe merge function",
|
|
198
218
|
"title": "Object.assign with user input",
|
|
199
219
|
},
|
|
@@ -203,6 +223,7 @@ Array [
|
|
|
203
223
|
exports[`Refactor Safety - dangerous-functions.ts Prototype pollution detection should detect spread operator with user input 1`] = `
|
|
204
224
|
Array [
|
|
205
225
|
Object {
|
|
226
|
+
"baseConfidence": 0.4,
|
|
206
227
|
"category": "dangerous_function",
|
|
207
228
|
"confidence": "high",
|
|
208
229
|
"description": "Spreading user input can lead to mass assignment vulnerabilities",
|
|
@@ -212,6 +233,7 @@ Array [
|
|
|
212
233
|
"lineContent": "const user = { ...req.body, createdAt: new Date() };",
|
|
213
234
|
"lineNumber": 2,
|
|
214
235
|
"severity": "medium",
|
|
236
|
+
"source": "structural",
|
|
215
237
|
"suggestedFix": "Explicitly pick allowed properties instead of spreading all input",
|
|
216
238
|
"title": "Spread operator with user input",
|
|
217
239
|
},
|
|
@@ -221,6 +243,7 @@ Array [
|
|
|
221
243
|
exports[`Refactor Safety - dangerous-functions.ts Regex DoS detection should detect dynamic regex construction 1`] = `
|
|
222
244
|
Array [
|
|
223
245
|
Object {
|
|
246
|
+
"baseConfidence": 0.4,
|
|
224
247
|
"category": "dangerous_function",
|
|
225
248
|
"confidence": "high",
|
|
226
249
|
"description": "Dynamic regex construction can lead to ReDoS attacks",
|
|
@@ -230,6 +253,7 @@ Array [
|
|
|
230
253
|
"lineContent": "const pattern = new RegExp(userPattern);",
|
|
231
254
|
"lineNumber": 2,
|
|
232
255
|
"severity": "medium",
|
|
256
|
+
"source": "structural",
|
|
233
257
|
"suggestedFix": "Validate regex patterns and consider using safe-regex library",
|
|
234
258
|
"title": "Potentially unsafe regex",
|
|
235
259
|
},
|
|
@@ -243,6 +267,7 @@ exports[`Refactor Safety - dangerous-functions.ts SQL injection detection should
|
|
|
243
267
|
exports[`Refactor Safety - dangerous-functions.ts SQL injection detection should detect raw SQL with template literal 1`] = `
|
|
244
268
|
Array [
|
|
245
269
|
Object {
|
|
270
|
+
"baseConfidence": 0.4,
|
|
246
271
|
"category": "dangerous_function",
|
|
247
272
|
"confidence": "high",
|
|
248
273
|
"description": "Template literals in SQL queries can lead to SQL injection",
|
|
@@ -252,6 +277,7 @@ Array [
|
|
|
252
277
|
"lineContent": "const query = \`SELECT * FROM users WHERE id = \${userId}\`;",
|
|
253
278
|
"lineNumber": 2,
|
|
254
279
|
"severity": "critical",
|
|
280
|
+
"source": "structural",
|
|
255
281
|
"suggestedFix": "Use parameterized queries with placeholders (?, $1, etc.)",
|
|
256
282
|
"title": "SQL template literal",
|
|
257
283
|
},
|
|
@@ -263,6 +289,7 @@ exports[`Refactor Safety - dangerous-functions.ts Static bootstrap script detect
|
|
|
263
289
|
exports[`Refactor Safety - dangerous-functions.ts Test file handling should downgrade severity in test files 1`] = `
|
|
264
290
|
Array [
|
|
265
291
|
Object {
|
|
292
|
+
"baseConfidence": 0.4,
|
|
266
293
|
"category": "dangerous_function",
|
|
267
294
|
"confidence": "low",
|
|
268
295
|
"description": "Direct innerHTML assignment can lead to XSS vulnerabilities This appears to use dynamic content which increases XSS risk. (in test file)",
|
|
@@ -273,6 +300,7 @@ Array [
|
|
|
273
300
|
"lineNumber": 3,
|
|
274
301
|
"requiresAIValidation": true,
|
|
275
302
|
"severity": "low",
|
|
303
|
+
"source": "structural",
|
|
276
304
|
"suggestedFix": "Use textContent for text, or sanitize HTML with DOMPurify",
|
|
277
305
|
"title": "innerHTML assignment",
|
|
278
306
|
},
|
|
@@ -286,6 +314,7 @@ exports[`Refactor Safety - dangerous-functions.ts child_process detection should
|
|
|
286
314
|
exports[`Refactor Safety - dangerous-functions.ts child_process detection should detect exec with user input 1`] = `
|
|
287
315
|
Array [
|
|
288
316
|
Object {
|
|
317
|
+
"baseConfidence": 0.4,
|
|
289
318
|
"category": "dangerous_function",
|
|
290
319
|
"confidence": "high",
|
|
291
320
|
"description": "Shell command execution can lead to command injection",
|
|
@@ -295,6 +324,7 @@ Array [
|
|
|
295
324
|
"lineContent": "exec(\`ls \${userInput}\`, callback);",
|
|
296
325
|
"lineNumber": 3,
|
|
297
326
|
"severity": "high",
|
|
327
|
+
"source": "structural",
|
|
298
328
|
"suggestedFix": "Validate and sanitize all inputs, prefer execFile over exec",
|
|
299
329
|
"title": "child_process exec",
|
|
300
330
|
},
|
|
@@ -306,6 +336,7 @@ exports[`Refactor Safety - dangerous-functions.ts child_process detection should
|
|
|
306
336
|
exports[`Refactor Safety - dangerous-functions.ts child_process detection should detect spawn with dynamic args 1`] = `
|
|
307
337
|
Array [
|
|
308
338
|
Object {
|
|
339
|
+
"baseConfidence": 0.4,
|
|
309
340
|
"category": "dangerous_function",
|
|
310
341
|
"confidence": "high",
|
|
311
342
|
"description": "Shell command execution can lead to command injection",
|
|
@@ -315,6 +346,7 @@ Array [
|
|
|
315
346
|
"lineContent": "spawn('node', [userInput]);",
|
|
316
347
|
"lineNumber": 3,
|
|
317
348
|
"severity": "high",
|
|
349
|
+
"source": "structural",
|
|
318
350
|
"suggestedFix": "Validate and sanitize all inputs, prefer execFile over exec",
|
|
319
351
|
"title": "child_process exec",
|
|
320
352
|
},
|
|
@@ -324,6 +356,7 @@ Array [
|
|
|
324
356
|
exports[`Refactor Safety - dangerous-functions.ts eval/Function detection should detect Function constructor 1`] = `
|
|
325
357
|
Array [
|
|
326
358
|
Object {
|
|
359
|
+
"baseConfidence": 0.4,
|
|
327
360
|
"category": "dangerous_function",
|
|
328
361
|
"confidence": "high",
|
|
329
362
|
"description": "Function constructor can execute arbitrary code like eval()",
|
|
@@ -334,10 +367,12 @@ Array [
|
|
|
334
367
|
"lineNumber": 2,
|
|
335
368
|
"requiresAIValidation": true,
|
|
336
369
|
"severity": "critical",
|
|
370
|
+
"source": "structural",
|
|
337
371
|
"suggestedFix": "Refactor to use static functions or safe alternatives",
|
|
338
372
|
"title": "Function constructor",
|
|
339
373
|
},
|
|
340
374
|
Object {
|
|
375
|
+
"baseConfidence": 0.4,
|
|
341
376
|
"category": "dangerous_function",
|
|
342
377
|
"confidence": "high",
|
|
343
378
|
"description": "Function constructor can execute arbitrary code like eval()",
|
|
@@ -348,6 +383,7 @@ Array [
|
|
|
348
383
|
"lineNumber": 3,
|
|
349
384
|
"requiresAIValidation": true,
|
|
350
385
|
"severity": "critical",
|
|
386
|
+
"source": "structural",
|
|
351
387
|
"suggestedFix": "Refactor to use static functions or safe alternatives",
|
|
352
388
|
"title": "Function constructor",
|
|
353
389
|
},
|
|
@@ -357,6 +393,7 @@ Array [
|
|
|
357
393
|
exports[`Refactor Safety - dangerous-functions.ts eval/Function detection should detect eval() usage 1`] = `
|
|
358
394
|
Array [
|
|
359
395
|
Object {
|
|
396
|
+
"baseConfidence": 0.4,
|
|
360
397
|
"category": "dangerous_function",
|
|
361
398
|
"confidence": "high",
|
|
362
399
|
"description": "eval() executes arbitrary code and is a major security risk",
|
|
@@ -367,6 +404,7 @@ Array [
|
|
|
367
404
|
"lineNumber": 2,
|
|
368
405
|
"requiresAIValidation": true,
|
|
369
406
|
"severity": "critical",
|
|
407
|
+
"source": "structural",
|
|
370
408
|
"suggestedFix": "Use JSON.parse() for JSON data, or refactor to avoid dynamic code execution",
|
|
371
409
|
"title": "eval() usage",
|
|
372
410
|
},
|
|
@@ -376,6 +414,7 @@ Array [
|
|
|
376
414
|
exports[`Refactor Safety - dangerous-functions.ts eval/Function detection should detect setTimeout/setInterval with string 1`] = `
|
|
377
415
|
Array [
|
|
378
416
|
Object {
|
|
417
|
+
"baseConfidence": 0.4,
|
|
379
418
|
"category": "dangerous_function",
|
|
380
419
|
"confidence": "high",
|
|
381
420
|
"description": "setTimeout/setInterval with string argument acts like eval()",
|
|
@@ -385,10 +424,12 @@ Array [
|
|
|
385
424
|
"lineContent": "setTimeout('alert(\\"hello\\")', 1000);",
|
|
386
425
|
"lineNumber": 2,
|
|
387
426
|
"severity": "high",
|
|
427
|
+
"source": "structural",
|
|
388
428
|
"suggestedFix": "Pass a function reference instead of a string",
|
|
389
429
|
"title": "setTimeout/setInterval with string",
|
|
390
430
|
},
|
|
391
431
|
Object {
|
|
432
|
+
"baseConfidence": 0.4,
|
|
392
433
|
"category": "dangerous_function",
|
|
393
434
|
"confidence": "high",
|
|
394
435
|
"description": "setTimeout/setInterval with string argument acts like eval()",
|
|
@@ -398,6 +439,7 @@ Array [
|
|
|
398
439
|
"lineContent": "setInterval('console.log(\\"tick\\")', 500);",
|
|
399
440
|
"lineNumber": 3,
|
|
400
441
|
"severity": "high",
|
|
442
|
+
"source": "structural",
|
|
401
443
|
"suggestedFix": "Pass a function reference instead of a string",
|
|
402
444
|
"title": "setTimeout/setInterval with string",
|
|
403
445
|
},
|
|
@@ -407,6 +449,7 @@ Array [
|
|
|
407
449
|
exports[`Refactor Safety - dangerous-functions.ts innerHTML/XSS detection should detect dangerouslySetInnerHTML 1`] = `
|
|
408
450
|
Array [
|
|
409
451
|
Object {
|
|
452
|
+
"baseConfidence": 0.4,
|
|
410
453
|
"category": "dangerous_function",
|
|
411
454
|
"confidence": "high",
|
|
412
455
|
"description": "dangerouslySetInnerHTML can lead to XSS if content is not sanitized This appears to use dynamic content which increases XSS risk.",
|
|
@@ -417,6 +460,7 @@ Array [
|
|
|
417
460
|
"lineNumber": 2,
|
|
418
461
|
"requiresAIValidation": true,
|
|
419
462
|
"severity": "high",
|
|
463
|
+
"source": "structural",
|
|
420
464
|
"suggestedFix": "Sanitize HTML content with DOMPurify before rendering",
|
|
421
465
|
"title": "dangerouslySetInnerHTML",
|
|
422
466
|
},
|
|
@@ -426,6 +470,7 @@ Array [
|
|
|
426
470
|
exports[`Refactor Safety - dangerous-functions.ts innerHTML/XSS detection should detect document.write 1`] = `
|
|
427
471
|
Array [
|
|
428
472
|
Object {
|
|
473
|
+
"baseConfidence": 0.4,
|
|
429
474
|
"category": "dangerous_function",
|
|
430
475
|
"confidence": "high",
|
|
431
476
|
"description": "document.write can introduce XSS vulnerabilities",
|
|
@@ -435,6 +480,7 @@ Array [
|
|
|
435
480
|
"lineContent": "document.write('<script>alert(1)</script>');",
|
|
436
481
|
"lineNumber": 2,
|
|
437
482
|
"severity": "high",
|
|
483
|
+
"source": "structural",
|
|
438
484
|
"suggestedFix": "Use DOM manipulation methods instead",
|
|
439
485
|
"title": "document.write",
|
|
440
486
|
},
|
|
@@ -446,6 +492,7 @@ exports[`Refactor Safety - dangerous-functions.ts innerHTML/XSS detection should
|
|
|
446
492
|
exports[`Refactor Safety - dangerous-functions.ts innerHTML/XSS detection should detect innerHTML with dynamic content 1`] = `
|
|
447
493
|
Array [
|
|
448
494
|
Object {
|
|
495
|
+
"baseConfidence": 0.4,
|
|
449
496
|
"category": "dangerous_function",
|
|
450
497
|
"confidence": "high",
|
|
451
498
|
"description": "Direct innerHTML assignment can lead to XSS vulnerabilities This appears to use dynamic content which increases XSS risk.",
|
|
@@ -456,10 +503,12 @@ Array [
|
|
|
456
503
|
"lineNumber": 2,
|
|
457
504
|
"requiresAIValidation": true,
|
|
458
505
|
"severity": "high",
|
|
506
|
+
"source": "structural",
|
|
459
507
|
"suggestedFix": "Use textContent for text, or sanitize HTML with DOMPurify",
|
|
460
508
|
"title": "innerHTML assignment",
|
|
461
509
|
},
|
|
462
510
|
Object {
|
|
511
|
+
"baseConfidence": 0.4,
|
|
463
512
|
"category": "dangerous_function",
|
|
464
513
|
"confidence": "high",
|
|
465
514
|
"description": "Direct innerHTML assignment can lead to XSS vulnerabilities This appears to use dynamic content which increases XSS risk.",
|
|
@@ -470,6 +519,7 @@ Array [
|
|
|
470
519
|
"lineNumber": 3,
|
|
471
520
|
"requiresAIValidation": true,
|
|
472
521
|
"severity": "high",
|
|
522
|
+
"source": "structural",
|
|
473
523
|
"suggestedFix": "Use textContent for text, or sanitize HTML with DOMPurify",
|
|
474
524
|
"title": "innerHTML assignment",
|
|
475
525
|
},
|
|
@@ -487,6 +537,7 @@ exports[`Refactor Safety - dangerous-functions.ts request.json() validation dete
|
|
|
487
537
|
exports[`Refactor Safety - dangerous-functions.ts request.json() validation detection should suggest schema validation for request.json() 1`] = `
|
|
488
538
|
Array [
|
|
489
539
|
Object {
|
|
540
|
+
"baseConfidence": 0.35,
|
|
490
541
|
"category": "dangerous_function",
|
|
491
542
|
"confidence": "low",
|
|
492
543
|
"description": "API endpoint parses request body without visible schema validation. Consider validating the shape of incoming data.",
|
|
@@ -496,6 +547,7 @@ Array [
|
|
|
496
547
|
"lineContent": "const body = await request.json();",
|
|
497
548
|
"lineNumber": 3,
|
|
498
549
|
"severity": "info",
|
|
550
|
+
"source": "structural",
|
|
499
551
|
"suggestedFix": "Add schema validation (e.g., zod): const body = await request.json(); const data = schema.parse(body);",
|
|
500
552
|
"title": "Request body without schema validation",
|
|
501
553
|
},
|
|
@@ -108,13 +108,13 @@ Array [
|
|
|
108
108
|
exports[`Scan Depth Snapshots Mixed Severity - Multiple Issue Types full scan should detect all issues 1`] = `
|
|
109
109
|
Array [
|
|
110
110
|
Object {
|
|
111
|
-
"category": "
|
|
112
|
-
"confidence": "
|
|
111
|
+
"category": "missing_security_headers",
|
|
112
|
+
"confidence": "high",
|
|
113
113
|
"layer": 2,
|
|
114
114
|
"lineContent": "const app = express()",
|
|
115
115
|
"lineNumber": 4,
|
|
116
116
|
"severity": "medium",
|
|
117
|
-
"title": "
|
|
117
|
+
"title": "Express app without helmet security headers",
|
|
118
118
|
},
|
|
119
119
|
Object {
|
|
120
120
|
"category": "ai_pattern",
|
|
@@ -161,15 +161,6 @@ Array [
|
|
|
161
161
|
"severity": "high",
|
|
162
162
|
"title": "innerHTML assignment",
|
|
163
163
|
},
|
|
164
|
-
Object {
|
|
165
|
-
"category": "ai_pattern",
|
|
166
|
-
"confidence": "low",
|
|
167
|
-
"layer": 2,
|
|
168
|
-
"lineContent": "console.log('Debug:', sensitiveData)",
|
|
169
|
-
"lineNumber": 19,
|
|
170
|
-
"severity": "info",
|
|
171
|
-
"title": "[AI Pattern] AI console.log debugging",
|
|
172
|
-
},
|
|
173
164
|
]
|
|
174
165
|
`;
|
|
175
166
|
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* DO NOT modify these tests unless intentionally changing validation behavior.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { applyAutoDismissRules } from '../../
|
|
11
|
-
import type { Vulnerability, VulnerabilityCategory, VulnerabilitySeverity } from '../../types'
|
|
10
|
+
import { applyAutoDismissRules } from '../../validate'
|
|
11
|
+
import type { Vulnerability, VulnerabilityCategory, VulnerabilitySeverity } from '../../shared/types'
|
|
12
12
|
|
|
13
13
|
// Helper to create test findings
|
|
14
14
|
function createFinding(overrides: Partial<Vulnerability> = {}): Vulnerability {
|
|
@@ -217,7 +217,7 @@ describe('Refactor Safety - anthropic.ts Auto-Dismiss Rules', () => {
|
|
|
217
217
|
expect(result).toMatchSnapshot()
|
|
218
218
|
})
|
|
219
219
|
|
|
220
|
-
it('should
|
|
220
|
+
it('should auto-dismiss info severity ai_pattern findings (code quality, not security)', () => {
|
|
221
221
|
const findings = [
|
|
222
222
|
createFinding({
|
|
223
223
|
severity: 'info',
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* DO NOT modify these tests unless intentionally changing detection behavior.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { detectDangerousFunctions } from '../../
|
|
10
|
+
import { detectDangerousFunctions } from '../../detect/structural/dangerous-functions'
|
|
11
11
|
|
|
12
12
|
describe('Refactor Safety - dangerous-functions.ts', () => {
|
|
13
13
|
describe('eval/Function detection', () => {
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
* Update snapshots: npx jest --updateSnapshot
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { runLayer1Scan } from '../../
|
|
12
|
-
import { runLayer2Scan } from '../../
|
|
13
|
-
import type { ScanFile, Vulnerability } from '../../types'
|
|
11
|
+
import { runLayer1Scan } from '../../detect/secrets'
|
|
12
|
+
import { runLayer2Scan } from '../../detect/structural'
|
|
13
|
+
import type { ScanFile, Vulnerability } from '../../shared/types'
|
|
14
14
|
|
|
15
15
|
// Helper to normalize vulnerability output for snapshot comparison
|
|
16
16
|
// Removes volatile fields like timestamps and IDs
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { buildFindingRouteAnnotation, buildFileRouteSummary } from '../../validate/request-builder'
|
|
2
|
+
import type { RouteMap, RouteDefinition } from '../../model/route-discovery'
|
|
3
|
+
import type { Vulnerability } from '../../shared/types'
|
|
4
|
+
|
|
5
|
+
function makeRoute(overrides: Partial<RouteDefinition> = {}): RouteDefinition {
|
|
6
|
+
return {
|
|
7
|
+
filePath: 'src/api/users.ts',
|
|
8
|
+
methods: ['GET'],
|
|
9
|
+
path: '/api/users',
|
|
10
|
+
handler: 'getUsers',
|
|
11
|
+
handlerLine: 5,
|
|
12
|
+
framework: 'express',
|
|
13
|
+
authMiddleware: [],
|
|
14
|
+
rateLimiting: false,
|
|
15
|
+
isPublic: false,
|
|
16
|
+
inputs: [],
|
|
17
|
+
...overrides,
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function makeFinding(overrides: Partial<Vulnerability> = {}): Vulnerability {
|
|
22
|
+
return {
|
|
23
|
+
id: 'test-1',
|
|
24
|
+
filePath: 'src/api/users.ts',
|
|
25
|
+
lineNumber: 10,
|
|
26
|
+
lineContent: 'const data = req.body',
|
|
27
|
+
severity: 'medium',
|
|
28
|
+
category: 'missing_auth',
|
|
29
|
+
title: 'Missing auth',
|
|
30
|
+
description: 'No auth check',
|
|
31
|
+
confidence: 'medium',
|
|
32
|
+
layer: 2,
|
|
33
|
+
...overrides,
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function makeRouteMap(routes: RouteDefinition[]): RouteMap {
|
|
38
|
+
const fileToRoutes = new Map<string, RouteDefinition[]>()
|
|
39
|
+
for (const r of routes) {
|
|
40
|
+
const existing = fileToRoutes.get(r.filePath) || []
|
|
41
|
+
existing.push(r)
|
|
42
|
+
fileToRoutes.set(r.filePath, existing)
|
|
43
|
+
}
|
|
44
|
+
return { routes, fileToRoutes }
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
describe('Route Annotations', () => {
|
|
48
|
+
describe('buildFindingRouteAnnotation', () => {
|
|
49
|
+
it('returns route context for matching file', () => {
|
|
50
|
+
const route = makeRoute({ authMiddleware: ['authGuard'] })
|
|
51
|
+
const routeMap = makeRouteMap([route])
|
|
52
|
+
const finding = makeFinding()
|
|
53
|
+
const annotation = buildFindingRouteAnnotation(finding, 'src/api/users.ts', routeMap)
|
|
54
|
+
|
|
55
|
+
expect(annotation).toContain('Route Context')
|
|
56
|
+
expect(annotation).toContain('express')
|
|
57
|
+
expect(annotation).toContain('/api/users')
|
|
58
|
+
expect(annotation).toContain('authGuard')
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
it('shows NONE for missing auth', () => {
|
|
62
|
+
const route = makeRoute()
|
|
63
|
+
const routeMap = makeRouteMap([route])
|
|
64
|
+
const finding = makeFinding()
|
|
65
|
+
const annotation = buildFindingRouteAnnotation(finding, 'src/api/users.ts', routeMap)
|
|
66
|
+
|
|
67
|
+
expect(annotation).toContain('Auth middleware: NONE')
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
it('returns empty for non-route files', () => {
|
|
71
|
+
const routeMap = makeRouteMap([])
|
|
72
|
+
const finding = makeFinding({ filePath: 'src/utils.ts' })
|
|
73
|
+
const annotation = buildFindingRouteAnnotation(finding, 'src/utils.ts', routeMap)
|
|
74
|
+
|
|
75
|
+
expect(annotation).toBe('')
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
it('selects closest route to finding line', () => {
|
|
79
|
+
const route1 = makeRoute({ handlerLine: 5, path: '/api/users' })
|
|
80
|
+
const route2 = makeRoute({ handlerLine: 20, path: '/api/items' })
|
|
81
|
+
const routeMap = makeRouteMap([route1, route2])
|
|
82
|
+
const finding = makeFinding({ lineNumber: 25 })
|
|
83
|
+
const annotation = buildFindingRouteAnnotation(finding, 'src/api/users.ts', routeMap)
|
|
84
|
+
|
|
85
|
+
expect(annotation).toContain('/api/items')
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
it('shows rate limiting status', () => {
|
|
89
|
+
const route = makeRoute({ rateLimiting: true })
|
|
90
|
+
const routeMap = makeRouteMap([route])
|
|
91
|
+
const finding = makeFinding()
|
|
92
|
+
const annotation = buildFindingRouteAnnotation(finding, 'src/api/users.ts', routeMap)
|
|
93
|
+
|
|
94
|
+
expect(annotation).toContain('Rate limiting: Yes')
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
it('shows public endpoint flag', () => {
|
|
98
|
+
const route = makeRoute({ isPublic: true })
|
|
99
|
+
const routeMap = makeRouteMap([route])
|
|
100
|
+
const finding = makeFinding()
|
|
101
|
+
const annotation = buildFindingRouteAnnotation(finding, 'src/api/users.ts', routeMap)
|
|
102
|
+
|
|
103
|
+
expect(annotation).toContain('Public endpoint: Yes')
|
|
104
|
+
})
|
|
105
|
+
})
|
|
106
|
+
|
|
107
|
+
describe('buildFileRouteSummary', () => {
|
|
108
|
+
it('returns route map summary', () => {
|
|
109
|
+
const routes = [
|
|
110
|
+
makeRoute({ methods: ['GET'], path: '/api/users', handlerLine: 5, authMiddleware: ['auth'] }),
|
|
111
|
+
makeRoute({ methods: ['POST'], path: '/api/users', handlerLine: 15 }),
|
|
112
|
+
]
|
|
113
|
+
const routeMap = makeRouteMap(routes)
|
|
114
|
+
const summary = buildFileRouteSummary('src/api/users.ts', routeMap)
|
|
115
|
+
|
|
116
|
+
expect(summary).toContain('Route Map')
|
|
117
|
+
expect(summary).toContain('GET')
|
|
118
|
+
expect(summary).toContain('POST')
|
|
119
|
+
expect(summary).toContain('[auth: auth]')
|
|
120
|
+
expect(summary).toContain('[no auth]')
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
it('returns empty for non-route files', () => {
|
|
124
|
+
const routeMap = makeRouteMap([])
|
|
125
|
+
const summary = buildFileRouteSummary('src/utils.ts', routeMap)
|
|
126
|
+
expect(summary).toBe('')
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
it('shows rate limiting and public flags', () => {
|
|
130
|
+
const route = makeRoute({ rateLimiting: true, isPublic: true })
|
|
131
|
+
const routeMap = makeRouteMap([route])
|
|
132
|
+
const summary = buildFileRouteSummary('src/api/users.ts', routeMap)
|
|
133
|
+
|
|
134
|
+
expect(summary).toContain('[rate-limited]')
|
|
135
|
+
expect(summary).toContain('[public]')
|
|
136
|
+
})
|
|
137
|
+
})
|
|
138
|
+
})
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import * as fs from 'fs'
|
|
14
14
|
import * as path from 'path'
|
|
15
|
-
import type { ScanResult, Vulnerability, VulnerabilityCategory, VulnerabilitySeverity } from '../../types'
|
|
15
|
+
import type { ScanResult, Vulnerability, VulnerabilityCategory, VulnerabilitySeverity } from '../../shared/types'
|
|
16
16
|
|
|
17
17
|
const RESULTS_DIR = path.join(__dirname, '../../../validation-results')
|
|
18
18
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import * as fs from 'fs'
|
|
9
9
|
import * as path from 'path'
|
|
10
|
-
import type { ScanResult, Vulnerability } from '../../types'
|
|
10
|
+
import type { ScanResult, Vulnerability } from '../../shared/types'
|
|
11
11
|
|
|
12
12
|
const RESULTS_DIR = path.join(__dirname, '../../../validation-results')
|
|
13
13
|
const REPOS_DIR = path.join(__dirname, '../../../validation-repos')
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
import * as fs from 'fs'
|
|
11
11
|
import * as path from 'path'
|
|
12
|
-
import type { ScanResult, Vulnerability } from '../../types'
|
|
12
|
+
import type { ScanResult, Vulnerability } from '../../shared/types'
|
|
13
13
|
|
|
14
14
|
const RESULTS_DIR = path.join(__dirname, '../../../validation-results')
|
|
15
15
|
const OUTPUT_PATH = path.join(__dirname, '../../../docs/FP_DEEP_ANALYSIS.md')
|