@oculum/scanner 1.0.14 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/detect/ai-code/index.d.ts +6 -11
- package/dist/detect/ai-code/index.d.ts.map +1 -1
- package/dist/detect/ai-code/index.js +6 -24
- package/dist/detect/ai-code/index.js.map +1 -1
- package/dist/detect/ast-rules/agent-tools-ast.d.ts +14 -0
- package/dist/detect/ast-rules/agent-tools-ast.d.ts.map +1 -0
- package/dist/detect/ast-rules/agent-tools-ast.js +809 -0
- package/dist/detect/ast-rules/agent-tools-ast.js.map +1 -0
- package/dist/detect/ast-rules/ai-fingerprinting-ast.d.ts +14 -0
- package/dist/detect/ast-rules/ai-fingerprinting-ast.d.ts.map +1 -0
- package/dist/detect/ast-rules/ai-fingerprinting-ast.js +344 -0
- package/dist/detect/ast-rules/ai-fingerprinting-ast.js.map +1 -0
- package/dist/detect/ast-rules/auth-patterns-ast.d.ts +14 -0
- package/dist/detect/ast-rules/auth-patterns-ast.d.ts.map +1 -0
- package/dist/detect/ast-rules/auth-patterns-ast.js +280 -0
- package/dist/detect/ast-rules/auth-patterns-ast.js.map +1 -0
- package/dist/detect/ast-rules/byok-ast.d.ts +13 -0
- package/dist/detect/ast-rules/byok-ast.d.ts.map +1 -0
- package/dist/detect/ast-rules/byok-ast.js +180 -0
- package/dist/detect/ast-rules/byok-ast.js.map +1 -0
- package/dist/detect/ast-rules/child-process-ast.d.ts +13 -0
- package/dist/detect/ast-rules/child-process-ast.d.ts.map +1 -0
- package/dist/detect/ast-rules/child-process-ast.js +252 -0
- package/dist/detect/ast-rules/child-process-ast.js.map +1 -0
- package/dist/detect/ast-rules/dangerous-eval-ast.d.ts +13 -0
- package/dist/detect/ast-rules/dangerous-eval-ast.d.ts.map +1 -0
- package/dist/detect/ast-rules/dangerous-eval-ast.js +218 -0
- package/dist/detect/ast-rules/dangerous-eval-ast.js.map +1 -0
- package/dist/detect/ast-rules/data-exposure-ast.d.ts +13 -0
- package/dist/detect/ast-rules/data-exposure-ast.d.ts.map +1 -0
- package/dist/detect/ast-rules/data-exposure-ast.js +158 -0
- package/dist/detect/ast-rules/data-exposure-ast.js.map +1 -0
- package/dist/detect/ast-rules/dom-xss-ast.d.ts +14 -0
- package/dist/detect/ast-rules/dom-xss-ast.d.ts.map +1 -0
- package/dist/detect/ast-rules/dom-xss-ast.js +217 -0
- package/dist/detect/ast-rules/dom-xss-ast.js.map +1 -0
- package/dist/detect/ast-rules/endpoint-protection-ast.d.ts +13 -0
- package/dist/detect/ast-rules/endpoint-protection-ast.d.ts.map +1 -0
- package/dist/detect/ast-rules/endpoint-protection-ast.js +228 -0
- package/dist/detect/ast-rules/endpoint-protection-ast.js.map +1 -0
- package/dist/detect/ast-rules/entropy-ast.d.ts +17 -0
- package/dist/detect/ast-rules/entropy-ast.d.ts.map +1 -0
- package/dist/detect/ast-rules/entropy-ast.js +265 -0
- package/dist/detect/ast-rules/entropy-ast.js.map +1 -0
- package/dist/detect/ast-rules/flask-debug-ast.d.ts +10 -0
- package/dist/detect/ast-rules/flask-debug-ast.d.ts.map +1 -0
- package/dist/detect/ast-rules/flask-debug-ast.js +125 -0
- package/dist/detect/ast-rules/flask-debug-ast.js.map +1 -0
- package/dist/detect/ast-rules/framework-checks-ast.d.ts +13 -0
- package/dist/detect/ast-rules/framework-checks-ast.d.ts.map +1 -0
- package/dist/detect/ast-rules/framework-checks-ast.js +185 -0
- package/dist/detect/ast-rules/framework-checks-ast.js.map +1 -0
- package/dist/detect/ast-rules/helpers/call-analysis.d.ts +62 -0
- package/dist/detect/ast-rules/helpers/call-analysis.d.ts.map +1 -0
- package/dist/detect/ast-rules/helpers/call-analysis.js +217 -0
- package/dist/detect/ast-rules/helpers/call-analysis.js.map +1 -0
- package/dist/detect/ast-rules/helpers/context-detection.d.ts +33 -0
- package/dist/detect/ast-rules/helpers/context-detection.d.ts.map +1 -0
- package/dist/detect/ast-rules/helpers/context-detection.js +256 -0
- package/dist/detect/ast-rules/helpers/context-detection.js.map +1 -0
- package/dist/detect/ast-rules/helpers/control-flow.d.ts +40 -0
- package/dist/detect/ast-rules/helpers/control-flow.d.ts.map +1 -0
- package/dist/detect/ast-rules/helpers/control-flow.js +174 -0
- package/dist/detect/ast-rules/helpers/control-flow.js.map +1 -0
- package/dist/detect/ast-rules/helpers/import-analysis.d.ts +43 -0
- package/dist/detect/ast-rules/helpers/import-analysis.d.ts.map +1 -0
- package/dist/detect/ast-rules/helpers/import-analysis.js +149 -0
- package/dist/detect/ast-rules/helpers/import-analysis.js.map +1 -0
- package/dist/detect/ast-rules/helpers/index.d.ts +16 -0
- package/dist/detect/ast-rules/helpers/index.d.ts.map +1 -0
- package/dist/detect/ast-rules/helpers/index.js +112 -0
- package/dist/detect/ast-rules/helpers/index.js.map +1 -0
- package/dist/detect/ast-rules/helpers/python-helpers.d.ts +215 -0
- package/dist/detect/ast-rules/helpers/python-helpers.d.ts.map +1 -0
- package/dist/detect/ast-rules/helpers/python-helpers.js +935 -0
- package/dist/detect/ast-rules/helpers/python-helpers.js.map +1 -0
- package/dist/detect/ast-rules/helpers/scope-analysis.d.ts +50 -0
- package/dist/detect/ast-rules/helpers/scope-analysis.d.ts.map +1 -0
- package/dist/detect/ast-rules/helpers/scope-analysis.js +194 -0
- package/dist/detect/ast-rules/helpers/scope-analysis.js.map +1 -0
- package/dist/detect/ast-rules/helpers/string-analysis.d.ts +57 -0
- package/dist/detect/ast-rules/helpers/string-analysis.d.ts.map +1 -0
- package/dist/detect/ast-rules/helpers/string-analysis.js +184 -0
- package/dist/detect/ast-rules/helpers/string-analysis.js.map +1 -0
- package/dist/detect/ast-rules/helpers/type-extraction.d.ts +44 -0
- package/dist/detect/ast-rules/helpers/type-extraction.d.ts.map +1 -0
- package/dist/detect/ast-rules/helpers/type-extraction.js +125 -0
- package/dist/detect/ast-rules/helpers/type-extraction.js.map +1 -0
- package/dist/detect/ast-rules/helpers/user-input.d.ts +35 -0
- package/dist/detect/ast-rules/helpers/user-input.d.ts.map +1 -0
- package/dist/detect/ast-rules/helpers/user-input.js +243 -0
- package/dist/detect/ast-rules/helpers/user-input.js.map +1 -0
- package/dist/detect/ast-rules/index.d.ts +112 -0
- package/dist/detect/ast-rules/index.d.ts.map +1 -0
- package/dist/detect/ast-rules/index.js +232 -0
- package/dist/detect/ast-rules/index.js.map +1 -0
- package/dist/detect/ast-rules/json-parse-ast.d.ts +13 -0
- package/dist/detect/ast-rules/json-parse-ast.d.ts.map +1 -0
- package/dist/detect/ast-rules/json-parse-ast.js +143 -0
- package/dist/detect/ast-rules/json-parse-ast.js.map +1 -0
- package/dist/detect/ast-rules/log-injection-ast.d.ts +14 -0
- package/dist/detect/ast-rules/log-injection-ast.d.ts.map +1 -0
- package/dist/detect/ast-rules/log-injection-ast.js +235 -0
- package/dist/detect/ast-rules/log-injection-ast.js.map +1 -0
- package/dist/detect/ast-rules/logic-gates-ast.d.ts +14 -0
- package/dist/detect/ast-rules/logic-gates-ast.d.ts.map +1 -0
- package/dist/detect/ast-rules/logic-gates-ast.js +312 -0
- package/dist/detect/ast-rules/logic-gates-ast.js.map +1 -0
- package/dist/detect/ast-rules/mcp-security-ast.d.ts +14 -0
- package/dist/detect/ast-rules/mcp-security-ast.d.ts.map +1 -0
- package/dist/detect/ast-rules/mcp-security-ast.js +755 -0
- package/dist/detect/ast-rules/mcp-security-ast.js.map +1 -0
- package/dist/detect/ast-rules/model-supply-chain-ast.d.ts +13 -0
- package/dist/detect/ast-rules/model-supply-chain-ast.d.ts.map +1 -0
- package/dist/detect/ast-rules/model-supply-chain-ast.js +188 -0
- package/dist/detect/ast-rules/model-supply-chain-ast.js.map +1 -0
- package/dist/detect/ast-rules/package-hallucination-ast.d.ts +13 -0
- package/dist/detect/ast-rules/package-hallucination-ast.d.ts.map +1 -0
- package/dist/detect/ast-rules/package-hallucination-ast.js +607 -0
- package/dist/detect/ast-rules/package-hallucination-ast.js.map +1 -0
- package/dist/detect/ast-rules/prompt-hygiene-ast.d.ts +15 -0
- package/dist/detect/ast-rules/prompt-hygiene-ast.d.ts.map +1 -0
- package/dist/detect/ast-rules/prompt-hygiene-ast.js +332 -0
- package/dist/detect/ast-rules/prompt-hygiene-ast.js.map +1 -0
- package/dist/detect/ast-rules/rag-safety-ast.d.ts +18 -0
- package/dist/detect/ast-rules/rag-safety-ast.d.ts.map +1 -0
- package/dist/detect/ast-rules/rag-safety-ast.js +640 -0
- package/dist/detect/ast-rules/rag-safety-ast.js.map +1 -0
- package/dist/detect/ast-rules/request-validation-ast.d.ts +13 -0
- package/dist/detect/ast-rules/request-validation-ast.d.ts.map +1 -0
- package/dist/detect/ast-rules/request-validation-ast.js +116 -0
- package/dist/detect/ast-rules/request-validation-ast.js.map +1 -0
- package/dist/detect/ast-rules/risky-imports-ast.d.ts +14 -0
- package/dist/detect/ast-rules/risky-imports-ast.d.ts.map +1 -0
- package/dist/detect/ast-rules/risky-imports-ast.js +114 -0
- package/dist/detect/ast-rules/risky-imports-ast.js.map +1 -0
- package/dist/detect/ast-rules/schema-validation-ast.d.ts +14 -0
- package/dist/detect/ast-rules/schema-validation-ast.d.ts.map +1 -0
- package/dist/detect/ast-rules/schema-validation-ast.js +233 -0
- package/dist/detect/ast-rules/schema-validation-ast.js.map +1 -0
- package/dist/detect/ast-rules/secret-patterns-ast.d.ts +17 -0
- package/dist/detect/ast-rules/secret-patterns-ast.d.ts.map +1 -0
- package/dist/detect/ast-rules/secret-patterns-ast.js +199 -0
- package/dist/detect/ast-rules/secret-patterns-ast.js.map +1 -0
- package/dist/detect/ast-rules/security-headers-ast.d.ts +14 -0
- package/dist/detect/ast-rules/security-headers-ast.d.ts.map +1 -0
- package/dist/detect/ast-rules/security-headers-ast.js +187 -0
- package/dist/detect/ast-rules/security-headers-ast.js.map +1 -0
- package/dist/detect/ast-rules/sql-injection-ast.d.ts +17 -0
- package/dist/detect/ast-rules/sql-injection-ast.d.ts.map +1 -0
- package/dist/detect/ast-rules/sql-injection-ast.js +497 -0
- package/dist/detect/ast-rules/sql-injection-ast.js.map +1 -0
- package/dist/detect/ast-rules/ssrf-ast.d.ts +14 -0
- package/dist/detect/ast-rules/ssrf-ast.d.ts.map +1 -0
- package/dist/detect/ast-rules/ssrf-ast.js +573 -0
- package/dist/detect/ast-rules/ssrf-ast.js.map +1 -0
- package/dist/detect/ast-rules/taint-fix-templates.d.ts +18 -0
- package/dist/detect/ast-rules/taint-fix-templates.d.ts.map +1 -0
- package/dist/detect/ast-rules/taint-fix-templates.js +92 -0
- package/dist/detect/ast-rules/taint-fix-templates.js.map +1 -0
- package/dist/detect/ast-rules/taint-flow-ast.d.ts +24 -0
- package/dist/detect/ast-rules/taint-flow-ast.d.ts.map +1 -0
- package/dist/detect/ast-rules/taint-flow-ast.js +340 -0
- package/dist/detect/ast-rules/taint-flow-ast.js.map +1 -0
- package/dist/detect/ast-rules/variables-ast.d.ts +24 -0
- package/dist/detect/ast-rules/variables-ast.d.ts.map +1 -0
- package/dist/detect/ast-rules/variables-ast.js +362 -0
- package/dist/detect/ast-rules/variables-ast.js.map +1 -0
- package/dist/detect/ast-rules/weak-crypto-ast.d.ts +15 -0
- package/dist/detect/ast-rules/weak-crypto-ast.d.ts.map +1 -0
- package/dist/detect/ast-rules/weak-crypto-ast.js +406 -0
- package/dist/detect/ast-rules/weak-crypto-ast.js.map +1 -0
- package/dist/detect/ast-rules/xxe-ast.d.ts +13 -0
- package/dist/detect/ast-rules/xxe-ast.d.ts.map +1 -0
- package/dist/detect/ast-rules/xxe-ast.js +157 -0
- package/dist/detect/ast-rules/xxe-ast.js.map +1 -0
- package/dist/detect/config/agent-skill-injection.d.ts.map +1 -1
- package/dist/detect/config/agent-skill-injection.js +2 -24
- package/dist/detect/config/agent-skill-injection.js.map +1 -1
- package/dist/detect/config/index.d.ts +1 -0
- package/dist/detect/config/index.d.ts.map +1 -1
- package/dist/detect/config/index.js +3 -1
- package/dist/detect/config/index.js.map +1 -1
- package/dist/detect/config/osv-check.d.ts.map +1 -1
- package/dist/detect/config/osv-check.js +6 -1
- package/dist/detect/config/osv-check.js.map +1 -1
- package/dist/detect/config/package-check.d.ts.map +1 -1
- package/dist/detect/config/package-check.js +6 -1
- package/dist/detect/config/package-check.js.map +1 -1
- package/dist/detect/config/rules-file-backdoor.d.ts +36 -0
- package/dist/detect/config/rules-file-backdoor.d.ts.map +1 -0
- package/dist/detect/config/rules-file-backdoor.js +379 -0
- package/dist/detect/config/rules-file-backdoor.js.map +1 -0
- package/dist/detect/index.d.ts +43 -6
- package/dist/detect/index.d.ts.map +1 -1
- package/dist/detect/index.js +70 -7
- package/dist/detect/index.js.map +1 -1
- package/dist/detect/secrets/config-audit.d.ts.map +1 -1
- package/dist/detect/secrets/config-audit.js +36 -3
- package/dist/detect/secrets/config-audit.js.map +1 -1
- package/dist/detect/secrets/entropy.d.ts.map +1 -1
- package/dist/detect/secrets/entropy.js +180 -0
- package/dist/detect/secrets/entropy.js.map +1 -1
- package/dist/detect/secrets/index.d.ts +0 -2
- package/dist/detect/secrets/index.d.ts.map +1 -1
- package/dist/detect/secrets/index.js +7 -17
- package/dist/detect/secrets/index.js.map +1 -1
- package/dist/detect/structural/index.d.ts +15 -28
- package/dist/detect/structural/index.d.ts.map +1 -1
- package/dist/detect/structural/index.js +20 -497
- package/dist/detect/structural/index.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/model/auth-helper-detector.d.ts.map +1 -1
- package/dist/model/auth-helper-detector.js +2 -7
- package/dist/model/auth-helper-detector.js.map +1 -1
- package/dist/model/import-resolver.d.ts.map +1 -1
- package/dist/model/import-resolver.js +94 -0
- package/dist/model/import-resolver.js.map +1 -1
- package/dist/model/imported-auth-detector.js +8 -8
- package/dist/model/imported-auth-detector.js.map +1 -1
- package/dist/model/index.d.ts +8 -0
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/index.js +198 -73
- package/dist/model/index.js.map +1 -1
- package/dist/model/module-graph.d.ts.map +1 -1
- package/dist/model/module-graph.js +22 -9
- package/dist/model/module-graph.js.map +1 -1
- package/dist/model/project-context.d.ts +1 -1
- package/dist/model/project-context.d.ts.map +1 -1
- package/dist/model/project-context.js +34 -0
- package/dist/model/project-context.js.map +1 -1
- package/dist/model/route-auth-resolver.d.ts.map +1 -1
- package/dist/model/route-auth-resolver.js +17 -2
- package/dist/model/route-auth-resolver.js.map +1 -1
- package/dist/model/route-discovery/index.js +1 -1
- package/dist/model/route-discovery/index.js.map +1 -1
- package/dist/model/route-discovery/nextjs.js +1 -1
- package/dist/model/route-discovery/nextjs.js.map +1 -1
- package/dist/model/route-discovery/python.d.ts +6 -3
- package/dist/model/route-discovery/python.d.ts.map +1 -1
- package/dist/model/route-discovery/python.js +132 -9
- package/dist/model/route-discovery/python.js.map +1 -1
- package/dist/model/route-discovery/types.d.ts +1 -1
- package/dist/model/route-discovery/types.d.ts.map +1 -1
- package/dist/model/route-discovery/utils.d.ts +8 -0
- package/dist/model/route-discovery/utils.d.ts.map +1 -1
- package/dist/model/route-discovery/utils.js +70 -0
- package/dist/model/route-discovery/utils.js.map +1 -1
- package/dist/model/taint-types.d.ts +0 -4
- package/dist/model/taint-types.d.ts.map +1 -1
- package/dist/parse/ast.d.ts +58 -0
- package/dist/parse/ast.d.ts.map +1 -0
- package/dist/parse/ast.js +230 -0
- package/dist/parse/ast.js.map +1 -0
- package/dist/parse/call-graph.d.ts +41 -0
- package/dist/parse/call-graph.d.ts.map +1 -0
- package/dist/parse/call-graph.js +386 -0
- package/dist/parse/call-graph.js.map +1 -0
- package/dist/parse/file-classifier.d.ts +11 -0
- package/dist/parse/file-classifier.d.ts.map +1 -1
- package/dist/parse/file-classifier.js +63 -15
- package/dist/parse/file-classifier.js.map +1 -1
- package/dist/parse/node-index.d.ts +32 -0
- package/dist/parse/node-index.d.ts.map +1 -0
- package/dist/parse/node-index.js +103 -0
- package/dist/parse/node-index.js.map +1 -0
- package/dist/parse/type-extractor.d.ts +50 -0
- package/dist/parse/type-extractor.d.ts.map +1 -0
- package/dist/parse/type-extractor.js +243 -0
- package/dist/parse/type-extractor.js.map +1 -0
- package/dist/pipeline/config.d.ts +7 -1
- package/dist/pipeline/config.d.ts.map +1 -1
- package/dist/pipeline/config.js.map +1 -1
- package/dist/pipeline/index.d.ts +3 -3
- package/dist/pipeline/index.d.ts.map +1 -1
- package/dist/pipeline/index.js +192 -64
- package/dist/pipeline/index.js.map +1 -1
- package/dist/pipeline/modes/incremental.d.ts.map +1 -1
- package/dist/pipeline/modes/incremental.js +2 -7
- package/dist/pipeline/modes/incremental.js.map +1 -1
- package/dist/postprocess/dedup.d.ts +5 -2
- package/dist/postprocess/dedup.d.ts.map +1 -1
- package/dist/postprocess/dedup.js +47 -16
- package/dist/postprocess/dedup.js.map +1 -1
- package/dist/report/build-result.d.ts +9 -4
- package/dist/report/build-result.d.ts.map +1 -1
- package/dist/report/build-result.js +15 -4
- package/dist/report/build-result.js.map +1 -1
- package/dist/report/formatters/cli-terminal.d.ts +1 -1
- package/dist/report/formatters/cli-terminal.d.ts.map +1 -1
- package/dist/report/formatters/cli-terminal.js +434 -231
- package/dist/report/formatters/cli-terminal.js.map +1 -1
- package/dist/report/sanitize.d.ts +10 -0
- package/dist/report/sanitize.d.ts.map +1 -0
- package/dist/report/sanitize.js +19 -0
- package/dist/report/sanitize.js.map +1 -0
- package/dist/score/adjustments.d.ts +20 -2
- package/dist/score/adjustments.d.ts.map +1 -1
- package/dist/score/adjustments.js +108 -37
- package/dist/score/adjustments.js.map +1 -1
- package/dist/score/confidence.d.ts +6 -0
- package/dist/score/confidence.d.ts.map +1 -1
- package/dist/score/confidence.js +10 -4
- package/dist/score/confidence.js.map +1 -1
- package/dist/score/evidence.d.ts +25 -0
- package/dist/score/evidence.d.ts.map +1 -0
- package/dist/score/evidence.js +51 -0
- package/dist/score/evidence.js.map +1 -0
- package/dist/score/index.d.ts +3 -1
- package/dist/score/index.d.ts.map +1 -1
- package/dist/score/index.js +25 -50
- package/dist/score/index.js.map +1 -1
- package/dist/score/types.d.ts +5 -1
- package/dist/score/types.d.ts.map +1 -1
- package/dist/shared/category-filter.d.ts.map +1 -1
- package/dist/shared/category-filter.js +12 -0
- package/dist/shared/category-filter.js.map +1 -1
- package/dist/shared/regex-utils.d.ts +3 -0
- package/dist/shared/regex-utils.d.ts.map +1 -0
- package/dist/shared/regex-utils.js +8 -0
- package/dist/shared/regex-utils.js.map +1 -0
- package/dist/shared/registry-clients.d.ts +7 -0
- package/dist/shared/registry-clients.d.ts.map +1 -1
- package/dist/shared/registry-clients.js +94 -17
- package/dist/shared/registry-clients.js.map +1 -1
- package/dist/shared/rules/metadata.d.ts.map +1 -1
- package/dist/shared/rules/metadata.js +17 -0
- package/dist/shared/rules/metadata.js.map +1 -1
- package/dist/shared/types.d.ts +59 -15
- package/dist/shared/types.d.ts.map +1 -1
- package/dist/shared/types.js +38 -21
- package/dist/shared/types.js.map +1 -1
- package/dist/taint/async-flow.d.ts +44 -0
- package/dist/taint/async-flow.d.ts.map +1 -0
- package/dist/taint/async-flow.js +271 -0
- package/dist/taint/async-flow.js.map +1 -0
- package/dist/taint/cfg-builder.d.ts +35 -0
- package/dist/taint/cfg-builder.d.ts.map +1 -0
- package/dist/taint/cfg-builder.js +980 -0
- package/dist/taint/cfg-builder.js.map +1 -0
- package/dist/taint/cfg-types.d.ts +76 -0
- package/dist/taint/cfg-types.d.ts.map +1 -0
- package/dist/taint/cfg-types.js +13 -0
- package/dist/taint/cfg-types.js.map +1 -0
- package/dist/taint/constant-propagation.d.ts +34 -0
- package/dist/taint/constant-propagation.d.ts.map +1 -0
- package/dist/taint/constant-propagation.js +164 -0
- package/dist/taint/constant-propagation.js.map +1 -0
- package/dist/taint/cross-file-analyzer.d.ts +27 -0
- package/dist/taint/cross-file-analyzer.d.ts.map +1 -0
- package/dist/taint/cross-file-analyzer.js +99 -0
- package/dist/taint/cross-file-analyzer.js.map +1 -0
- package/dist/taint/cross-file-index.d.ts +59 -0
- package/dist/taint/cross-file-index.d.ts.map +1 -0
- package/dist/taint/cross-file-index.js +183 -0
- package/dist/taint/cross-file-index.js.map +1 -0
- package/dist/taint/def-use.d.ts +27 -0
- package/dist/taint/def-use.d.ts.map +1 -0
- package/dist/taint/def-use.js +519 -0
- package/dist/taint/def-use.js.map +1 -0
- package/dist/taint/file-analysis-cache.d.ts +47 -0
- package/dist/taint/file-analysis-cache.d.ts.map +1 -0
- package/dist/taint/file-analysis-cache.js +107 -0
- package/dist/taint/file-analysis-cache.js.map +1 -0
- package/dist/taint/framework-models.d.ts +77 -0
- package/dist/taint/framework-models.d.ts.map +1 -0
- package/dist/taint/framework-models.js +258 -0
- package/dist/taint/framework-models.js.map +1 -0
- package/dist/taint/helpers.d.ts +31 -0
- package/dist/taint/helpers.d.ts.map +1 -0
- package/dist/taint/helpers.js +130 -0
- package/dist/taint/helpers.js.map +1 -0
- package/dist/taint/index.d.ts +28 -0
- package/dist/taint/index.d.ts.map +1 -0
- package/dist/taint/index.js +77 -0
- package/dist/taint/index.js.map +1 -0
- package/dist/taint/llm-registry.d.ts +47 -0
- package/dist/taint/llm-registry.d.ts.map +1 -0
- package/dist/taint/llm-registry.js +152 -0
- package/dist/taint/llm-registry.js.map +1 -0
- package/dist/taint/llm-risk-scoring.d.ts +54 -0
- package/dist/taint/llm-risk-scoring.d.ts.map +1 -0
- package/dist/taint/llm-risk-scoring.js +376 -0
- package/dist/taint/llm-risk-scoring.js.map +1 -0
- package/dist/taint/propagation-types.d.ts +104 -0
- package/dist/taint/propagation-types.d.ts.map +1 -0
- package/dist/taint/propagation-types.js +98 -0
- package/dist/taint/propagation-types.js.map +1 -0
- package/dist/taint/propagation.d.ts +111 -0
- package/dist/taint/propagation.d.ts.map +1 -0
- package/dist/taint/propagation.js +1576 -0
- package/dist/taint/propagation.js.map +1 -0
- package/dist/taint/sanitizer-registry.d.ts +26 -0
- package/dist/taint/sanitizer-registry.d.ts.map +1 -0
- package/dist/taint/sanitizer-registry.js +422 -0
- package/dist/taint/sanitizer-registry.js.map +1 -0
- package/dist/taint/sink-classifier.d.ts +27 -0
- package/dist/taint/sink-classifier.d.ts.map +1 -0
- package/dist/taint/sink-classifier.js +1166 -0
- package/dist/taint/sink-classifier.js.map +1 -0
- package/dist/taint/source-classifier.d.ts +29 -0
- package/dist/taint/source-classifier.d.ts.map +1 -0
- package/dist/taint/source-classifier.js +814 -0
- package/dist/taint/source-classifier.js.map +1 -0
- package/dist/taint/taint-analyzer.d.ts +33 -0
- package/dist/taint/taint-analyzer.d.ts.map +1 -0
- package/dist/taint/taint-analyzer.js +88 -0
- package/dist/taint/taint-analyzer.js.map +1 -0
- package/dist/taint/taint-summary.d.ts +37 -0
- package/dist/taint/taint-summary.d.ts.map +1 -0
- package/dist/taint/taint-summary.js +293 -0
- package/dist/taint/taint-summary.js.map +1 -0
- package/dist/taint/types.d.ts +47 -0
- package/dist/taint/types.d.ts.map +1 -0
- package/dist/taint/types.js +19 -0
- package/dist/taint/types.js.map +1 -0
- package/dist/validate/clients.d.ts +2 -1
- package/dist/validate/clients.d.ts.map +1 -1
- package/dist/validate/clients.js +3 -2
- package/dist/validate/clients.js.map +1 -1
- package/dist/validate/index.d.ts +5 -6
- package/dist/validate/index.d.ts.map +1 -1
- package/dist/validate/index.js +22 -21
- package/dist/validate/index.js.map +1 -1
- package/dist/validate/prompts/modules/ai-patterns.d.ts +1 -1
- package/dist/validate/prompts/modules/ai-patterns.d.ts.map +1 -1
- package/dist/validate/prompts/modules/ai-patterns.js +16 -0
- package/dist/validate/prompts/modules/ai-patterns.js.map +1 -1
- package/dist/validate/prompts/modules/common.d.ts +1 -1
- package/dist/validate/prompts/modules/common.d.ts.map +1 -1
- package/dist/validate/prompts/modules/common.js +12 -3
- package/dist/validate/prompts/modules/common.js.map +1 -1
- package/dist/validate/providers/anthropic.d.ts +4 -4
- package/dist/validate/providers/anthropic.d.ts.map +1 -1
- package/dist/validate/providers/anthropic.js +85 -58
- package/dist/validate/providers/anthropic.js.map +1 -1
- package/dist/validate/providers/openai.d.ts +4 -4
- package/dist/validate/providers/openai.d.ts.map +1 -1
- package/dist/validate/providers/openai.js +149 -99
- package/dist/validate/providers/openai.js.map +1 -1
- package/dist/validate/request-builder.d.ts +2 -8
- package/dist/validate/request-builder.d.ts.map +1 -1
- package/dist/validate/request-builder.js +4 -34
- package/dist/validate/request-builder.js.map +1 -1
- package/dist/validate/types.d.ts +9 -0
- package/dist/validate/types.d.ts.map +1 -1
- package/dist/validate/types.js.map +1 -1
- package/dist/validate/utils/path-helpers.js +2 -2
- package/dist/validate/utils/path-helpers.js.map +1 -1
- package/dist/validate/utils/response-parser.d.ts +10 -0
- package/dist/validate/utils/response-parser.d.ts.map +1 -1
- package/dist/validate/utils/response-parser.js +21 -2
- package/dist/validate/utils/response-parser.js.map +1 -1
- package/dist/validate/utils/retry.d.ts.map +1 -1
- package/dist/validate/utils/retry.js +19 -4
- package/dist/validate/utils/retry.js.map +1 -1
- package/package.json +7 -4
- package/src/__tests__/benchmark/fixtures/layer2/ai-execution-sinks.ts +1 -1
- package/src/__tests__/benchmark/planted-benchmark.test.ts +337 -0
- package/src/__tests__/benchmark/utils/test-runner.ts +38 -4
- package/src/__tests__/category-filter.test.ts +5 -1
- package/src/__tests__/context-engine/route-discovery/python.test.ts +726 -0
- package/src/__tests__/detect/ast-rules.test.ts +1043 -0
- package/src/__tests__/detect/offline-mode.test.ts +147 -0
- package/src/__tests__/detect/python-ast-rules.test.ts +569 -0
- package/src/__tests__/detect/python-helpers.test.ts +536 -0
- package/src/__tests__/detect/python-sast-rules.test.ts +453 -0
- package/src/__tests__/detect/rules-file-backdoor-decoders.test.ts +151 -0
- package/src/__tests__/detect/rules-file-backdoor.test.ts +284 -0
- package/src/__tests__/detect/taint-fix-templates.test.ts +150 -0
- package/src/__tests__/detect/taint-path-serialization.test.ts +170 -0
- package/src/__tests__/parse/call-graph.test.ts +300 -0
- package/src/__tests__/parse/python-parser.test.ts +274 -0
- package/src/__tests__/regression/known-false-positives.test.ts +491 -9
- package/src/__tests__/regression/rules-file-backdoor.test.ts +137 -0
- package/src/__tests__/score/adjustments.test.ts +34 -16
- package/src/__tests__/score/confidence.test.ts +84 -57
- package/src/__tests__/score/evidence-scoring.test.ts +249 -0
- package/src/__tests__/score/evidence.test.ts +144 -0
- package/src/__tests__/score/scoring-integration.test.ts +56 -34
- package/src/__tests__/score/taint-adjustments.test.ts +14 -228
- package/src/__tests__/snapshots/__snapshots__/scan-depth.test.ts.snap +65 -59
- package/src/__tests__/snapshots/scan-depth.test.ts +39 -7
- package/src/__tests__/taint/async-flow.test.ts +247 -0
- package/src/__tests__/taint/cfg-builder.test.ts +835 -0
- package/src/__tests__/taint/constant-propagation.test.ts +302 -0
- package/src/__tests__/taint/cross-file-index.test.ts +683 -0
- package/src/__tests__/taint/cross-file-integration.test.ts +275 -0
- package/src/__tests__/taint/cross-file-propagation.test.ts +910 -0
- package/src/__tests__/taint/def-use.test.ts +132 -0
- package/src/__tests__/taint/field-sensitive-sinks.test.ts +179 -0
- package/src/__tests__/taint/field-sensitivity.test.ts +342 -0
- package/src/__tests__/taint/file-analysis-cache.test.ts +290 -0
- package/src/__tests__/taint/framework-models.test.ts +227 -0
- package/src/__tests__/taint/llm-flow-graph.test.ts +850 -0
- package/src/__tests__/taint/llm-risk-scoring.test.ts +439 -0
- package/src/__tests__/taint/performance-parity.test.ts +315 -0
- package/src/__tests__/taint/propagation.test.ts +621 -0
- package/src/__tests__/taint/python-cross-file.test.ts +494 -0
- package/src/__tests__/taint/python-taint.test.ts +1344 -0
- package/src/__tests__/taint/sanitizer-registry.test.ts +304 -0
- package/src/__tests__/taint/sanitizer-regression.test.ts +111 -0
- package/src/__tests__/taint/sink-classifier.test.ts +537 -0
- package/src/__tests__/taint/source-classifier.test.ts +367 -0
- package/src/__tests__/taint/taint-pipeline.test.ts +418 -0
- package/src/__tests__/taint/taint-smoke.test.ts +400 -0
- package/src/__tests__/taint/taint-summary.test.ts +472 -0
- package/src/detect/ai-code/index.ts +6 -11
- package/src/detect/ast-rules/agent-tools-ast.ts +861 -0
- package/src/detect/ast-rules/ai-fingerprinting-ast.ts +451 -0
- package/src/detect/ast-rules/auth-patterns-ast.ts +304 -0
- package/src/detect/ast-rules/byok-ast.ts +195 -0
- package/src/detect/ast-rules/child-process-ast.ts +276 -0
- package/src/detect/ast-rules/dangerous-eval-ast.ts +227 -0
- package/src/detect/ast-rules/data-exposure-ast.ts +162 -0
- package/src/detect/ast-rules/dom-xss-ast.ts +260 -0
- package/src/detect/ast-rules/endpoint-protection-ast.ts +231 -0
- package/src/detect/ast-rules/entropy-ast.ts +268 -0
- package/src/detect/ast-rules/flask-debug-ast.ts +148 -0
- package/src/detect/ast-rules/framework-checks-ast.ts +200 -0
- package/src/detect/ast-rules/helpers/call-analysis.ts +256 -0
- package/src/detect/ast-rules/helpers/context-detection.ts +277 -0
- package/src/detect/ast-rules/helpers/control-flow.ts +179 -0
- package/src/detect/ast-rules/helpers/import-analysis.ts +185 -0
- package/src/detect/ast-rules/helpers/index.ts +133 -0
- package/src/detect/ast-rules/helpers/python-helpers.ts +1054 -0
- package/src/detect/ast-rules/helpers/scope-analysis.ts +224 -0
- package/src/detect/ast-rules/helpers/string-analysis.ts +215 -0
- package/src/detect/ast-rules/helpers/type-extraction.ts +138 -0
- package/src/detect/ast-rules/helpers/user-input.ts +256 -0
- package/src/detect/ast-rules/index.ts +311 -0
- package/src/detect/ast-rules/json-parse-ast.ts +162 -0
- package/src/detect/ast-rules/log-injection-ast.ts +243 -0
- package/src/detect/ast-rules/logic-gates-ast.ts +343 -0
- package/src/detect/ast-rules/mcp-security-ast.ts +808 -0
- package/src/detect/ast-rules/model-supply-chain-ast.ts +202 -0
- package/src/detect/ast-rules/package-hallucination-ast.ts +664 -0
- package/src/detect/ast-rules/prompt-hygiene-ast.ts +329 -0
- package/src/detect/ast-rules/rag-safety-ast.ts +689 -0
- package/src/detect/ast-rules/request-validation-ast.ts +122 -0
- package/src/detect/ast-rules/risky-imports-ast.ts +133 -0
- package/src/detect/ast-rules/schema-validation-ast.ts +244 -0
- package/src/detect/ast-rules/secret-patterns-ast.ts +223 -0
- package/src/detect/ast-rules/security-headers-ast.ts +206 -0
- package/src/detect/ast-rules/sql-injection-ast.ts +614 -0
- package/src/detect/ast-rules/ssrf-ast.ts +601 -0
- package/src/detect/ast-rules/taint-fix-templates.ts +108 -0
- package/src/detect/ast-rules/taint-flow-ast.ts +416 -0
- package/src/detect/ast-rules/variables-ast.ts +446 -0
- package/src/detect/ast-rules/weak-crypto-ast.ts +441 -0
- package/src/detect/ast-rules/xxe-ast.ts +184 -0
- package/src/detect/config/agent-skill-injection.ts +2 -24
- package/src/detect/config/index.ts +1 -0
- package/src/detect/config/osv-check.ts +6 -1
- package/src/detect/config/package-check.ts +6 -1
- package/src/detect/config/rules-file-backdoor.ts +438 -0
- package/src/detect/index.ts +146 -52
- package/src/detect/secrets/config-audit.ts +37 -3
- package/src/detect/secrets/entropy.ts +195 -0
- package/src/detect/secrets/index.ts +7 -16
- package/src/detect/structural/index.ts +23 -566
- package/src/index.ts +7 -0
- package/src/model/auth-helper-detector.ts +1 -7
- package/src/model/import-resolver.ts +104 -0
- package/src/model/imported-auth-detector.ts +1 -1
- package/src/model/index.ts +240 -80
- package/src/model/module-graph.ts +17 -5
- package/src/model/project-context.ts +28 -1
- package/src/model/route-auth-resolver.ts +18 -3
- package/src/model/route-discovery/index.ts +1 -1
- package/src/model/route-discovery/nextjs.ts +1 -1
- package/src/model/route-discovery/python.ts +156 -9
- package/src/model/route-discovery/types.ts +1 -1
- package/src/model/route-discovery/utils.ts +73 -0
- package/src/model/taint-types.ts +1 -6
- package/src/parse/ast.ts +271 -0
- package/src/parse/call-graph.ts +419 -0
- package/src/parse/file-classifier.ts +69 -15
- package/src/parse/node-index.ts +118 -0
- package/src/parse/type-extractor.ts +293 -0
- package/src/pipeline/config.ts +7 -0
- package/src/pipeline/index.ts +464 -199
- package/src/pipeline/modes/incremental.ts +1 -7
- package/src/postprocess/dedup.ts +48 -17
- package/src/report/build-result.ts +57 -29
- package/src/report/formatters/cli-terminal.ts +731 -415
- package/src/report/sanitize.ts +27 -0
- package/src/score/adjustments.ts +113 -40
- package/src/score/confidence.ts +10 -5
- package/src/score/evidence.ts +55 -0
- package/src/score/index.ts +27 -55
- package/src/score/types.ts +4 -0
- package/src/shared/category-filter.ts +12 -0
- package/src/shared/regex-utils.ts +4 -0
- package/src/shared/registry-clients.ts +106 -18
- package/src/shared/rules/__tests__/metadata.test.ts +5 -1
- package/src/shared/rules/metadata.ts +19 -0
- package/src/shared/types.ts +372 -253
- package/src/taint/async-flow.ts +301 -0
- package/src/taint/cfg-builder.ts +1127 -0
- package/src/taint/cfg-types.ts +110 -0
- package/src/taint/constant-propagation.ts +170 -0
- package/src/taint/cross-file-analyzer.ts +118 -0
- package/src/taint/cross-file-index.ts +275 -0
- package/src/taint/def-use.ts +556 -0
- package/src/taint/file-analysis-cache.ts +145 -0
- package/src/taint/framework-models.ts +313 -0
- package/src/taint/helpers.ts +138 -0
- package/src/taint/index.ts +71 -0
- package/src/taint/llm-registry.ts +174 -0
- package/src/taint/llm-risk-scoring.ts +412 -0
- package/src/taint/propagation-types.ts +188 -0
- package/src/taint/propagation.ts +1750 -0
- package/src/taint/sanitizer-registry.ts +490 -0
- package/src/taint/sink-classifier.ts +1402 -0
- package/src/taint/source-classifier.ts +859 -0
- package/src/taint/taint-analyzer.ts +112 -0
- package/src/taint/taint-summary.ts +341 -0
- package/src/taint/types.ts +86 -0
- package/src/validate/clients.ts +3 -2
- package/src/validate/index.ts +89 -53
- package/src/validate/prompts/modules/ai-patterns.ts +16 -0
- package/src/validate/prompts/modules/common.ts +12 -3
- package/src/validate/providers/anthropic.ts +254 -148
- package/src/validate/providers/openai.ts +363 -218
- package/src/validate/request-builder.ts +2 -45
- package/src/validate/types.ts +9 -0
- package/src/validate/utils/path-helpers.ts +2 -2
- package/src/validate/utils/response-parser.ts +32 -3
- package/src/validate/utils/retry.ts +19 -4
- package/dist/ai-context/index.d.ts +0 -6
- package/dist/ai-context/index.d.ts.map +0 -1
- package/dist/ai-context/index.js +0 -13
- package/dist/ai-context/index.js.map +0 -1
- package/dist/ai-context/manager.d.ts +0 -67
- package/dist/ai-context/manager.d.ts.map +0 -1
- package/dist/ai-context/manager.js +0 -104
- package/dist/ai-context/manager.js.map +0 -1
- package/dist/baseline/diff.d.ts +0 -32
- package/dist/baseline/diff.d.ts.map +0 -1
- package/dist/baseline/diff.js +0 -119
- package/dist/baseline/diff.js.map +0 -1
- package/dist/baseline/index.d.ts +0 -9
- package/dist/baseline/index.d.ts.map +0 -1
- package/dist/baseline/index.js +0 -19
- package/dist/baseline/index.js.map +0 -1
- package/dist/baseline/manager.d.ts +0 -67
- package/dist/baseline/manager.d.ts.map +0 -1
- package/dist/baseline/manager.js +0 -180
- package/dist/baseline/manager.js.map +0 -1
- package/dist/baseline/types.d.ts +0 -91
- package/dist/baseline/types.d.ts.map +0 -1
- package/dist/baseline/types.js +0 -12
- package/dist/baseline/types.js.map +0 -1
- package/dist/category-filter.d.ts +0 -125
- package/dist/category-filter.d.ts.map +0 -1
- package/dist/category-filter.js +0 -360
- package/dist/category-filter.js.map +0 -1
- package/dist/detect/ai-code/agent-tools.d.ts +0 -22
- package/dist/detect/ai-code/agent-tools.d.ts.map +0 -1
- package/dist/detect/ai-code/agent-tools.js +0 -1509
- package/dist/detect/ai-code/agent-tools.js.map +0 -1
- package/dist/detect/ai-code/byok-patterns.d.ts +0 -15
- package/dist/detect/ai-code/byok-patterns.d.ts.map +0 -1
- package/dist/detect/ai-code/byok-patterns.js +0 -313
- package/dist/detect/ai-code/byok-patterns.js.map +0 -1
- package/dist/detect/ai-code/endpoint-protection.d.ts +0 -38
- package/dist/detect/ai-code/endpoint-protection.d.ts.map +0 -1
- package/dist/detect/ai-code/endpoint-protection.js +0 -349
- package/dist/detect/ai-code/endpoint-protection.js.map +0 -1
- package/dist/detect/ai-code/execution-sinks.d.ts +0 -21
- package/dist/detect/ai-code/execution-sinks.d.ts.map +0 -1
- package/dist/detect/ai-code/execution-sinks.js +0 -1158
- package/dist/detect/ai-code/execution-sinks.js.map +0 -1
- package/dist/detect/ai-code/fingerprinting.d.ts +0 -10
- package/dist/detect/ai-code/fingerprinting.d.ts.map +0 -1
- package/dist/detect/ai-code/fingerprinting.js +0 -665
- package/dist/detect/ai-code/fingerprinting.js.map +0 -1
- package/dist/detect/ai-code/mcp-security.d.ts +0 -20
- package/dist/detect/ai-code/mcp-security.d.ts.map +0 -1
- package/dist/detect/ai-code/mcp-security.js +0 -880
- package/dist/detect/ai-code/mcp-security.js.map +0 -1
- package/dist/detect/ai-code/model-supply-chain.d.ts +0 -23
- package/dist/detect/ai-code/model-supply-chain.d.ts.map +0 -1
- package/dist/detect/ai-code/model-supply-chain.js +0 -447
- package/dist/detect/ai-code/model-supply-chain.js.map +0 -1
- package/dist/detect/ai-code/package-hallucination.d.ts +0 -22
- package/dist/detect/ai-code/package-hallucination.d.ts.map +0 -1
- package/dist/detect/ai-code/package-hallucination.js +0 -841
- package/dist/detect/ai-code/package-hallucination.js.map +0 -1
- package/dist/detect/ai-code/prompt-hygiene.d.ts +0 -22
- package/dist/detect/ai-code/prompt-hygiene.d.ts.map +0 -1
- package/dist/detect/ai-code/prompt-hygiene.js +0 -1177
- package/dist/detect/ai-code/prompt-hygiene.js.map +0 -1
- package/dist/detect/ai-code/rag-safety.d.ts +0 -24
- package/dist/detect/ai-code/rag-safety.d.ts.map +0 -1
- package/dist/detect/ai-code/rag-safety.js +0 -913
- package/dist/detect/ai-code/rag-safety.js.map +0 -1
- package/dist/detect/ai-code/schema-validation.d.ts +0 -28
- package/dist/detect/ai-code/schema-validation.d.ts.map +0 -1
- package/dist/detect/ai-code/schema-validation.js +0 -378
- package/dist/detect/ai-code/schema-validation.js.map +0 -1
- package/dist/detect/secrets/patterns.d.ts +0 -11
- package/dist/detect/secrets/patterns.d.ts.map +0 -1
- package/dist/detect/secrets/patterns.js +0 -518
- package/dist/detect/secrets/patterns.js.map +0 -1
- package/dist/detect/secrets/weak-crypto.d.ts +0 -10
- package/dist/detect/secrets/weak-crypto.d.ts.map +0 -1
- package/dist/detect/secrets/weak-crypto.js +0 -432
- package/dist/detect/secrets/weak-crypto.js.map +0 -1
- package/dist/detect/structural/auth-patterns.d.ts +0 -22
- package/dist/detect/structural/auth-patterns.d.ts.map +0 -1
- package/dist/detect/structural/auth-patterns.js +0 -533
- package/dist/detect/structural/auth-patterns.js.map +0 -1
- package/dist/detect/structural/dangerous-functions/child-process.d.ts +0 -16
- package/dist/detect/structural/dangerous-functions/child-process.d.ts.map +0 -1
- package/dist/detect/structural/dangerous-functions/child-process.js +0 -74
- package/dist/detect/structural/dangerous-functions/child-process.js.map +0 -1
- package/dist/detect/structural/dangerous-functions/dom-xss.d.ts +0 -34
- package/dist/detect/structural/dangerous-functions/dom-xss.d.ts.map +0 -1
- package/dist/detect/structural/dangerous-functions/dom-xss.js +0 -230
- package/dist/detect/structural/dangerous-functions/dom-xss.js.map +0 -1
- package/dist/detect/structural/dangerous-functions/index.d.ts +0 -16
- package/dist/detect/structural/dangerous-functions/index.d.ts.map +0 -1
- package/dist/detect/structural/dangerous-functions/index.js +0 -1193
- package/dist/detect/structural/dangerous-functions/index.js.map +0 -1
- package/dist/detect/structural/dangerous-functions/json-parse.d.ts +0 -31
- package/dist/detect/structural/dangerous-functions/json-parse.d.ts.map +0 -1
- package/dist/detect/structural/dangerous-functions/json-parse.js +0 -326
- package/dist/detect/structural/dangerous-functions/json-parse.js.map +0 -1
- package/dist/detect/structural/dangerous-functions/math-random.d.ts +0 -111
- package/dist/detect/structural/dangerous-functions/math-random.d.ts.map +0 -1
- package/dist/detect/structural/dangerous-functions/math-random.js +0 -684
- package/dist/detect/structural/dangerous-functions/math-random.js.map +0 -1
- package/dist/detect/structural/dangerous-functions/patterns.d.ts +0 -21
- package/dist/detect/structural/dangerous-functions/patterns.d.ts.map +0 -1
- package/dist/detect/structural/dangerous-functions/patterns.js +0 -163
- package/dist/detect/structural/dangerous-functions/patterns.js.map +0 -1
- package/dist/detect/structural/dangerous-functions/request-validation.d.ts +0 -13
- package/dist/detect/structural/dangerous-functions/request-validation.d.ts.map +0 -1
- package/dist/detect/structural/dangerous-functions/request-validation.js +0 -126
- package/dist/detect/structural/dangerous-functions/request-validation.js.map +0 -1
- package/dist/detect/structural/dangerous-functions/utils/control-flow.d.ts +0 -24
- package/dist/detect/structural/dangerous-functions/utils/control-flow.d.ts.map +0 -1
- package/dist/detect/structural/dangerous-functions/utils/control-flow.js +0 -70
- package/dist/detect/structural/dangerous-functions/utils/control-flow.js.map +0 -1
- package/dist/detect/structural/dangerous-functions/utils/helpers.d.ts +0 -31
- package/dist/detect/structural/dangerous-functions/utils/helpers.d.ts.map +0 -1
- package/dist/detect/structural/dangerous-functions/utils/helpers.js +0 -147
- package/dist/detect/structural/dangerous-functions/utils/helpers.js.map +0 -1
- package/dist/detect/structural/dangerous-functions/utils/index.d.ts +0 -9
- package/dist/detect/structural/dangerous-functions/utils/index.d.ts.map +0 -1
- package/dist/detect/structural/dangerous-functions/utils/index.js +0 -23
- package/dist/detect/structural/dangerous-functions/utils/index.js.map +0 -1
- package/dist/detect/structural/dangerous-functions/utils/schema-validation.d.ts +0 -22
- package/dist/detect/structural/dangerous-functions/utils/schema-validation.d.ts.map +0 -1
- package/dist/detect/structural/dangerous-functions/utils/schema-validation.js +0 -102
- package/dist/detect/structural/dangerous-functions/utils/schema-validation.js.map +0 -1
- package/dist/detect/structural/data-exposure.d.ts +0 -19
- package/dist/detect/structural/data-exposure.d.ts.map +0 -1
- package/dist/detect/structural/data-exposure.js +0 -262
- package/dist/detect/structural/data-exposure.js.map +0 -1
- package/dist/detect/structural/framework-checks.d.ts +0 -10
- package/dist/detect/structural/framework-checks.d.ts.map +0 -1
- package/dist/detect/structural/framework-checks.js +0 -389
- package/dist/detect/structural/framework-checks.js.map +0 -1
- package/dist/detect/structural/log-injection.d.ts +0 -18
- package/dist/detect/structural/log-injection.d.ts.map +0 -1
- package/dist/detect/structural/log-injection.js +0 -217
- package/dist/detect/structural/log-injection.js.map +0 -1
- package/dist/detect/structural/logic-gates.d.ts +0 -10
- package/dist/detect/structural/logic-gates.d.ts.map +0 -1
- package/dist/detect/structural/logic-gates.js +0 -227
- package/dist/detect/structural/logic-gates.js.map +0 -1
- package/dist/detect/structural/risky-imports.d.ts +0 -10
- package/dist/detect/structural/risky-imports.d.ts.map +0 -1
- package/dist/detect/structural/risky-imports.js +0 -168
- package/dist/detect/structural/risky-imports.js.map +0 -1
- package/dist/detect/structural/security-headers.d.ts +0 -18
- package/dist/detect/structural/security-headers.d.ts.map +0 -1
- package/dist/detect/structural/security-headers.js +0 -196
- package/dist/detect/structural/security-headers.js.map +0 -1
- package/dist/detect/structural/ssrf-detection.d.ts +0 -18
- package/dist/detect/structural/ssrf-detection.d.ts.map +0 -1
- package/dist/detect/structural/ssrf-detection.js +0 -263
- package/dist/detect/structural/ssrf-detection.js.map +0 -1
- package/dist/detect/structural/variables.d.ts +0 -11
- package/dist/detect/structural/variables.d.ts.map +0 -1
- package/dist/detect/structural/variables.js +0 -159
- package/dist/detect/structural/variables.js.map +0 -1
- package/dist/detect/structural/xxe-detection.d.ts +0 -18
- package/dist/detect/structural/xxe-detection.d.ts.map +0 -1
- package/dist/detect/structural/xxe-detection.js +0 -245
- package/dist/detect/structural/xxe-detection.js.map +0 -1
- package/dist/filtering/context-adjustments.d.ts +0 -23
- package/dist/filtering/context-adjustments.d.ts.map +0 -1
- package/dist/filtering/context-adjustments.js +0 -100
- package/dist/filtering/context-adjustments.js.map +0 -1
- package/dist/filtering/index.d.ts +0 -3
- package/dist/filtering/index.d.ts.map +0 -1
- package/dist/filtering/index.js +0 -8
- package/dist/filtering/index.js.map +0 -1
- package/dist/filtering/pipeline.d.ts +0 -48
- package/dist/filtering/pipeline.d.ts.map +0 -1
- package/dist/filtering/pipeline.js +0 -76
- package/dist/filtering/pipeline.js.map +0 -1
- package/dist/formatters/ai-context.d.ts +0 -23
- package/dist/formatters/ai-context.d.ts.map +0 -1
- package/dist/formatters/ai-context.js +0 -238
- package/dist/formatters/ai-context.js.map +0 -1
- package/dist/formatters/cli-terminal.d.ts +0 -65
- package/dist/formatters/cli-terminal.d.ts.map +0 -1
- package/dist/formatters/cli-terminal.js +0 -735
- package/dist/formatters/cli-terminal.js.map +0 -1
- package/dist/formatters/github-comment.d.ts +0 -41
- package/dist/formatters/github-comment.d.ts.map +0 -1
- package/dist/formatters/github-comment.js +0 -370
- package/dist/formatters/github-comment.js.map +0 -1
- package/dist/formatters/grouping.d.ts +0 -52
- package/dist/formatters/grouping.d.ts.map +0 -1
- package/dist/formatters/grouping.js +0 -152
- package/dist/formatters/grouping.js.map +0 -1
- package/dist/formatters/ide/claude-code.d.ts +0 -17
- package/dist/formatters/ide/claude-code.d.ts.map +0 -1
- package/dist/formatters/ide/claude-code.js +0 -94
- package/dist/formatters/ide/claude-code.js.map +0 -1
- package/dist/formatters/ide/cursor.d.ts +0 -13
- package/dist/formatters/ide/cursor.d.ts.map +0 -1
- package/dist/formatters/ide/cursor.js +0 -125
- package/dist/formatters/ide/cursor.js.map +0 -1
- package/dist/formatters/ide/index.d.ts +0 -62
- package/dist/formatters/ide/index.d.ts.map +0 -1
- package/dist/formatters/ide/index.js +0 -184
- package/dist/formatters/ide/index.js.map +0 -1
- package/dist/formatters/ide/windsurf.d.ts +0 -13
- package/dist/formatters/ide/windsurf.d.ts.map +0 -1
- package/dist/formatters/ide/windsurf.js +0 -117
- package/dist/formatters/ide/windsurf.js.map +0 -1
- package/dist/formatters/index.d.ts +0 -11
- package/dist/formatters/index.d.ts.map +0 -1
- package/dist/formatters/index.js +0 -54
- package/dist/formatters/index.js.map +0 -1
- package/dist/formatters/vscode-diagnostic.d.ts +0 -103
- package/dist/formatters/vscode-diagnostic.d.ts.map +0 -1
- package/dist/formatters/vscode-diagnostic.js +0 -151
- package/dist/formatters/vscode-diagnostic.js.map +0 -1
- package/dist/layer1/comments.d.ts +0 -11
- package/dist/layer1/comments.d.ts.map +0 -1
- package/dist/layer1/comments.js +0 -203
- package/dist/layer1/comments.js.map +0 -1
- package/dist/layer1/config-audit.d.ts +0 -11
- package/dist/layer1/config-audit.d.ts.map +0 -1
- package/dist/layer1/config-audit.js +0 -311
- package/dist/layer1/config-audit.js.map +0 -1
- package/dist/layer1/config-mcp-audit.d.ts +0 -23
- package/dist/layer1/config-mcp-audit.d.ts.map +0 -1
- package/dist/layer1/config-mcp-audit.js +0 -239
- package/dist/layer1/config-mcp-audit.js.map +0 -1
- package/dist/layer1/entropy.d.ts +0 -11
- package/dist/layer1/entropy.d.ts.map +0 -1
- package/dist/layer1/entropy.js +0 -741
- package/dist/layer1/entropy.js.map +0 -1
- package/dist/layer1/file-flags.d.ts +0 -10
- package/dist/layer1/file-flags.d.ts.map +0 -1
- package/dist/layer1/file-flags.js +0 -119
- package/dist/layer1/file-flags.js.map +0 -1
- package/dist/layer1/index.d.ts +0 -38
- package/dist/layer1/index.d.ts.map +0 -1
- package/dist/layer1/index.js +0 -170
- package/dist/layer1/index.js.map +0 -1
- package/dist/layer1/patterns.d.ts +0 -11
- package/dist/layer1/patterns.d.ts.map +0 -1
- package/dist/layer1/patterns.js +0 -512
- package/dist/layer1/patterns.js.map +0 -1
- package/dist/layer1/urls.d.ts +0 -11
- package/dist/layer1/urls.d.ts.map +0 -1
- package/dist/layer1/urls.js +0 -444
- package/dist/layer1/urls.js.map +0 -1
- package/dist/layer1/weak-crypto.d.ts +0 -10
- package/dist/layer1/weak-crypto.d.ts.map +0 -1
- package/dist/layer1/weak-crypto.js +0 -428
- package/dist/layer1/weak-crypto.js.map +0 -1
- package/dist/layer2/ai-agent-tools.d.ts +0 -22
- package/dist/layer2/ai-agent-tools.d.ts.map +0 -1
- package/dist/layer2/ai-agent-tools.js +0 -1490
- package/dist/layer2/ai-agent-tools.js.map +0 -1
- package/dist/layer2/ai-endpoint-protection.d.ts +0 -38
- package/dist/layer2/ai-endpoint-protection.d.ts.map +0 -1
- package/dist/layer2/ai-endpoint-protection.js +0 -346
- package/dist/layer2/ai-endpoint-protection.js.map +0 -1
- package/dist/layer2/ai-execution-sinks.d.ts +0 -21
- package/dist/layer2/ai-execution-sinks.d.ts.map +0 -1
- package/dist/layer2/ai-execution-sinks.js +0 -1155
- package/dist/layer2/ai-execution-sinks.js.map +0 -1
- package/dist/layer2/ai-fingerprinting.d.ts +0 -10
- package/dist/layer2/ai-fingerprinting.d.ts.map +0 -1
- package/dist/layer2/ai-fingerprinting.js +0 -650
- package/dist/layer2/ai-fingerprinting.js.map +0 -1
- package/dist/layer2/ai-mcp-security.d.ts +0 -20
- package/dist/layer2/ai-mcp-security.d.ts.map +0 -1
- package/dist/layer2/ai-mcp-security.js +0 -877
- package/dist/layer2/ai-mcp-security.js.map +0 -1
- package/dist/layer2/ai-package-hallucination.d.ts +0 -22
- package/dist/layer2/ai-package-hallucination.d.ts.map +0 -1
- package/dist/layer2/ai-package-hallucination.js +0 -828
- package/dist/layer2/ai-package-hallucination.js.map +0 -1
- package/dist/layer2/ai-prompt-hygiene.d.ts +0 -22
- package/dist/layer2/ai-prompt-hygiene.d.ts.map +0 -1
- package/dist/layer2/ai-prompt-hygiene.js +0 -1156
- package/dist/layer2/ai-prompt-hygiene.js.map +0 -1
- package/dist/layer2/ai-rag-safety.d.ts +0 -24
- package/dist/layer2/ai-rag-safety.d.ts.map +0 -1
- package/dist/layer2/ai-rag-safety.js +0 -910
- package/dist/layer2/ai-rag-safety.js.map +0 -1
- package/dist/layer2/ai-schema-validation.d.ts +0 -28
- package/dist/layer2/ai-schema-validation.d.ts.map +0 -1
- package/dist/layer2/ai-schema-validation.js +0 -375
- package/dist/layer2/ai-schema-validation.js.map +0 -1
- package/dist/layer2/auth-antipatterns.d.ts +0 -22
- package/dist/layer2/auth-antipatterns.d.ts.map +0 -1
- package/dist/layer2/auth-antipatterns.js +0 -522
- package/dist/layer2/auth-antipatterns.js.map +0 -1
- package/dist/layer2/byok-patterns.d.ts +0 -15
- package/dist/layer2/byok-patterns.d.ts.map +0 -1
- package/dist/layer2/byok-patterns.js +0 -302
- package/dist/layer2/byok-patterns.js.map +0 -1
- package/dist/layer2/dangerous-functions/child-process.d.ts +0 -16
- package/dist/layer2/dangerous-functions/child-process.d.ts.map +0 -1
- package/dist/layer2/dangerous-functions/child-process.js +0 -74
- package/dist/layer2/dangerous-functions/child-process.js.map +0 -1
- package/dist/layer2/dangerous-functions/dom-xss.d.ts +0 -34
- package/dist/layer2/dangerous-functions/dom-xss.d.ts.map +0 -1
- package/dist/layer2/dangerous-functions/dom-xss.js +0 -230
- package/dist/layer2/dangerous-functions/dom-xss.js.map +0 -1
- package/dist/layer2/dangerous-functions/index.d.ts +0 -16
- package/dist/layer2/dangerous-functions/index.d.ts.map +0 -1
- package/dist/layer2/dangerous-functions/index.js +0 -1152
- package/dist/layer2/dangerous-functions/index.js.map +0 -1
- package/dist/layer2/dangerous-functions/json-parse.d.ts +0 -31
- package/dist/layer2/dangerous-functions/json-parse.d.ts.map +0 -1
- package/dist/layer2/dangerous-functions/json-parse.js +0 -319
- package/dist/layer2/dangerous-functions/json-parse.js.map +0 -1
- package/dist/layer2/dangerous-functions/math-random.d.ts +0 -111
- package/dist/layer2/dangerous-functions/math-random.d.ts.map +0 -1
- package/dist/layer2/dangerous-functions/math-random.js +0 -684
- package/dist/layer2/dangerous-functions/math-random.js.map +0 -1
- package/dist/layer2/dangerous-functions/patterns.d.ts +0 -21
- package/dist/layer2/dangerous-functions/patterns.d.ts.map +0 -1
- package/dist/layer2/dangerous-functions/patterns.js +0 -163
- package/dist/layer2/dangerous-functions/patterns.js.map +0 -1
- package/dist/layer2/dangerous-functions/request-validation.d.ts +0 -13
- package/dist/layer2/dangerous-functions/request-validation.d.ts.map +0 -1
- package/dist/layer2/dangerous-functions/request-validation.js +0 -119
- package/dist/layer2/dangerous-functions/request-validation.js.map +0 -1
- package/dist/layer2/dangerous-functions/utils/control-flow.d.ts +0 -24
- package/dist/layer2/dangerous-functions/utils/control-flow.d.ts.map +0 -1
- package/dist/layer2/dangerous-functions/utils/control-flow.js +0 -70
- package/dist/layer2/dangerous-functions/utils/control-flow.js.map +0 -1
- package/dist/layer2/dangerous-functions/utils/helpers.d.ts +0 -31
- package/dist/layer2/dangerous-functions/utils/helpers.d.ts.map +0 -1
- package/dist/layer2/dangerous-functions/utils/helpers.js +0 -147
- package/dist/layer2/dangerous-functions/utils/helpers.js.map +0 -1
- package/dist/layer2/dangerous-functions/utils/index.d.ts +0 -9
- package/dist/layer2/dangerous-functions/utils/index.d.ts.map +0 -1
- package/dist/layer2/dangerous-functions/utils/index.js +0 -23
- package/dist/layer2/dangerous-functions/utils/index.js.map +0 -1
- package/dist/layer2/dangerous-functions/utils/schema-validation.d.ts +0 -22
- package/dist/layer2/dangerous-functions/utils/schema-validation.d.ts.map +0 -1
- package/dist/layer2/dangerous-functions/utils/schema-validation.js +0 -102
- package/dist/layer2/dangerous-functions/utils/schema-validation.js.map +0 -1
- package/dist/layer2/data-exposure.d.ts +0 -19
- package/dist/layer2/data-exposure.d.ts.map +0 -1
- package/dist/layer2/data-exposure.js +0 -255
- package/dist/layer2/data-exposure.js.map +0 -1
- package/dist/layer2/framework-checks.d.ts +0 -10
- package/dist/layer2/framework-checks.d.ts.map +0 -1
- package/dist/layer2/framework-checks.js +0 -384
- package/dist/layer2/framework-checks.js.map +0 -1
- package/dist/layer2/index.d.ts +0 -74
- package/dist/layer2/index.d.ts.map +0 -1
- package/dist/layer2/index.js +0 -544
- package/dist/layer2/index.js.map +0 -1
- package/dist/layer2/log-injection.d.ts +0 -18
- package/dist/layer2/log-injection.d.ts.map +0 -1
- package/dist/layer2/log-injection.js +0 -214
- package/dist/layer2/log-injection.js.map +0 -1
- package/dist/layer2/logic-gates.d.ts +0 -10
- package/dist/layer2/logic-gates.d.ts.map +0 -1
- package/dist/layer2/logic-gates.js +0 -220
- package/dist/layer2/logic-gates.js.map +0 -1
- package/dist/layer2/model-supply-chain.d.ts +0 -23
- package/dist/layer2/model-supply-chain.d.ts.map +0 -1
- package/dist/layer2/model-supply-chain.js +0 -444
- package/dist/layer2/model-supply-chain.js.map +0 -1
- package/dist/layer2/risky-imports.d.ts +0 -10
- package/dist/layer2/risky-imports.d.ts.map +0 -1
- package/dist/layer2/risky-imports.js +0 -165
- package/dist/layer2/risky-imports.js.map +0 -1
- package/dist/layer2/security-headers.d.ts +0 -18
- package/dist/layer2/security-headers.d.ts.map +0 -1
- package/dist/layer2/security-headers.js +0 -187
- package/dist/layer2/security-headers.js.map +0 -1
- package/dist/layer2/ssrf-detection.d.ts +0 -18
- package/dist/layer2/ssrf-detection.d.ts.map +0 -1
- package/dist/layer2/ssrf-detection.js +0 -252
- package/dist/layer2/ssrf-detection.js.map +0 -1
- package/dist/layer2/variables.d.ts +0 -11
- package/dist/layer2/variables.d.ts.map +0 -1
- package/dist/layer2/variables.js +0 -156
- package/dist/layer2/variables.js.map +0 -1
- package/dist/layer2/xxe-detection.d.ts +0 -18
- package/dist/layer2/xxe-detection.d.ts.map +0 -1
- package/dist/layer2/xxe-detection.js +0 -242
- package/dist/layer2/xxe-detection.js.map +0 -1
- package/dist/layer3/anthropic/auto-dismiss.d.ts +0 -24
- package/dist/layer3/anthropic/auto-dismiss.d.ts.map +0 -1
- package/dist/layer3/anthropic/auto-dismiss.js +0 -199
- package/dist/layer3/anthropic/auto-dismiss.js.map +0 -1
- package/dist/layer3/anthropic/clients.d.ts +0 -44
- package/dist/layer3/anthropic/clients.d.ts.map +0 -1
- package/dist/layer3/anthropic/clients.js +0 -81
- package/dist/layer3/anthropic/clients.js.map +0 -1
- package/dist/layer3/anthropic/index.d.ts +0 -41
- package/dist/layer3/anthropic/index.d.ts.map +0 -1
- package/dist/layer3/anthropic/index.js +0 -141
- package/dist/layer3/anthropic/index.js.map +0 -1
- package/dist/layer3/anthropic/prompts/index.d.ts +0 -8
- package/dist/layer3/anthropic/prompts/index.d.ts.map +0 -1
- package/dist/layer3/anthropic/prompts/index.js +0 -16
- package/dist/layer3/anthropic/prompts/index.js.map +0 -1
- package/dist/layer3/anthropic/prompts/modules/ai-patterns.d.ts +0 -19
- package/dist/layer3/anthropic/prompts/modules/ai-patterns.d.ts.map +0 -1
- package/dist/layer3/anthropic/prompts/modules/ai-patterns.js +0 -156
- package/dist/layer3/anthropic/prompts/modules/ai-patterns.js.map +0 -1
- package/dist/layer3/anthropic/prompts/modules/auth-access.d.ts +0 -9
- package/dist/layer3/anthropic/prompts/modules/auth-access.d.ts.map +0 -1
- package/dist/layer3/anthropic/prompts/modules/auth-access.js +0 -25
- package/dist/layer3/anthropic/prompts/modules/auth-access.js.map +0 -1
- package/dist/layer3/anthropic/prompts/modules/common.d.ts +0 -11
- package/dist/layer3/anthropic/prompts/modules/common.d.ts.map +0 -1
- package/dist/layer3/anthropic/prompts/modules/common.js +0 -152
- package/dist/layer3/anthropic/prompts/modules/common.js.map +0 -1
- package/dist/layer3/anthropic/prompts/modules/index.d.ts +0 -54
- package/dist/layer3/anthropic/prompts/modules/index.d.ts.map +0 -1
- package/dist/layer3/anthropic/prompts/modules/index.js +0 -185
- package/dist/layer3/anthropic/prompts/modules/index.js.map +0 -1
- package/dist/layer3/anthropic/prompts/modules/owasp-classic.d.ts +0 -8
- package/dist/layer3/anthropic/prompts/modules/owasp-classic.d.ts.map +0 -1
- package/dist/layer3/anthropic/prompts/modules/owasp-classic.js +0 -84
- package/dist/layer3/anthropic/prompts/modules/owasp-classic.js.map +0 -1
- package/dist/layer3/anthropic/prompts/modules/secrets-crypto.d.ts +0 -8
- package/dist/layer3/anthropic/prompts/modules/secrets-crypto.d.ts.map +0 -1
- package/dist/layer3/anthropic/prompts/modules/secrets-crypto.js +0 -68
- package/dist/layer3/anthropic/prompts/modules/secrets-crypto.js.map +0 -1
- package/dist/layer3/anthropic/prompts/modules/xss-prompt.d.ts +0 -8
- package/dist/layer3/anthropic/prompts/modules/xss-prompt.d.ts.map +0 -1
- package/dist/layer3/anthropic/prompts/modules/xss-prompt.js +0 -22
- package/dist/layer3/anthropic/prompts/modules/xss-prompt.js.map +0 -1
- package/dist/layer3/anthropic/prompts/semantic-analysis.d.ts +0 -15
- package/dist/layer3/anthropic/prompts/semantic-analysis.d.ts.map +0 -1
- package/dist/layer3/anthropic/prompts/semantic-analysis.js +0 -169
- package/dist/layer3/anthropic/prompts/semantic-analysis.js.map +0 -1
- package/dist/layer3/anthropic/prompts/validation.d.ts +0 -18
- package/dist/layer3/anthropic/prompts/validation.d.ts.map +0 -1
- package/dist/layer3/anthropic/prompts/validation.js +0 -25
- package/dist/layer3/anthropic/prompts/validation.js.map +0 -1
- package/dist/layer3/anthropic/providers/anthropic.d.ts +0 -21
- package/dist/layer3/anthropic/providers/anthropic.d.ts.map +0 -1
- package/dist/layer3/anthropic/providers/anthropic.js +0 -269
- package/dist/layer3/anthropic/providers/anthropic.js.map +0 -1
- package/dist/layer3/anthropic/providers/index.d.ts +0 -8
- package/dist/layer3/anthropic/providers/index.d.ts.map +0 -1
- package/dist/layer3/anthropic/providers/index.js +0 -15
- package/dist/layer3/anthropic/providers/index.js.map +0 -1
- package/dist/layer3/anthropic/providers/openai.d.ts +0 -18
- package/dist/layer3/anthropic/providers/openai.d.ts.map +0 -1
- package/dist/layer3/anthropic/providers/openai.js +0 -343
- package/dist/layer3/anthropic/providers/openai.js.map +0 -1
- package/dist/layer3/anthropic/request-builder.d.ts +0 -27
- package/dist/layer3/anthropic/request-builder.d.ts.map +0 -1
- package/dist/layer3/anthropic/request-builder.js +0 -150
- package/dist/layer3/anthropic/request-builder.js.map +0 -1
- package/dist/layer3/anthropic/types.d.ts +0 -88
- package/dist/layer3/anthropic/types.d.ts.map +0 -1
- package/dist/layer3/anthropic/types.js +0 -38
- package/dist/layer3/anthropic/types.js.map +0 -1
- package/dist/layer3/anthropic/utils/context-extractor.d.ts +0 -55
- package/dist/layer3/anthropic/utils/context-extractor.d.ts.map +0 -1
- package/dist/layer3/anthropic/utils/context-extractor.js +0 -161
- package/dist/layer3/anthropic/utils/context-extractor.js.map +0 -1
- package/dist/layer3/anthropic/utils/index.d.ts +0 -11
- package/dist/layer3/anthropic/utils/index.d.ts.map +0 -1
- package/dist/layer3/anthropic/utils/index.js +0 -27
- package/dist/layer3/anthropic/utils/index.js.map +0 -1
- package/dist/layer3/anthropic/utils/path-helpers.d.ts +0 -21
- package/dist/layer3/anthropic/utils/path-helpers.d.ts.map +0 -1
- package/dist/layer3/anthropic/utils/path-helpers.js +0 -69
- package/dist/layer3/anthropic/utils/path-helpers.js.map +0 -1
- package/dist/layer3/anthropic/utils/response-parser.d.ts +0 -40
- package/dist/layer3/anthropic/utils/response-parser.d.ts.map +0 -1
- package/dist/layer3/anthropic/utils/response-parser.js +0 -285
- package/dist/layer3/anthropic/utils/response-parser.js.map +0 -1
- package/dist/layer3/anthropic/utils/retry.d.ts +0 -15
- package/dist/layer3/anthropic/utils/retry.d.ts.map +0 -1
- package/dist/layer3/anthropic/utils/retry.js +0 -62
- package/dist/layer3/anthropic/utils/retry.js.map +0 -1
- package/dist/layer3/index.d.ts +0 -27
- package/dist/layer3/index.d.ts.map +0 -1
- package/dist/layer3/index.js +0 -150
- package/dist/layer3/index.js.map +0 -1
- package/dist/layer3/osv-check.d.ts +0 -75
- package/dist/layer3/osv-check.d.ts.map +0 -1
- package/dist/layer3/osv-check.js +0 -308
- package/dist/layer3/osv-check.js.map +0 -1
- package/dist/layer3/package-check.d.ts +0 -63
- package/dist/layer3/package-check.d.ts.map +0 -1
- package/dist/layer3/package-check.js +0 -508
- package/dist/layer3/package-check.js.map +0 -1
- package/dist/model/cross-file-taint.d.ts +0 -40
- package/dist/model/cross-file-taint.d.ts.map +0 -1
- package/dist/model/cross-file-taint.js +0 -290
- package/dist/model/cross-file-taint.js.map +0 -1
- package/dist/model/function-classifier.d.ts +0 -32
- package/dist/model/function-classifier.d.ts.map +0 -1
- package/dist/model/function-classifier.js +0 -143
- package/dist/model/function-classifier.js.map +0 -1
- package/dist/model/sanitiser-detection.d.ts +0 -27
- package/dist/model/sanitiser-detection.d.ts.map +0 -1
- package/dist/model/sanitiser-detection.js +0 -224
- package/dist/model/sanitiser-detection.js.map +0 -1
- package/dist/model/sink-matcher.d.ts +0 -17
- package/dist/model/sink-matcher.d.ts.map +0 -1
- package/dist/model/sink-matcher.js +0 -141
- package/dist/model/sink-matcher.js.map +0 -1
- package/dist/model/sink-patterns.d.ts +0 -19
- package/dist/model/sink-patterns.d.ts.map +0 -1
- package/dist/model/sink-patterns.js +0 -88
- package/dist/model/sink-patterns.js.map +0 -1
- package/dist/model/source-discovery.d.ts +0 -15
- package/dist/model/source-discovery.d.ts.map +0 -1
- package/dist/model/source-discovery.js +0 -170
- package/dist/model/source-discovery.js.map +0 -1
- package/dist/model/taint-tracker.d.ts +0 -21
- package/dist/model/taint-tracker.d.ts.map +0 -1
- package/dist/model/taint-tracker.js +0 -281
- package/dist/model/taint-tracker.js.map +0 -1
- package/dist/modes/incremental.d.ts +0 -66
- package/dist/modes/incremental.d.ts.map +0 -1
- package/dist/modes/incremental.js +0 -200
- package/dist/modes/incremental.js.map +0 -1
- package/dist/rules/framework-fixes.d.ts +0 -48
- package/dist/rules/framework-fixes.d.ts.map +0 -1
- package/dist/rules/framework-fixes.js +0 -439
- package/dist/rules/framework-fixes.js.map +0 -1
- package/dist/rules/index.d.ts +0 -8
- package/dist/rules/index.d.ts.map +0 -1
- package/dist/rules/index.js +0 -18
- package/dist/rules/index.js.map +0 -1
- package/dist/rules/metadata.d.ts +0 -43
- package/dist/rules/metadata.d.ts.map +0 -1
- package/dist/rules/metadata.js +0 -800
- package/dist/rules/metadata.js.map +0 -1
- package/dist/score/auto-dismiss.d.ts +0 -28
- package/dist/score/auto-dismiss.d.ts.map +0 -1
- package/dist/score/auto-dismiss.js +0 -200
- package/dist/score/auto-dismiss.js.map +0 -1
- package/dist/suppression/config-loader.d.ts +0 -74
- package/dist/suppression/config-loader.d.ts.map +0 -1
- package/dist/suppression/config-loader.js +0 -424
- package/dist/suppression/config-loader.js.map +0 -1
- package/dist/suppression/hash.d.ts +0 -48
- package/dist/suppression/hash.d.ts.map +0 -1
- package/dist/suppression/hash.js +0 -88
- package/dist/suppression/hash.js.map +0 -1
- package/dist/suppression/index.d.ts +0 -11
- package/dist/suppression/index.d.ts.map +0 -1
- package/dist/suppression/index.js +0 -39
- package/dist/suppression/index.js.map +0 -1
- package/dist/suppression/inline-parser.d.ts +0 -39
- package/dist/suppression/inline-parser.d.ts.map +0 -1
- package/dist/suppression/inline-parser.js +0 -218
- package/dist/suppression/inline-parser.js.map +0 -1
- package/dist/suppression/manager.d.ts +0 -94
- package/dist/suppression/manager.d.ts.map +0 -1
- package/dist/suppression/manager.js +0 -292
- package/dist/suppression/manager.js.map +0 -1
- package/dist/suppression/types.d.ts +0 -151
- package/dist/suppression/types.d.ts.map +0 -1
- package/dist/suppression/types.js +0 -28
- package/dist/suppression/types.js.map +0 -1
- package/dist/types.d.ts +0 -331
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -124
- package/dist/types.js.map +0 -1
- package/dist/utils/auth-helper-detector.d.ts +0 -56
- package/dist/utils/auth-helper-detector.d.ts.map +0 -1
- package/dist/utils/auth-helper-detector.js +0 -360
- package/dist/utils/auth-helper-detector.js.map +0 -1
- package/dist/utils/code-analysis.d.ts +0 -39
- package/dist/utils/code-analysis.d.ts.map +0 -1
- package/dist/utils/code-analysis.js +0 -159
- package/dist/utils/code-analysis.js.map +0 -1
- package/dist/utils/comment-analyzer.d.ts +0 -38
- package/dist/utils/comment-analyzer.d.ts.map +0 -1
- package/dist/utils/comment-analyzer.js +0 -218
- package/dist/utils/comment-analyzer.js.map +0 -1
- package/dist/utils/context-helpers.d.ts +0 -219
- package/dist/utils/context-helpers.d.ts.map +0 -1
- package/dist/utils/context-helpers.js +0 -886
- package/dist/utils/context-helpers.js.map +0 -1
- package/dist/utils/diff-detector.d.ts +0 -53
- package/dist/utils/diff-detector.d.ts.map +0 -1
- package/dist/utils/diff-detector.js +0 -104
- package/dist/utils/diff-detector.js.map +0 -1
- package/dist/utils/diff-parser.d.ts +0 -80
- package/dist/utils/diff-parser.d.ts.map +0 -1
- package/dist/utils/diff-parser.js +0 -202
- package/dist/utils/diff-parser.js.map +0 -1
- package/dist/utils/environment-context.d.ts +0 -76
- package/dist/utils/environment-context.d.ts.map +0 -1
- package/dist/utils/environment-context.js +0 -271
- package/dist/utils/environment-context.js.map +0 -1
- package/dist/utils/imported-auth-detector.d.ts +0 -37
- package/dist/utils/imported-auth-detector.d.ts.map +0 -1
- package/dist/utils/imported-auth-detector.js +0 -251
- package/dist/utils/imported-auth-detector.js.map +0 -1
- package/dist/utils/intent-detector.d.ts +0 -66
- package/dist/utils/intent-detector.d.ts.map +0 -1
- package/dist/utils/intent-detector.js +0 -282
- package/dist/utils/intent-detector.js.map +0 -1
- package/dist/utils/middleware-detector.d.ts +0 -55
- package/dist/utils/middleware-detector.d.ts.map +0 -1
- package/dist/utils/middleware-detector.js +0 -260
- package/dist/utils/middleware-detector.js.map +0 -1
- package/dist/utils/oauth-flow-detector.d.ts +0 -41
- package/dist/utils/oauth-flow-detector.d.ts.map +0 -1
- package/dist/utils/oauth-flow-detector.js +0 -202
- package/dist/utils/oauth-flow-detector.js.map +0 -1
- package/dist/utils/parsed-file.d.ts +0 -51
- package/dist/utils/parsed-file.d.ts.map +0 -1
- package/dist/utils/parsed-file.js +0 -95
- package/dist/utils/parsed-file.js.map +0 -1
- package/dist/utils/path-exclusions.d.ts +0 -55
- package/dist/utils/path-exclusions.d.ts.map +0 -1
- package/dist/utils/path-exclusions.js +0 -224
- package/dist/utils/path-exclusions.js.map +0 -1
- package/dist/utils/project-context-builder.d.ts +0 -119
- package/dist/utils/project-context-builder.d.ts.map +0 -1
- package/dist/utils/project-context-builder.js +0 -534
- package/dist/utils/project-context-builder.js.map +0 -1
- package/dist/utils/registry-clients.d.ts +0 -93
- package/dist/utils/registry-clients.d.ts.map +0 -1
- package/dist/utils/registry-clients.js +0 -273
- package/dist/utils/registry-clients.js.map +0 -1
- package/dist/utils/route-hierarchy.d.ts +0 -50
- package/dist/utils/route-hierarchy.d.ts.map +0 -1
- package/dist/utils/route-hierarchy.js +0 -226
- package/dist/utils/route-hierarchy.js.map +0 -1
- package/dist/utils/schema-semantics.d.ts +0 -45
- package/dist/utils/schema-semantics.d.ts.map +0 -1
- package/dist/utils/schema-semantics.js +0 -193
- package/dist/utils/schema-semantics.js.map +0 -1
- package/dist/utils/trpc-analyzer.d.ts +0 -78
- package/dist/utils/trpc-analyzer.d.ts.map +0 -1
- package/dist/utils/trpc-analyzer.js +0 -297
- package/dist/utils/trpc-analyzer.js.map +0 -1
- package/src/__tests__/context-engine/cross-file-taint.test.ts +0 -284
- package/src/__tests__/context-engine/function-classifier.test.ts +0 -146
- package/src/__tests__/context-engine/integration.test.ts +0 -320
- package/src/__tests__/context-engine/sanitiser-detection.test.ts +0 -187
- package/src/__tests__/context-engine/sink-matcher.test.ts +0 -251
- package/src/__tests__/context-engine/source-discovery.test.ts +0 -186
- package/src/__tests__/context-engine/taint-tracker.test.ts +0 -182
- package/src/__tests__/snapshots/__snapshots__/anthropic-validation-refactor.test.ts.snap +0 -750
- package/src/__tests__/snapshots/__snapshots__/dangerous-functions-refactor.test.ts.snap +0 -555
- package/src/__tests__/snapshots/anthropic-validation-refactor.test.ts +0 -321
- package/src/__tests__/snapshots/dangerous-functions-refactor.test.ts +0 -439
- package/src/detect/ai-code/agent-tools.ts +0 -1662
- package/src/detect/ai-code/byok-patterns.ts +0 -354
- package/src/detect/ai-code/endpoint-protection.ts +0 -406
- package/src/detect/ai-code/execution-sinks.ts +0 -1310
- package/src/detect/ai-code/fingerprinting.ts +0 -774
- package/src/detect/ai-code/mcp-security.ts +0 -937
- package/src/detect/ai-code/model-supply-chain.ts +0 -535
- package/src/detect/ai-code/package-hallucination.ts +0 -955
- package/src/detect/ai-code/prompt-hygiene.ts +0 -1314
- package/src/detect/ai-code/rag-safety.ts +0 -977
- package/src/detect/ai-code/schema-validation.ts +0 -427
- package/src/detect/secrets/patterns.ts +0 -561
- package/src/detect/secrets/weak-crypto.ts +0 -485
- package/src/detect/structural/__tests__/math-random-enhanced.test.ts +0 -405
- package/src/detect/structural/auth-patterns.ts +0 -621
- package/src/detect/structural/dangerous-functions/child-process.ts +0 -98
- package/src/detect/structural/dangerous-functions/dom-xss.ts +0 -292
- package/src/detect/structural/dangerous-functions/index.ts +0 -1556
- package/src/detect/structural/dangerous-functions/json-parse.ts +0 -393
- package/src/detect/structural/dangerous-functions/math-random.ts +0 -789
- package/src/detect/structural/dangerous-functions/patterns.ts +0 -176
- package/src/detect/structural/dangerous-functions/request-validation.ts +0 -153
- package/src/detect/structural/dangerous-functions/utils/control-flow.ts +0 -35
- package/src/detect/structural/dangerous-functions/utils/helpers.ts +0 -170
- package/src/detect/structural/dangerous-functions/utils/index.ts +0 -25
- package/src/detect/structural/dangerous-functions/utils/schema-validation.ts +0 -106
- package/src/detect/structural/data-exposure.ts +0 -302
- package/src/detect/structural/framework-checks.ts +0 -439
- package/src/detect/structural/log-injection.ts +0 -254
- package/src/detect/structural/logic-gates.ts +0 -256
- package/src/detect/structural/risky-imports.ts +0 -197
- package/src/detect/structural/security-headers.ts +0 -231
- package/src/detect/structural/ssrf-detection.ts +0 -300
- package/src/detect/structural/variables.ts +0 -177
- package/src/detect/structural/xxe-detection.ts +0 -295
- package/src/model/cross-file-taint.ts +0 -374
- package/src/model/function-classifier.ts +0 -184
- package/src/model/sanitiser-detection.ts +0 -268
- package/src/model/sink-matcher.ts +0 -178
- package/src/model/sink-patterns.ts +0 -109
- package/src/model/source-discovery.ts +0 -209
- package/src/model/taint-tracker.ts +0 -333
- package/src/score/auto-dismiss.ts +0 -224
|
@@ -3,68 +3,86 @@
|
|
|
3
3
|
* Formats scan results with ANSI colors for terminal output
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
|
|
6
|
+
import * as path from "path";
|
|
7
|
+
import type {
|
|
8
|
+
ScanResult,
|
|
9
|
+
Vulnerability,
|
|
10
|
+
VulnerabilitySeverity,
|
|
11
|
+
} from "../../shared/types";
|
|
12
|
+
import {
|
|
13
|
+
groupByTheme,
|
|
14
|
+
getBlockingIssues,
|
|
15
|
+
GroupedFindings,
|
|
16
|
+
THEME_CONFIG,
|
|
17
|
+
} from "./grouping";
|
|
18
|
+
import { computeFindingHash } from "../../postprocess/suppression/hash";
|
|
19
|
+
import { sanitizeScanResult } from "../sanitize";
|
|
9
20
|
|
|
10
21
|
/**
|
|
11
22
|
* ANSI color codes
|
|
12
23
|
*/
|
|
13
24
|
const colors = {
|
|
14
|
-
reset:
|
|
15
|
-
bold:
|
|
16
|
-
dim:
|
|
17
|
-
underline:
|
|
25
|
+
reset: "\x1b[0m",
|
|
26
|
+
bold: "\x1b[1m",
|
|
27
|
+
dim: "\x1b[2m",
|
|
28
|
+
underline: "\x1b[4m",
|
|
18
29
|
|
|
19
30
|
// Foreground colors
|
|
20
|
-
red:
|
|
21
|
-
green:
|
|
22
|
-
yellow:
|
|
23
|
-
blue:
|
|
24
|
-
magenta:
|
|
25
|
-
cyan:
|
|
26
|
-
white:
|
|
27
|
-
gray:
|
|
31
|
+
red: "\x1b[31m",
|
|
32
|
+
green: "\x1b[32m",
|
|
33
|
+
yellow: "\x1b[33m",
|
|
34
|
+
blue: "\x1b[34m",
|
|
35
|
+
magenta: "\x1b[35m",
|
|
36
|
+
cyan: "\x1b[36m",
|
|
37
|
+
white: "\x1b[37m",
|
|
38
|
+
gray: "\x1b[90m",
|
|
28
39
|
|
|
29
40
|
// Background colors
|
|
30
|
-
bgRed:
|
|
31
|
-
bgYellow:
|
|
32
|
-
bgBlue:
|
|
33
|
-
}
|
|
41
|
+
bgRed: "\x1b[41m",
|
|
42
|
+
bgYellow: "\x1b[43m",
|
|
43
|
+
bgBlue: "\x1b[44m",
|
|
44
|
+
};
|
|
34
45
|
|
|
35
46
|
/**
|
|
36
47
|
* Severity colors and symbols
|
|
37
48
|
*/
|
|
38
|
-
const SEVERITY_STYLE: Record<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
49
|
+
const SEVERITY_STYLE: Record<
|
|
50
|
+
VulnerabilitySeverity,
|
|
51
|
+
{ color: string; symbol: string; label: string }
|
|
52
|
+
> = {
|
|
53
|
+
critical: {
|
|
54
|
+
color: colors.bgRed + colors.white,
|
|
55
|
+
symbol: "●",
|
|
56
|
+
label: "CRITICAL",
|
|
57
|
+
},
|
|
58
|
+
high: { color: colors.red, symbol: "●", label: "HIGH" },
|
|
59
|
+
medium: { color: colors.yellow, symbol: "●", label: "MEDIUM" },
|
|
60
|
+
low: { color: colors.blue, symbol: "○", label: "LOW" },
|
|
61
|
+
info: { color: colors.gray, symbol: "○", label: "INFO" },
|
|
62
|
+
};
|
|
45
63
|
|
|
46
64
|
/**
|
|
47
65
|
* Format colored text
|
|
48
66
|
*/
|
|
49
67
|
function c(color: string, text: string): string {
|
|
50
|
-
return `${color}${text}${colors.reset}
|
|
68
|
+
return `${color}${text}${colors.reset}`;
|
|
51
69
|
}
|
|
52
70
|
|
|
53
71
|
/**
|
|
54
72
|
* Format severity badge
|
|
55
73
|
*/
|
|
56
74
|
function severityBadge(severity: VulnerabilitySeverity): string {
|
|
57
|
-
const style = SEVERITY_STYLE[severity]
|
|
58
|
-
return c(style.color, `${style.symbol} ${style.label}`)
|
|
75
|
+
const style = SEVERITY_STYLE[severity];
|
|
76
|
+
return c(style.color, `${style.symbol} ${style.label}`);
|
|
59
77
|
}
|
|
60
78
|
|
|
61
79
|
/**
|
|
62
80
|
* Format options for single finding
|
|
63
81
|
*/
|
|
64
82
|
interface FormatFindingOptions {
|
|
65
|
-
indent?: string
|
|
66
|
-
compact?: boolean
|
|
67
|
-
verbose?: boolean
|
|
83
|
+
indent?: string;
|
|
84
|
+
compact?: boolean;
|
|
85
|
+
verbose?: boolean;
|
|
68
86
|
}
|
|
69
87
|
|
|
70
88
|
/**
|
|
@@ -73,272 +91,497 @@ interface FormatFindingOptions {
|
|
|
73
91
|
* Compact: Severity + title + location only
|
|
74
92
|
* Verbose: All of the above plus references and validation notes
|
|
75
93
|
*/
|
|
76
|
-
function formatFinding(
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const
|
|
94
|
+
function formatFinding(
|
|
95
|
+
finding: Vulnerability,
|
|
96
|
+
options: FormatFindingOptions = {},
|
|
97
|
+
): string {
|
|
98
|
+
const { indent = " ", compact = false, verbose = false } = options;
|
|
99
|
+
const badge = severityBadge(finding.severity);
|
|
100
|
+
const location = c(colors.cyan, `${finding.filePath}:${finding.lineNumber}`);
|
|
101
|
+
const hash = computeFindingHash(finding);
|
|
81
102
|
|
|
82
103
|
// Compact mode: just severity, title, and location
|
|
83
104
|
if (compact) {
|
|
84
|
-
return `${indent}${badge} ${c(colors.bold, finding.title)} ${location}\n
|
|
105
|
+
return `${indent}${badge} ${c(colors.bold, finding.title)} ${location}\n`;
|
|
85
106
|
}
|
|
86
107
|
|
|
87
108
|
// Default actionable output
|
|
88
|
-
let output = `${indent}${badge} ${c(colors.bold, finding.title)}\n
|
|
89
|
-
output += `${indent} ${location}\n
|
|
90
|
-
output +=
|
|
109
|
+
let output = `${indent}${badge} ${c(colors.bold, finding.title)}\n`;
|
|
110
|
+
output += `${indent} ${location}\n`;
|
|
111
|
+
output += "\n";
|
|
91
112
|
|
|
92
113
|
// Impact (why this matters) - shown by default
|
|
93
114
|
if (finding.impact) {
|
|
94
|
-
output += `${indent} ${c(colors.yellow + colors.bold,
|
|
95
|
-
output +=
|
|
115
|
+
output += `${indent} ${c(colors.yellow + colors.bold, "Impact:")} ${finding.impact}\n`;
|
|
116
|
+
output += "\n";
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Taint flow path — shown for taint-based findings
|
|
120
|
+
if (finding.taintPath && finding.taintPath.steps.length > 0) {
|
|
121
|
+
output += `${indent} ${c(colors.yellow + colors.bold, "Flow:")}\n`;
|
|
122
|
+
for (const step of finding.taintPath.steps) {
|
|
123
|
+
const icon =
|
|
124
|
+
step.stepType === "source"
|
|
125
|
+
? "▶"
|
|
126
|
+
: step.stepType === "sink"
|
|
127
|
+
? "◀"
|
|
128
|
+
: step.stepType === "sanitizer"
|
|
129
|
+
? "✕"
|
|
130
|
+
: "→";
|
|
131
|
+
const lineRef = step.filePath
|
|
132
|
+
? `${step.filePath}:${step.line}`
|
|
133
|
+
: `L${step.line}`;
|
|
134
|
+
const varPart = step.variable ? ` ${c(colors.cyan, step.variable)}` : "";
|
|
135
|
+
output += `${indent} ${c(colors.dim, icon)} ${c(colors.dim, lineRef)}${varPart} ${c(colors.dim, "—")} ${step.description}\n`;
|
|
136
|
+
}
|
|
137
|
+
output += "\n";
|
|
96
138
|
}
|
|
97
139
|
|
|
98
140
|
// Code snippet
|
|
99
141
|
if (finding.lineContent && finding.lineContent.trim()) {
|
|
100
|
-
output += `${indent} ${c(colors.dim,
|
|
101
|
-
output +=
|
|
142
|
+
output += `${indent} ${c(colors.dim, "Code:")} ${c(colors.white, finding.lineContent.trim().substring(0, 80))}${finding.lineContent.trim().length > 80 ? "..." : ""}\n`;
|
|
143
|
+
output += "\n";
|
|
102
144
|
}
|
|
103
145
|
|
|
104
146
|
// Fix steps - shown by default (numbered list)
|
|
105
147
|
if (finding.fixSteps && finding.fixSteps.length > 0) {
|
|
106
|
-
output += `${indent} ${c(colors.green + colors.bold,
|
|
148
|
+
output += `${indent} ${c(colors.green + colors.bold, "Fix:")}\n`;
|
|
107
149
|
finding.fixSteps.forEach((step, i) => {
|
|
108
|
-
output += `${indent} ${c(colors.green, `${i + 1}. ${step}`)}\n
|
|
109
|
-
})
|
|
110
|
-
output +=
|
|
150
|
+
output += `${indent} ${c(colors.green, `${i + 1}. ${step}`)}\n`;
|
|
151
|
+
});
|
|
152
|
+
output += "\n";
|
|
111
153
|
} else if (finding.suggestedFix) {
|
|
112
154
|
// Fallback to legacy suggestedFix field
|
|
113
|
-
output += `${indent} ${c(colors.green, finding.suggestedFix)}\n
|
|
114
|
-
output +=
|
|
155
|
+
output += `${indent} ${c(colors.green, finding.suggestedFix)}\n`;
|
|
156
|
+
output += "\n";
|
|
115
157
|
}
|
|
116
158
|
|
|
117
159
|
// Verbose mode: show additional details
|
|
118
160
|
if (verbose) {
|
|
119
161
|
// Description
|
|
120
|
-
output += `${indent} ${c(colors.dim, finding.description)}\n
|
|
162
|
+
output += `${indent} ${c(colors.dim, finding.description)}\n`;
|
|
121
163
|
|
|
122
164
|
// References (OWASP/CWE links)
|
|
123
165
|
if (finding.references && finding.references.length > 0) {
|
|
124
|
-
output += `${indent} ${c(colors.blue,
|
|
125
|
-
finding.references.forEach(ref => {
|
|
126
|
-
output += `${indent} ${c(colors.blue, ` • ${ref}`)}\n
|
|
127
|
-
})
|
|
166
|
+
output += `${indent} ${c(colors.blue, "References:")}\n`;
|
|
167
|
+
finding.references.forEach((ref) => {
|
|
168
|
+
output += `${indent} ${c(colors.blue, ` • ${ref}`)}\n`;
|
|
169
|
+
});
|
|
128
170
|
}
|
|
129
171
|
|
|
130
172
|
// Validation notes (if AI validated)
|
|
131
173
|
if (finding.validationNotes) {
|
|
132
|
-
output += `${indent} ${c(colors.dim, `[AI] ${finding.validationNotes}`)}\n
|
|
174
|
+
output += `${indent} ${c(colors.dim, `[AI] ${finding.validationNotes}`)}\n`;
|
|
133
175
|
}
|
|
134
176
|
|
|
135
177
|
// AI enhanced indicator
|
|
136
178
|
if (finding.aiEnhanced) {
|
|
137
|
-
output += `${indent} ${c(colors.magenta,
|
|
179
|
+
output += `${indent} ${c(colors.magenta, "[AI] Enhanced fix suggestion")}\n`;
|
|
138
180
|
}
|
|
139
181
|
}
|
|
140
182
|
|
|
141
183
|
// Suppress command - always shown
|
|
142
|
-
output += `${indent} ${c(colors.dim, `Suppress: oculum ignore ${hash} --file "${finding.filePath}:${finding.lineNumber}" --reason "..."`)}\n
|
|
184
|
+
output += `${indent} ${c(colors.dim, `Suppress: oculum ignore ${hash} --file "${finding.filePath}:${finding.lineNumber}" --reason "..."`)}\n`;
|
|
143
185
|
|
|
144
|
-
return output
|
|
186
|
+
return output;
|
|
145
187
|
}
|
|
146
188
|
|
|
147
189
|
/**
|
|
148
190
|
* Format a group of findings
|
|
149
191
|
*/
|
|
150
|
-
function formatGroup(
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
192
|
+
function formatGroup(
|
|
193
|
+
group: GroupedFindings,
|
|
194
|
+
options: {
|
|
195
|
+
maxFindings?: number;
|
|
196
|
+
compact?: boolean;
|
|
197
|
+
verbose?: boolean;
|
|
198
|
+
} = {},
|
|
199
|
+
): string {
|
|
200
|
+
const { maxFindings = 10, compact = false, verbose = false } = options;
|
|
201
|
+
const { theme, themeName, findings, severityCounts } = group;
|
|
202
|
+
const config = THEME_CONFIG[theme];
|
|
158
203
|
|
|
159
204
|
// Count summary
|
|
160
|
-
const counts: string[] = []
|
|
161
|
-
if (severityCounts.critical > 0)
|
|
162
|
-
|
|
163
|
-
if (severityCounts.
|
|
164
|
-
|
|
165
|
-
if (severityCounts.
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
205
|
+
const counts: string[] = [];
|
|
206
|
+
if (severityCounts.critical > 0)
|
|
207
|
+
counts.push(c(colors.red, `${severityCounts.critical} critical`));
|
|
208
|
+
if (severityCounts.high > 0)
|
|
209
|
+
counts.push(c(colors.red, `${severityCounts.high} high`));
|
|
210
|
+
if (severityCounts.medium > 0)
|
|
211
|
+
counts.push(c(colors.yellow, `${severityCounts.medium} medium`));
|
|
212
|
+
if (severityCounts.low > 0)
|
|
213
|
+
counts.push(c(colors.blue, `${severityCounts.low} low`));
|
|
214
|
+
if (severityCounts.info > 0)
|
|
215
|
+
counts.push(c(colors.gray, `${severityCounts.info} info`));
|
|
216
|
+
|
|
217
|
+
let output = `\n${c(colors.bold, `${config.icon} ${themeName}`)} (${counts.join(", ")})\n`;
|
|
218
|
+
output += c(colors.dim, "─".repeat(60)) + "\n";
|
|
169
219
|
|
|
170
220
|
// Show findings
|
|
171
|
-
const shown = findings.slice(0, maxFindings)
|
|
221
|
+
const shown = findings.slice(0, maxFindings);
|
|
172
222
|
for (const finding of shown) {
|
|
173
|
-
output += formatFinding(finding, { compact, verbose }) +
|
|
223
|
+
output += formatFinding(finding, { compact, verbose }) + "\n";
|
|
174
224
|
}
|
|
175
225
|
|
|
176
226
|
// Truncation notice
|
|
177
227
|
if (findings.length > maxFindings) {
|
|
178
|
-
output += c(
|
|
228
|
+
output += c(
|
|
229
|
+
colors.dim,
|
|
230
|
+
` ... and ${findings.length - maxFindings} more\n`,
|
|
231
|
+
);
|
|
179
232
|
}
|
|
180
233
|
|
|
181
|
-
return output
|
|
234
|
+
return output;
|
|
182
235
|
}
|
|
183
236
|
|
|
184
237
|
/**
|
|
185
238
|
* Format baseline diff summary
|
|
186
239
|
*/
|
|
187
|
-
function formatDiffSummary(
|
|
188
|
-
|
|
240
|
+
function formatDiffSummary(
|
|
241
|
+
baselineDiff: NonNullable<ScanResult["baselineDiff"]>,
|
|
242
|
+
): string {
|
|
243
|
+
let output = "";
|
|
189
244
|
|
|
190
|
-
output += c(colors.bold,
|
|
191
|
-
output += c(colors.dim,
|
|
192
|
-
output += ` + ${c(colors.yellow, `${baselineDiff.newCount} new`)} findings\n
|
|
193
|
-
output += ` - ${c(colors.green, `${baselineDiff.fixedCount} fixed`)} since baseline\n
|
|
194
|
-
output += ` = ${c(colors.dim, `${baselineDiff.existingCount} existing`)} (in baseline)\n
|
|
195
|
-
output +=
|
|
245
|
+
output += c(colors.bold, "Baseline Comparison") + "\n";
|
|
246
|
+
output += c(colors.dim, "─".repeat(40)) + "\n";
|
|
247
|
+
output += ` + ${c(colors.yellow, `${baselineDiff.newCount} new`)} findings\n`;
|
|
248
|
+
output += ` - ${c(colors.green, `${baselineDiff.fixedCount} fixed`)} since baseline\n`;
|
|
249
|
+
output += ` = ${c(colors.dim, `${baselineDiff.existingCount} existing`)} (in baseline)\n`;
|
|
250
|
+
output += "\n";
|
|
196
251
|
|
|
197
252
|
// Format baseline date
|
|
198
|
-
const baselineDate = new Date(baselineDiff.baselineCreatedAt)
|
|
199
|
-
const dateStr = baselineDate.toLocaleDateString(
|
|
200
|
-
year:
|
|
201
|
-
month:
|
|
202
|
-
day:
|
|
203
|
-
})
|
|
204
|
-
const commitStr = baselineDiff.baselineCommit
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
253
|
+
const baselineDate = new Date(baselineDiff.baselineCreatedAt);
|
|
254
|
+
const dateStr = baselineDate.toLocaleDateString("en-US", {
|
|
255
|
+
year: "numeric",
|
|
256
|
+
month: "short",
|
|
257
|
+
day: "numeric",
|
|
258
|
+
});
|
|
259
|
+
const commitStr = baselineDiff.baselineCommit
|
|
260
|
+
? ` (${baselineDiff.baselineCommit})`
|
|
261
|
+
: "";
|
|
262
|
+
output += c(colors.dim, `Baseline from ${dateStr}${commitStr}`) + "\n\n";
|
|
263
|
+
|
|
264
|
+
return output;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Collapse findings that share the same title|severity|category signature
|
|
269
|
+
* across 3+ distinct files into a single representative entry.
|
|
270
|
+
* Applied at display time only — does not mutate the underlying scan result.
|
|
271
|
+
*/
|
|
272
|
+
function collapseAcrossFiles(findings: Vulnerability[]): Vulnerability[] {
|
|
273
|
+
const bySignature = new Map<string, Vulnerability[]>();
|
|
274
|
+
for (const f of findings) {
|
|
275
|
+
const sig = `${f.title}|${f.severity}|${f.category}`;
|
|
276
|
+
const group = bySignature.get(sig) ?? [];
|
|
277
|
+
group.push(f);
|
|
278
|
+
bySignature.set(sig, group);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
const result: Vulnerability[] = [];
|
|
282
|
+
for (const [, group] of bySignature) {
|
|
283
|
+
const files = [...new Set(group.map((f) => f.filePath))];
|
|
284
|
+
if (files.length >= 3) {
|
|
285
|
+
const first = group[0];
|
|
286
|
+
const fileList = files
|
|
287
|
+
.slice(0, 3)
|
|
288
|
+
.map((f) => path.basename(f))
|
|
289
|
+
.join(", ");
|
|
290
|
+
result.push({
|
|
291
|
+
...first,
|
|
292
|
+
title: `${first.title} (${files.length} routes)`,
|
|
293
|
+
description: `${first.description}\n\nAffects ${files.length} files: ${fileList}${files.length > 3 ? `, ... and ${files.length - 3} more` : ""}`,
|
|
294
|
+
});
|
|
295
|
+
} else {
|
|
296
|
+
result.push(...group);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
return result;
|
|
208
300
|
}
|
|
209
301
|
|
|
210
302
|
/**
|
|
211
303
|
* Format full scan result for terminal
|
|
212
304
|
*/
|
|
213
|
-
export function formatTerminalOutput(
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
305
|
+
export function formatTerminalOutput(
|
|
306
|
+
result: ScanResult,
|
|
307
|
+
options: {
|
|
308
|
+
maxFindingsPerGroup?: number;
|
|
309
|
+
showAllFindings?: boolean;
|
|
310
|
+
noColor?: boolean;
|
|
311
|
+
compact?: boolean;
|
|
312
|
+
verbose?: boolean;
|
|
313
|
+
} = {},
|
|
314
|
+
): string {
|
|
220
315
|
const {
|
|
221
316
|
maxFindingsPerGroup = 10,
|
|
222
317
|
showAllFindings = false,
|
|
223
318
|
compact = false,
|
|
224
319
|
verbose = false,
|
|
225
|
-
} = options
|
|
320
|
+
} = options;
|
|
226
321
|
|
|
227
|
-
const {
|
|
322
|
+
const {
|
|
323
|
+
vulnerabilities,
|
|
324
|
+
severityCounts,
|
|
325
|
+
hasBlockingIssues,
|
|
326
|
+
filesScanned,
|
|
327
|
+
scanDuration,
|
|
328
|
+
baselineDiff,
|
|
329
|
+
} = result;
|
|
228
330
|
|
|
229
|
-
let output =
|
|
331
|
+
let output = "\n";
|
|
230
332
|
|
|
231
333
|
// Header
|
|
232
|
-
output += c(colors.bold,
|
|
233
|
-
output += c(colors.bold,
|
|
234
|
-
output += c(colors.bold,
|
|
334
|
+
output += c(colors.bold, "═".repeat(60)) + "\n";
|
|
335
|
+
output += c(colors.bold, " OCULUM SECURITY SCAN RESULTS") + "\n";
|
|
336
|
+
output += c(colors.bold, "═".repeat(60)) + "\n\n";
|
|
235
337
|
|
|
236
338
|
// Baseline diff summary (if present)
|
|
237
339
|
if (baselineDiff) {
|
|
238
|
-
output += formatDiffSummary(baselineDiff)
|
|
340
|
+
output += formatDiffSummary(baselineDiff);
|
|
239
341
|
}
|
|
240
342
|
|
|
241
343
|
// Status
|
|
242
344
|
if (hasBlockingIssues) {
|
|
243
|
-
const blocking = severityCounts.critical + severityCounts.high
|
|
244
|
-
output +=
|
|
345
|
+
const blocking = severityCounts.critical + severityCounts.high;
|
|
346
|
+
output +=
|
|
347
|
+
c(
|
|
348
|
+
colors.bgRed + colors.white + colors.bold,
|
|
349
|
+
` ! ${blocking} BLOCKING ISSUES FOUND `,
|
|
350
|
+
) + "\n\n";
|
|
245
351
|
} else if (vulnerabilities.length > 0) {
|
|
246
|
-
output +=
|
|
352
|
+
output +=
|
|
353
|
+
c(
|
|
354
|
+
colors.yellow,
|
|
355
|
+
`${vulnerabilities.length} issues found (no blocking issues)`,
|
|
356
|
+
) + "\n\n";
|
|
247
357
|
} else {
|
|
248
|
-
output += c(colors.green,
|
|
249
|
-
output +=
|
|
250
|
-
|
|
358
|
+
output += c(colors.green, "No security issues found!") + "\n\n";
|
|
359
|
+
output +=
|
|
360
|
+
c(
|
|
361
|
+
colors.dim,
|
|
362
|
+
`Scanned ${filesScanned} files in ${(scanDuration / 1000).toFixed(1)}s`,
|
|
363
|
+
) + "\n";
|
|
364
|
+
return output;
|
|
251
365
|
}
|
|
252
366
|
|
|
253
367
|
// Summary counts
|
|
254
|
-
output += c(colors.bold,
|
|
255
|
-
if (severityCounts.critical > 0)
|
|
256
|
-
|
|
257
|
-
if (severityCounts.
|
|
258
|
-
|
|
259
|
-
if (severityCounts.
|
|
260
|
-
|
|
368
|
+
output += c(colors.bold, "Summary:") + "\n";
|
|
369
|
+
if (severityCounts.critical > 0)
|
|
370
|
+
output += ` ${severityBadge("critical")} ${severityCounts.critical}\n`;
|
|
371
|
+
if (severityCounts.high > 0)
|
|
372
|
+
output += ` ${severityBadge("high")} ${severityCounts.high}\n`;
|
|
373
|
+
if (severityCounts.medium > 0)
|
|
374
|
+
output += ` ${severityBadge("medium")} ${severityCounts.medium}\n`;
|
|
375
|
+
if (severityCounts.low > 0)
|
|
376
|
+
output += ` ${severityBadge("low")} ${severityCounts.low}\n`;
|
|
377
|
+
if (severityCounts.info > 0)
|
|
378
|
+
output += ` ${severityBadge("info")} ${severityCounts.info}\n`;
|
|
379
|
+
output += "\n";
|
|
261
380
|
|
|
262
381
|
// Blocking issues first
|
|
263
|
-
const blockingIssues = getBlockingIssues(vulnerabilities)
|
|
382
|
+
const blockingIssues = getBlockingIssues(vulnerabilities);
|
|
383
|
+
const blockingIds = new Set(blockingIssues.map((f) => f.id));
|
|
384
|
+
|
|
264
385
|
if (blockingIssues.length > 0) {
|
|
265
|
-
output +=
|
|
266
|
-
|
|
386
|
+
output +=
|
|
387
|
+
c(colors.bgRed + colors.white + colors.bold, " BLOCKING ISSUES ") + "\n";
|
|
388
|
+
output += c(colors.red, "These must be fixed before merging:") + "\n\n";
|
|
267
389
|
|
|
268
390
|
for (const finding of blockingIssues.slice(0, 10)) {
|
|
269
|
-
output += formatFinding(finding, { compact, verbose })
|
|
270
|
-
output +=
|
|
391
|
+
output += formatFinding(finding, { compact, verbose });
|
|
392
|
+
output += "\n";
|
|
271
393
|
}
|
|
272
394
|
|
|
273
395
|
if (blockingIssues.length > 10) {
|
|
274
|
-
output += c(
|
|
396
|
+
output += c(
|
|
397
|
+
colors.dim,
|
|
398
|
+
` ... and ${blockingIssues.length - 10} more blocking issues\n`,
|
|
399
|
+
);
|
|
275
400
|
}
|
|
276
401
|
|
|
277
|
-
output +=
|
|
402
|
+
output += "\n";
|
|
278
403
|
}
|
|
279
404
|
|
|
280
405
|
// Grouped findings
|
|
281
|
-
const grouped = groupByTheme(vulnerabilities)
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
406
|
+
const grouped = groupByTheme(vulnerabilities);
|
|
407
|
+
|
|
408
|
+
// Check if any groups have non-blocking findings to display
|
|
409
|
+
const hasNonBlockingGroups =
|
|
410
|
+
showAllFindings ||
|
|
411
|
+
grouped.some((group) => {
|
|
412
|
+
const displayFindings = group.findings.filter(
|
|
413
|
+
(f) => !blockingIds.has(f.id),
|
|
414
|
+
);
|
|
415
|
+
return displayFindings.length > 0;
|
|
416
|
+
});
|
|
417
|
+
|
|
418
|
+
if (hasNonBlockingGroups) {
|
|
419
|
+
output += c(colors.bold, "─".repeat(60)) + "\n";
|
|
420
|
+
output += c(colors.bold, "ALL FINDINGS BY CATEGORY") + "\n";
|
|
421
|
+
|
|
422
|
+
for (const group of grouped) {
|
|
423
|
+
const displayFindings = showAllFindings
|
|
424
|
+
? group.findings
|
|
425
|
+
: group.findings.filter((f) => !blockingIds.has(f.id));
|
|
426
|
+
|
|
427
|
+
if (displayFindings.length === 0) continue;
|
|
428
|
+
|
|
429
|
+
const collapsed = collapseAcrossFiles(displayFindings);
|
|
430
|
+
|
|
431
|
+
// Recompute severity counts from the filtered/collapsed findings
|
|
432
|
+
const filteredCounts: Record<string, number> = {
|
|
433
|
+
critical: 0,
|
|
434
|
+
high: 0,
|
|
435
|
+
medium: 0,
|
|
436
|
+
low: 0,
|
|
437
|
+
info: 0,
|
|
438
|
+
};
|
|
439
|
+
for (const f of collapsed)
|
|
440
|
+
filteredCounts[f.severity] = (filteredCounts[f.severity] ?? 0) + 1;
|
|
441
|
+
|
|
442
|
+
output += formatGroup(
|
|
443
|
+
{
|
|
444
|
+
...group,
|
|
445
|
+
findings: collapsed,
|
|
446
|
+
severityCounts: filteredCounts as typeof group.severityCounts,
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
maxFindings: maxFindingsPerGroup,
|
|
450
|
+
compact,
|
|
451
|
+
verbose,
|
|
452
|
+
},
|
|
453
|
+
);
|
|
292
454
|
}
|
|
293
|
-
|
|
294
|
-
output += formatGroup(group, { maxFindings: maxFindingsPerGroup, compact, verbose })
|
|
295
455
|
}
|
|
296
456
|
|
|
297
457
|
// Suppressed findings section (if any)
|
|
298
|
-
if (
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
458
|
+
if (
|
|
459
|
+
result.suppressedVulnerabilities &&
|
|
460
|
+
result.suppressedVulnerabilities.length > 0
|
|
461
|
+
) {
|
|
462
|
+
output += "\n" + c(colors.dim, "─".repeat(60)) + "\n";
|
|
463
|
+
output += c(colors.dim + colors.bold, "SUPPRESSED FINDINGS") + "\n";
|
|
464
|
+
output +=
|
|
465
|
+
c(
|
|
466
|
+
colors.dim,
|
|
467
|
+
`${result.suppressedVulnerabilities.length} findings suppressed`,
|
|
468
|
+
) + "\n\n";
|
|
302
469
|
|
|
303
470
|
for (const suppressed of result.suppressedVulnerabilities.slice(0, 5)) {
|
|
304
|
-
const typeLabel =
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
471
|
+
const typeLabel =
|
|
472
|
+
suppressed.suppressionType === "inline"
|
|
473
|
+
? "inline"
|
|
474
|
+
: suppressed.suppressionType === "config-finding"
|
|
475
|
+
? "config"
|
|
476
|
+
: "rule";
|
|
477
|
+
output +=
|
|
478
|
+
c(
|
|
479
|
+
colors.dim,
|
|
480
|
+
` ${suppressed.hash.slice(0, 8)} ${suppressed.filePath}:${suppressed.lineNumber}`,
|
|
481
|
+
) + "\n";
|
|
482
|
+
output += c(colors.dim, ` ${suppressed.title}`) + "\n";
|
|
483
|
+
output +=
|
|
484
|
+
c(colors.dim, ` [${typeLabel}] ${suppressed.suppressionReason}`) +
|
|
485
|
+
"\n";
|
|
310
486
|
if (suppressed.expires) {
|
|
311
|
-
output += c(colors.dim, ` Expires: ${suppressed.expires}`) +
|
|
487
|
+
output += c(colors.dim, ` Expires: ${suppressed.expires}`) + "\n";
|
|
312
488
|
}
|
|
313
|
-
output +=
|
|
489
|
+
output += "\n";
|
|
314
490
|
}
|
|
315
491
|
|
|
316
492
|
if (result.suppressedVulnerabilities.length > 5) {
|
|
317
|
-
output += c(
|
|
493
|
+
output += c(
|
|
494
|
+
colors.dim,
|
|
495
|
+
` ... and ${result.suppressedVulnerabilities.length - 5} more suppressed\n`,
|
|
496
|
+
);
|
|
318
497
|
}
|
|
319
498
|
}
|
|
320
499
|
|
|
321
500
|
// Suppression stats (if any)
|
|
322
|
-
if (
|
|
501
|
+
if (
|
|
502
|
+
result.suppressionStats &&
|
|
503
|
+
(result.suppressionStats.inlineSuppressed > 0 ||
|
|
323
504
|
result.suppressionStats.configFindingSuppressed > 0 ||
|
|
324
|
-
result.suppressionStats.configRuleSuppressed > 0)
|
|
325
|
-
|
|
326
|
-
const
|
|
327
|
-
|
|
328
|
-
if (stats.
|
|
329
|
-
|
|
330
|
-
if (stats.
|
|
505
|
+
result.suppressionStats.configRuleSuppressed > 0)
|
|
506
|
+
) {
|
|
507
|
+
const stats = result.suppressionStats;
|
|
508
|
+
const parts: string[] = [];
|
|
509
|
+
if (stats.inlineSuppressed > 0)
|
|
510
|
+
parts.push(`${stats.inlineSuppressed} inline`);
|
|
511
|
+
if (stats.configFindingSuppressed > 0)
|
|
512
|
+
parts.push(`${stats.configFindingSuppressed} config`);
|
|
513
|
+
if (stats.configRuleSuppressed > 0)
|
|
514
|
+
parts.push(`${stats.configRuleSuppressed} rule`);
|
|
515
|
+
if (stats.expired > 0) parts.push(`${stats.expired} expired`);
|
|
331
516
|
|
|
332
517
|
if (!result.suppressedVulnerabilities) {
|
|
333
|
-
output +=
|
|
518
|
+
output += "\n" + c(colors.dim, `Suppressed: ${parts.join(", ")}`) + "\n";
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
// For Review section (confidence-suppressed findings eligible for review)
|
|
523
|
+
const MAX_FOR_REVIEW = 5;
|
|
524
|
+
if (result.forReviewFindings && result.forReviewFindings.length > 0) {
|
|
525
|
+
output += "\n" + c(colors.dim, "─".repeat(60)) + "\n";
|
|
526
|
+
output += c(colors.yellow + colors.bold, "FOR REVIEW") + " ";
|
|
527
|
+
output +=
|
|
528
|
+
c(
|
|
529
|
+
colors.dim,
|
|
530
|
+
`(${result.forReviewFindings.length} lower-confidence findings)`,
|
|
531
|
+
) + "\n";
|
|
532
|
+
output +=
|
|
533
|
+
c(colors.dim, "Run with -d verified to AI-validate these findings.") +
|
|
534
|
+
"\n\n";
|
|
535
|
+
|
|
536
|
+
for (const finding of result.forReviewFindings.slice(0, MAX_FOR_REVIEW)) {
|
|
537
|
+
const score = Math.round(finding.confidenceScore * 100);
|
|
538
|
+
output += ` ${severityBadge(finding.severity)} ${finding.title}\n`;
|
|
539
|
+
output +=
|
|
540
|
+
c(colors.dim, ` ${finding.filePath}:${finding.lineNumber}`) + " ";
|
|
541
|
+
output += c(colors.dim, `[${score}%]`) + "\n";
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
if (result.forReviewFindings.length > MAX_FOR_REVIEW) {
|
|
545
|
+
output +=
|
|
546
|
+
c(
|
|
547
|
+
colors.dim,
|
|
548
|
+
`\n ... and ${result.forReviewFindings.length - MAX_FOR_REVIEW} more`,
|
|
549
|
+
) + "\n";
|
|
334
550
|
}
|
|
335
551
|
}
|
|
336
552
|
|
|
553
|
+
// Unvalidated findings notice
|
|
554
|
+
const unvalidatedCount = vulnerabilities.filter(
|
|
555
|
+
(v) => v.validationStatus === "not_validated",
|
|
556
|
+
).length;
|
|
557
|
+
if (unvalidatedCount > 0) {
|
|
558
|
+
output +=
|
|
559
|
+
"\n" +
|
|
560
|
+
c(
|
|
561
|
+
colors.yellow,
|
|
562
|
+
` ⚠ ${unvalidatedCount} finding(s) need AI review (run with --depth verified)`,
|
|
563
|
+
) +
|
|
564
|
+
"\n";
|
|
565
|
+
}
|
|
566
|
+
|
|
337
567
|
// Footer
|
|
338
|
-
output +=
|
|
339
|
-
|
|
568
|
+
output += "\n" + c(colors.dim, "─".repeat(60)) + "\n";
|
|
569
|
+
|
|
570
|
+
// Language breakdown
|
|
571
|
+
if (result.languageStats && Object.keys(result.languageStats).length > 0) {
|
|
572
|
+
const langParts = Object.entries(result.languageStats)
|
|
573
|
+
.sort(([, a], [, b]) => b - a)
|
|
574
|
+
.map(([lang, count]) => `${count} ${lang}`);
|
|
575
|
+
output += c(colors.dim, `Scanned: ${langParts.join(", ")}`) + "\n";
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
output +=
|
|
579
|
+
c(
|
|
580
|
+
colors.dim,
|
|
581
|
+
`Scanned ${filesScanned} files in ${(scanDuration / 1000).toFixed(1)}s`,
|
|
582
|
+
) + "\n";
|
|
340
583
|
|
|
341
|
-
return output
|
|
584
|
+
return output;
|
|
342
585
|
}
|
|
343
586
|
|
|
344
587
|
/**
|
|
@@ -346,13 +589,13 @@ export function formatTerminalOutput(result: ScanResult, options: {
|
|
|
346
589
|
*/
|
|
347
590
|
export interface CompactSummaryOptions {
|
|
348
591
|
/** Number findings for reference with show command */
|
|
349
|
-
showNumbers?: boolean
|
|
592
|
+
showNumbers?: boolean;
|
|
350
593
|
/** Limit shown per severity (default: 5) */
|
|
351
|
-
maxPerSeverity?: number
|
|
594
|
+
maxPerSeverity?: number;
|
|
352
595
|
/** Show "Run oculum show..." hint */
|
|
353
|
-
showHint?: boolean
|
|
596
|
+
showHint?: boolean;
|
|
354
597
|
/** Disable colors */
|
|
355
|
-
noColor?: boolean
|
|
598
|
+
noColor?: boolean;
|
|
356
599
|
}
|
|
357
600
|
|
|
358
601
|
/**
|
|
@@ -364,19 +607,19 @@ export interface CompactSummaryOptions {
|
|
|
364
607
|
*/
|
|
365
608
|
export function formatCompactSummary(
|
|
366
609
|
vulnerabilities: Vulnerability[],
|
|
367
|
-
options: CompactSummaryOptions = {}
|
|
610
|
+
options: CompactSummaryOptions = {},
|
|
368
611
|
): string {
|
|
369
612
|
const {
|
|
370
613
|
showNumbers = true,
|
|
371
614
|
maxPerSeverity = 5,
|
|
372
615
|
showHint = true,
|
|
373
616
|
noColor = false,
|
|
374
|
-
} = options
|
|
617
|
+
} = options;
|
|
375
618
|
|
|
376
619
|
if (vulnerabilities.length === 0) {
|
|
377
620
|
return noColor
|
|
378
|
-
?
|
|
379
|
-
: c(colors.green,
|
|
621
|
+
? "No security issues found."
|
|
622
|
+
: c(colors.green, "No security issues found.");
|
|
380
623
|
}
|
|
381
624
|
|
|
382
625
|
// Group by severity
|
|
@@ -386,82 +629,96 @@ export function formatCompactSummary(
|
|
|
386
629
|
medium: [],
|
|
387
630
|
low: [],
|
|
388
631
|
info: [],
|
|
389
|
-
}
|
|
632
|
+
};
|
|
390
633
|
|
|
391
634
|
for (const v of vulnerabilities) {
|
|
392
|
-
bySeverity[v.severity].push(v)
|
|
635
|
+
bySeverity[v.severity].push(v);
|
|
393
636
|
}
|
|
394
637
|
|
|
395
638
|
// Build output
|
|
396
|
-
let output =
|
|
397
|
-
let globalIndex = 1
|
|
398
|
-
|
|
399
|
-
const severityOrder: VulnerabilitySeverity[] = [
|
|
639
|
+
let output = "";
|
|
640
|
+
let globalIndex = 1;
|
|
641
|
+
|
|
642
|
+
const severityOrder: VulnerabilitySeverity[] = [
|
|
643
|
+
"critical",
|
|
644
|
+
"high",
|
|
645
|
+
"medium",
|
|
646
|
+
"low",
|
|
647
|
+
"info",
|
|
648
|
+
];
|
|
400
649
|
const severityColors: Record<VulnerabilitySeverity, string> = {
|
|
401
650
|
critical: colors.bgRed + colors.white,
|
|
402
651
|
high: colors.red,
|
|
403
652
|
medium: colors.yellow,
|
|
404
653
|
low: colors.blue,
|
|
405
654
|
info: colors.gray,
|
|
406
|
-
}
|
|
655
|
+
};
|
|
407
656
|
|
|
408
657
|
for (const severity of severityOrder) {
|
|
409
|
-
const findings = bySeverity[severity]
|
|
410
|
-
if (findings.length === 0) continue
|
|
658
|
+
const findings = bySeverity[severity];
|
|
659
|
+
if (findings.length === 0) continue;
|
|
411
660
|
|
|
412
661
|
// Severity header
|
|
413
|
-
const label = severity.toUpperCase()
|
|
662
|
+
const label = severity.toUpperCase();
|
|
414
663
|
const header = noColor
|
|
415
664
|
? `${label} (${findings.length})`
|
|
416
|
-
: c(
|
|
417
|
-
|
|
665
|
+
: c(
|
|
666
|
+
severityColors[severity] + colors.bold,
|
|
667
|
+
`${label} (${findings.length})`,
|
|
668
|
+
);
|
|
669
|
+
output += `\n ${header}\n`;
|
|
418
670
|
|
|
419
671
|
// Show findings
|
|
420
|
-
const shown = findings.slice(0, maxPerSeverity)
|
|
672
|
+
const shown = findings.slice(0, maxPerSeverity);
|
|
421
673
|
for (const finding of shown) {
|
|
422
|
-
const num = showNumbers ? `${globalIndex}. ` :
|
|
674
|
+
const num = showNumbers ? `${globalIndex}. ` : "";
|
|
423
675
|
const location = noColor
|
|
424
676
|
? `${finding.filePath}:${finding.lineNumber}`
|
|
425
|
-
: c(colors.cyan, `${finding.filePath}:${finding.lineNumber}`)
|
|
677
|
+
: c(colors.cyan, `${finding.filePath}:${finding.lineNumber}`);
|
|
426
678
|
|
|
427
679
|
output += noColor
|
|
428
680
|
? ` ${num}${finding.title} in ${location}\n`
|
|
429
|
-
: ` ${c(colors.dim, num)}${finding.title} ${c(colors.dim,
|
|
681
|
+
: ` ${c(colors.dim, num)}${finding.title} ${c(colors.dim, "in")} ${location}\n`;
|
|
430
682
|
|
|
431
|
-
globalIndex
|
|
683
|
+
globalIndex++;
|
|
432
684
|
}
|
|
433
685
|
|
|
434
686
|
// Show truncation notice
|
|
435
687
|
if (findings.length > maxPerSeverity) {
|
|
436
|
-
const more = findings.length - maxPerSeverity
|
|
688
|
+
const more = findings.length - maxPerSeverity;
|
|
437
689
|
const truncated = noColor
|
|
438
690
|
? ` ... and ${more} more\n`
|
|
439
|
-
: c(colors.dim, ` ... and ${more} more\n`)
|
|
440
|
-
output += truncated
|
|
441
|
-
globalIndex += more // Increment for hidden findings
|
|
691
|
+
: c(colors.dim, ` ... and ${more} more\n`);
|
|
692
|
+
output += truncated;
|
|
693
|
+
globalIndex += more; // Increment for hidden findings
|
|
442
694
|
}
|
|
443
695
|
}
|
|
444
696
|
|
|
445
697
|
// Hint at bottom
|
|
446
698
|
if (showHint && vulnerabilities.length > 0) {
|
|
447
|
-
output +=
|
|
699
|
+
output += "\n";
|
|
448
700
|
output += noColor
|
|
449
701
|
? "Run 'oculum show 1' for details · 'oculum fix' for suggestions\n"
|
|
450
|
-
: c(
|
|
702
|
+
: c(
|
|
703
|
+
colors.dim,
|
|
704
|
+
"Run 'oculum show 1' for details · 'oculum fix' for suggestions\n",
|
|
705
|
+
);
|
|
451
706
|
}
|
|
452
707
|
|
|
453
|
-
return output
|
|
708
|
+
return output;
|
|
454
709
|
}
|
|
455
710
|
|
|
456
711
|
/**
|
|
457
712
|
* Format a numbered finding list for the show command
|
|
458
713
|
* Returns findings with their numbers for reference
|
|
459
714
|
*/
|
|
460
|
-
export function getNumberedFindings(
|
|
715
|
+
export function getNumberedFindings(
|
|
716
|
+
vulnerabilities: Vulnerability[],
|
|
717
|
+
): Array<{ number: number; finding: Vulnerability }> {
|
|
461
718
|
return vulnerabilities.map((finding, index) => ({
|
|
462
719
|
number: index + 1,
|
|
463
720
|
finding,
|
|
464
|
-
}))
|
|
721
|
+
}));
|
|
465
722
|
}
|
|
466
723
|
|
|
467
724
|
/**
|
|
@@ -470,212 +727,242 @@ export function getNumberedFindings(vulnerabilities: Vulnerability[]): Array<{ n
|
|
|
470
727
|
export function formatFindingDetail(
|
|
471
728
|
finding: Vulnerability,
|
|
472
729
|
number: number,
|
|
473
|
-
options: { verbose?: boolean; noColor?: boolean } = {}
|
|
730
|
+
options: { verbose?: boolean; noColor?: boolean } = {},
|
|
474
731
|
): string {
|
|
475
|
-
const { verbose = false, noColor = false } = options
|
|
732
|
+
const { verbose = false, noColor = false } = options;
|
|
476
733
|
|
|
477
|
-
let output =
|
|
734
|
+
let output = "";
|
|
478
735
|
|
|
479
736
|
// Header
|
|
480
737
|
const badge = noColor
|
|
481
738
|
? `[${finding.severity.toUpperCase()}]`
|
|
482
|
-
: severityBadge(finding.severity)
|
|
483
|
-
const title = noColor ? finding.title : c(colors.bold, finding.title)
|
|
484
|
-
output += `\n#${number} ${badge} ${title}\n
|
|
739
|
+
: severityBadge(finding.severity);
|
|
740
|
+
const title = noColor ? finding.title : c(colors.bold, finding.title);
|
|
741
|
+
output += `\n#${number} ${badge} ${title}\n`;
|
|
485
742
|
|
|
486
743
|
// Location
|
|
487
744
|
const location = noColor
|
|
488
|
-
? finding.filePath +
|
|
489
|
-
: c(colors.cyan, `${finding.filePath}:${finding.lineNumber}`)
|
|
490
|
-
output += ` ${location}\n
|
|
491
|
-
output +=
|
|
745
|
+
? finding.filePath + ":" + finding.lineNumber
|
|
746
|
+
: c(colors.cyan, `${finding.filePath}:${finding.lineNumber}`);
|
|
747
|
+
output += ` ${location}\n`;
|
|
748
|
+
output += "\n";
|
|
492
749
|
|
|
493
750
|
// Impact
|
|
494
751
|
if (finding.impact) {
|
|
495
|
-
const impactLabel = noColor
|
|
496
|
-
|
|
497
|
-
|
|
752
|
+
const impactLabel = noColor
|
|
753
|
+
? "Impact:"
|
|
754
|
+
: c(colors.yellow + colors.bold, "Impact:");
|
|
755
|
+
output += ` ${impactLabel} ${finding.impact}\n`;
|
|
756
|
+
output += "\n";
|
|
498
757
|
}
|
|
499
758
|
|
|
500
759
|
// Code snippet
|
|
501
760
|
if (finding.lineContent && finding.lineContent.trim()) {
|
|
502
|
-
const codeLabel = noColor ?
|
|
503
|
-
const code = finding.lineContent.trim().substring(0, 100)
|
|
504
|
-
const codeText = noColor ? code : c(colors.white, code)
|
|
505
|
-
output += ` ${codeLabel} ${codeText}${finding.lineContent.trim().length > 100 ?
|
|
506
|
-
output +=
|
|
761
|
+
const codeLabel = noColor ? "Code:" : c(colors.dim, "Code:");
|
|
762
|
+
const code = finding.lineContent.trim().substring(0, 100);
|
|
763
|
+
const codeText = noColor ? code : c(colors.white, code);
|
|
764
|
+
output += ` ${codeLabel} ${codeText}${finding.lineContent.trim().length > 100 ? "..." : ""}\n`;
|
|
765
|
+
output += "\n";
|
|
507
766
|
}
|
|
508
767
|
|
|
509
768
|
// Description
|
|
510
769
|
output += noColor
|
|
511
770
|
? ` ${finding.description}\n`
|
|
512
|
-
: ` ${c(colors.dim, finding.description)}\n
|
|
513
|
-
output +=
|
|
771
|
+
: ` ${c(colors.dim, finding.description)}\n`;
|
|
772
|
+
output += "\n";
|
|
514
773
|
|
|
515
774
|
// Fix steps
|
|
516
775
|
if (finding.fixSteps && finding.fixSteps.length > 0) {
|
|
517
|
-
const fixLabel = noColor
|
|
518
|
-
|
|
776
|
+
const fixLabel = noColor
|
|
777
|
+
? "How to fix:"
|
|
778
|
+
: c(colors.green + colors.bold, "How to fix:");
|
|
779
|
+
output += ` ${fixLabel}\n`;
|
|
519
780
|
finding.fixSteps.forEach((step, i) => {
|
|
520
|
-
const stepText = noColor
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
781
|
+
const stepText = noColor
|
|
782
|
+
? `${i + 1}. ${step}`
|
|
783
|
+
: c(colors.green, `${i + 1}. ${step}`);
|
|
784
|
+
output += ` ${stepText}\n`;
|
|
785
|
+
});
|
|
786
|
+
output += "\n";
|
|
524
787
|
} else if (finding.suggestedFix) {
|
|
525
|
-
const fixLabel = noColor
|
|
526
|
-
|
|
527
|
-
|
|
788
|
+
const fixLabel = noColor
|
|
789
|
+
? "Suggested fix:"
|
|
790
|
+
: c(colors.green + colors.bold, "Suggested fix:");
|
|
791
|
+
output += ` ${fixLabel} ${finding.suggestedFix}\n`;
|
|
792
|
+
output += "\n";
|
|
528
793
|
}
|
|
529
794
|
|
|
530
795
|
// Verbose mode: additional details
|
|
531
796
|
if (verbose) {
|
|
532
797
|
// References
|
|
533
798
|
if (finding.references && finding.references.length > 0) {
|
|
534
|
-
const refLabel = noColor ?
|
|
535
|
-
output += ` ${refLabel}\n
|
|
536
|
-
finding.references.forEach(ref => {
|
|
799
|
+
const refLabel = noColor ? "References:" : c(colors.blue, "References:");
|
|
800
|
+
output += ` ${refLabel}\n`;
|
|
801
|
+
finding.references.forEach((ref) => {
|
|
537
802
|
output += noColor
|
|
538
803
|
? ` - ${ref}\n`
|
|
539
|
-
: ` ${c(colors.blue, `- ${ref}`)}\n
|
|
540
|
-
})
|
|
541
|
-
output +=
|
|
804
|
+
: ` ${c(colors.blue, `- ${ref}`)}\n`;
|
|
805
|
+
});
|
|
806
|
+
output += "\n";
|
|
542
807
|
}
|
|
543
808
|
|
|
544
809
|
// Validation notes
|
|
545
810
|
if (finding.validationNotes) {
|
|
546
|
-
const notesLabel = noColor ?
|
|
547
|
-
output += ` ${notesLabel} ${finding.validationNotes}\n
|
|
548
|
-
output +=
|
|
811
|
+
const notesLabel = noColor ? "[AI]" : c(colors.magenta, "[AI]");
|
|
812
|
+
output += ` ${notesLabel} ${finding.validationNotes}\n`;
|
|
813
|
+
output += "\n";
|
|
549
814
|
}
|
|
550
815
|
|
|
551
816
|
// Category and confidence
|
|
552
817
|
output += noColor
|
|
553
|
-
? ` Category: ${finding.category} · Confidence: ${finding.confidence ||
|
|
554
|
-
: c(
|
|
818
|
+
? ` Category: ${finding.category} · Confidence: ${finding.confidence || "medium"} · Layer: ${finding.layer}\n`
|
|
819
|
+
: c(
|
|
820
|
+
colors.dim,
|
|
821
|
+
` Category: ${finding.category} · Confidence: ${finding.confidence || "medium"} · Layer: ${finding.layer}\n`,
|
|
822
|
+
);
|
|
555
823
|
}
|
|
556
824
|
|
|
557
|
-
return output
|
|
825
|
+
return output;
|
|
558
826
|
}
|
|
559
827
|
|
|
560
828
|
/**
|
|
561
829
|
* Format as simple list (no grouping, no colors)
|
|
562
830
|
*/
|
|
563
831
|
export function formatSimpleList(vulnerabilities: Vulnerability[]): string {
|
|
564
|
-
let output =
|
|
832
|
+
let output = "";
|
|
565
833
|
|
|
566
834
|
for (const finding of vulnerabilities) {
|
|
567
|
-
const severity = finding.severity.toUpperCase().padEnd(8)
|
|
568
|
-
output += `[${severity}] ${finding.filePath}:${finding.lineNumber} - ${finding.title}\n
|
|
835
|
+
const severity = finding.severity.toUpperCase().padEnd(8);
|
|
836
|
+
output += `[${severity}] ${finding.filePath}:${finding.lineNumber} - ${finding.title}\n`;
|
|
569
837
|
}
|
|
570
838
|
|
|
571
|
-
return output
|
|
839
|
+
return output;
|
|
572
840
|
}
|
|
573
841
|
|
|
574
842
|
/**
|
|
575
843
|
* Format as JSON (for piping to other tools)
|
|
576
844
|
*/
|
|
577
|
-
export function formatJSON(
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
845
|
+
export function formatJSON(
|
|
846
|
+
result: ScanResult,
|
|
847
|
+
pretty: boolean = false,
|
|
848
|
+
): string {
|
|
849
|
+
const sanitized = sanitizeScanResult(result);
|
|
850
|
+
return pretty
|
|
851
|
+
? JSON.stringify(sanitized, null, 2)
|
|
852
|
+
: JSON.stringify(sanitized);
|
|
582
853
|
}
|
|
583
854
|
|
|
584
855
|
/**
|
|
585
856
|
* Rule metadata for SARIF output
|
|
586
857
|
*/
|
|
587
|
-
const RULE_METADATA: Record<
|
|
858
|
+
const RULE_METADATA: Record<
|
|
859
|
+
string,
|
|
860
|
+
{ name: string; description: string; helpUri: string; tags: string[] }
|
|
861
|
+
> = {
|
|
588
862
|
hardcoded_secret: {
|
|
589
|
-
name:
|
|
590
|
-
description:
|
|
591
|
-
|
|
592
|
-
|
|
863
|
+
name: "Hardcoded Secret",
|
|
864
|
+
description:
|
|
865
|
+
"Sensitive credentials or API keys hardcoded in source code. These can be extracted from version control history or compiled binaries.",
|
|
866
|
+
helpUri: "https://oculum.dev/docs/rules/hardcoded-secrets",
|
|
867
|
+
tags: ["security", "secrets", "credentials"],
|
|
593
868
|
},
|
|
594
869
|
high_entropy_string: {
|
|
595
|
-
name:
|
|
596
|
-
description:
|
|
597
|
-
|
|
598
|
-
|
|
870
|
+
name: "High Entropy String",
|
|
871
|
+
description:
|
|
872
|
+
"A high-entropy string that may be a secret or API key. Review to ensure it is not sensitive data.",
|
|
873
|
+
helpUri: "https://oculum.dev/docs/rules/high-entropy",
|
|
874
|
+
tags: ["security", "secrets"],
|
|
599
875
|
},
|
|
600
876
|
ai_prompt_injection: {
|
|
601
|
-
name:
|
|
602
|
-
description:
|
|
603
|
-
|
|
604
|
-
|
|
877
|
+
name: "AI Prompt Injection",
|
|
878
|
+
description:
|
|
879
|
+
"User input is included in AI prompts without proper sanitization, potentially allowing prompt injection attacks.",
|
|
880
|
+
helpUri: "https://oculum.dev/docs/rules/prompt-injection",
|
|
881
|
+
tags: ["security", "ai", "injection"],
|
|
605
882
|
},
|
|
606
883
|
ai_unsafe_execution: {
|
|
607
|
-
name:
|
|
608
|
-
description:
|
|
609
|
-
|
|
610
|
-
|
|
884
|
+
name: "AI Unsafe Execution",
|
|
885
|
+
description:
|
|
886
|
+
"AI-generated content is used in code execution, SQL queries, or other dangerous sinks without validation.",
|
|
887
|
+
helpUri: "https://oculum.dev/docs/rules/unsafe-execution",
|
|
888
|
+
tags: ["security", "ai", "injection"],
|
|
611
889
|
},
|
|
612
890
|
ai_overpermissive_tool: {
|
|
613
|
-
name:
|
|
614
|
-
description:
|
|
615
|
-
|
|
616
|
-
|
|
891
|
+
name: "AI Overpermissive Tool",
|
|
892
|
+
description:
|
|
893
|
+
"AI agent tool has excessive permissions without proper restrictions or sandboxing.",
|
|
894
|
+
helpUri: "https://oculum.dev/docs/rules/overpermissive-tools",
|
|
895
|
+
tags: ["security", "ai", "authorization"],
|
|
617
896
|
},
|
|
618
897
|
ai_rag_exfiltration: {
|
|
619
|
-
name:
|
|
620
|
-
description:
|
|
621
|
-
|
|
622
|
-
|
|
898
|
+
name: "AI RAG Data Exfiltration",
|
|
899
|
+
description:
|
|
900
|
+
"RAG (Retrieval Augmented Generation) queries may expose data across tenant boundaries or leak sensitive context.",
|
|
901
|
+
helpUri: "https://oculum.dev/docs/rules/rag-exfiltration",
|
|
902
|
+
tags: ["security", "ai", "data-exposure"],
|
|
623
903
|
},
|
|
624
904
|
ai_endpoint_unprotected: {
|
|
625
|
-
name:
|
|
626
|
-
description:
|
|
627
|
-
|
|
628
|
-
|
|
905
|
+
name: "AI Endpoint Unprotected",
|
|
906
|
+
description:
|
|
907
|
+
"AI endpoint lacks authentication or rate limiting, potentially allowing abuse or cost attacks.",
|
|
908
|
+
helpUri: "https://oculum.dev/docs/rules/unprotected-endpoints",
|
|
909
|
+
tags: ["security", "ai", "authentication"],
|
|
629
910
|
},
|
|
630
911
|
ai_schema_mismatch: {
|
|
631
|
-
name:
|
|
632
|
-
description:
|
|
633
|
-
|
|
634
|
-
|
|
912
|
+
name: "AI Schema Validation Missing",
|
|
913
|
+
description:
|
|
914
|
+
"AI-generated output is used without schema validation, potentially allowing malformed or malicious data.",
|
|
915
|
+
helpUri: "https://oculum.dev/docs/rules/schema-validation",
|
|
916
|
+
tags: ["security", "ai", "validation"],
|
|
635
917
|
},
|
|
636
918
|
sql_injection: {
|
|
637
|
-
name:
|
|
638
|
-
description:
|
|
639
|
-
|
|
640
|
-
|
|
919
|
+
name: "SQL Injection",
|
|
920
|
+
description:
|
|
921
|
+
"User input is concatenated into SQL queries without parameterization, allowing SQL injection attacks.",
|
|
922
|
+
helpUri: "https://oculum.dev/docs/rules/sql-injection",
|
|
923
|
+
tags: ["security", "injection", "database"],
|
|
641
924
|
},
|
|
642
925
|
xss: {
|
|
643
|
-
name:
|
|
644
|
-
description:
|
|
645
|
-
|
|
646
|
-
|
|
926
|
+
name: "Cross-Site Scripting (XSS)",
|
|
927
|
+
description:
|
|
928
|
+
"User input is rendered in HTML without proper escaping, allowing script injection.",
|
|
929
|
+
helpUri: "https://oculum.dev/docs/rules/xss",
|
|
930
|
+
tags: ["security", "injection", "web"],
|
|
647
931
|
},
|
|
648
932
|
command_injection: {
|
|
649
|
-
name:
|
|
650
|
-
description:
|
|
651
|
-
|
|
652
|
-
|
|
933
|
+
name: "Command Injection",
|
|
934
|
+
description:
|
|
935
|
+
"User input is passed to shell commands without sanitization, allowing arbitrary command execution.",
|
|
936
|
+
helpUri: "https://oculum.dev/docs/rules/command-injection",
|
|
937
|
+
tags: ["security", "injection", "shell"],
|
|
653
938
|
},
|
|
654
939
|
missing_auth: {
|
|
655
|
-
name:
|
|
656
|
-
description:
|
|
657
|
-
helpUri:
|
|
658
|
-
tags: [
|
|
940
|
+
name: "Missing Authentication",
|
|
941
|
+
description: "Sensitive endpoint or route lacks authentication checks.",
|
|
942
|
+
helpUri: "https://oculum.dev/docs/rules/missing-auth",
|
|
943
|
+
tags: ["security", "authentication"],
|
|
659
944
|
},
|
|
660
945
|
data_exposure: {
|
|
661
|
-
name:
|
|
662
|
-
description:
|
|
663
|
-
|
|
664
|
-
|
|
946
|
+
name: "Data Exposure",
|
|
947
|
+
description:
|
|
948
|
+
"Sensitive data may be exposed through logging, error messages, or API responses.",
|
|
949
|
+
helpUri: "https://oculum.dev/docs/rules/data-exposure",
|
|
950
|
+
tags: ["security", "data-exposure"],
|
|
665
951
|
},
|
|
666
952
|
insecure_config: {
|
|
667
|
-
name:
|
|
668
|
-
description:
|
|
669
|
-
helpUri:
|
|
670
|
-
tags: [
|
|
953
|
+
name: "Insecure Configuration",
|
|
954
|
+
description: "Security-relevant configuration is set to an insecure value.",
|
|
955
|
+
helpUri: "https://oculum.dev/docs/rules/insecure-config",
|
|
956
|
+
tags: ["security", "configuration"],
|
|
671
957
|
},
|
|
672
958
|
dangerous_function: {
|
|
673
|
-
name:
|
|
674
|
-
description:
|
|
675
|
-
|
|
676
|
-
|
|
959
|
+
name: "Dangerous Function",
|
|
960
|
+
description:
|
|
961
|
+
"Use of a function known to be dangerous or deprecated for security reasons.",
|
|
962
|
+
helpUri: "https://oculum.dev/docs/rules/dangerous-functions",
|
|
963
|
+
tags: ["security", "code-quality"],
|
|
677
964
|
},
|
|
678
|
-
}
|
|
965
|
+
};
|
|
679
966
|
|
|
680
967
|
/**
|
|
681
968
|
* Format as SARIF (Static Analysis Results Interchange Format)
|
|
@@ -690,122 +977,144 @@ export function formatSARIF(result: ScanResult): object {
|
|
|
690
977
|
message: {
|
|
691
978
|
text: v.description,
|
|
692
979
|
},
|
|
693
|
-
locations: [
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
980
|
+
locations: [
|
|
981
|
+
{
|
|
982
|
+
physicalLocation: {
|
|
983
|
+
artifactLocation: {
|
|
984
|
+
uri: v.filePath,
|
|
985
|
+
uriBaseId: "%SRCROOT%",
|
|
986
|
+
},
|
|
987
|
+
region: {
|
|
988
|
+
startLine: v.lineNumber,
|
|
989
|
+
startColumn: 1,
|
|
990
|
+
snippet: v.lineContent ? { text: v.lineContent } : undefined,
|
|
991
|
+
},
|
|
703
992
|
},
|
|
704
993
|
},
|
|
705
|
-
|
|
994
|
+
],
|
|
706
995
|
fingerprints: {
|
|
707
|
-
|
|
996
|
+
"oculum/v1": `${v.category}:${v.filePath}:${v.lineNumber}`,
|
|
708
997
|
},
|
|
709
|
-
fixes: v.suggestedFix
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
998
|
+
fixes: v.suggestedFix
|
|
999
|
+
? [
|
|
1000
|
+
{
|
|
1001
|
+
description: {
|
|
1002
|
+
text: v.suggestedFix,
|
|
1003
|
+
},
|
|
1004
|
+
},
|
|
1005
|
+
]
|
|
1006
|
+
: undefined,
|
|
714
1007
|
properties: {
|
|
715
1008
|
confidence: v.confidence,
|
|
716
1009
|
layer: v.layer,
|
|
717
1010
|
},
|
|
718
|
-
}))
|
|
1011
|
+
}));
|
|
719
1012
|
|
|
720
1013
|
// Build results from suppressed vulnerabilities (with SARIF suppression state)
|
|
721
|
-
const suppressedResults = (result.suppressedVulnerabilities || []).map(
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
1014
|
+
const suppressedResults = (result.suppressedVulnerabilities || []).map(
|
|
1015
|
+
(s) => ({
|
|
1016
|
+
ruleId: s.category,
|
|
1017
|
+
ruleIndex: 0, // Will be resolved by GitHub
|
|
1018
|
+
level: mapSeverityToSARIF(s.severity),
|
|
1019
|
+
message: {
|
|
1020
|
+
text: s.title,
|
|
1021
|
+
},
|
|
1022
|
+
locations: [
|
|
1023
|
+
{
|
|
1024
|
+
physicalLocation: {
|
|
1025
|
+
artifactLocation: {
|
|
1026
|
+
uri: s.filePath,
|
|
1027
|
+
uriBaseId: "%SRCROOT%",
|
|
1028
|
+
},
|
|
1029
|
+
region: {
|
|
1030
|
+
startLine: s.lineNumber,
|
|
1031
|
+
startColumn: 1,
|
|
1032
|
+
},
|
|
1033
|
+
},
|
|
733
1034
|
},
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
1035
|
+
],
|
|
1036
|
+
fingerprints: {
|
|
1037
|
+
"oculum/v1": `${s.category}:${s.filePath}:${s.lineNumber}`,
|
|
1038
|
+
"oculum/hash": s.hash,
|
|
1039
|
+
},
|
|
1040
|
+
suppressions: [
|
|
1041
|
+
{
|
|
1042
|
+
kind: s.suppressionType === "inline" ? "inSource" : "external",
|
|
1043
|
+
justification: s.suppressionReason,
|
|
1044
|
+
state: "accepted",
|
|
737
1045
|
},
|
|
1046
|
+
],
|
|
1047
|
+
properties: {
|
|
1048
|
+
suppressionType: s.suppressionType,
|
|
1049
|
+
expires: s.expires,
|
|
738
1050
|
},
|
|
739
|
-
}
|
|
740
|
-
|
|
741
|
-
'oculum/v1': `${s.category}:${s.filePath}:${s.lineNumber}`,
|
|
742
|
-
'oculum/hash': s.hash,
|
|
743
|
-
},
|
|
744
|
-
suppressions: [{
|
|
745
|
-
kind: s.suppressionType === 'inline' ? 'inSource' : 'external',
|
|
746
|
-
justification: s.suppressionReason,
|
|
747
|
-
state: 'accepted',
|
|
748
|
-
}],
|
|
749
|
-
properties: {
|
|
750
|
-
suppressionType: s.suppressionType,
|
|
751
|
-
expires: s.expires,
|
|
752
|
-
},
|
|
753
|
-
}))
|
|
1051
|
+
}),
|
|
1052
|
+
);
|
|
754
1053
|
|
|
755
1054
|
return {
|
|
756
|
-
$schema:
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
1055
|
+
$schema:
|
|
1056
|
+
"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
|
|
1057
|
+
version: "2.1.0",
|
|
1058
|
+
runs: [
|
|
1059
|
+
{
|
|
1060
|
+
tool: {
|
|
1061
|
+
driver: {
|
|
1062
|
+
name: "Oculum",
|
|
1063
|
+
version: "1.0.0",
|
|
1064
|
+
informationUri: "https://oculum.dev",
|
|
1065
|
+
organization: "Oculum Security",
|
|
1066
|
+
rules: getUniqueRules(result.vulnerabilities),
|
|
1067
|
+
},
|
|
766
1068
|
},
|
|
1069
|
+
results: [...activeResults, ...suppressedResults],
|
|
1070
|
+
columnKind: "utf16CodeUnits",
|
|
767
1071
|
},
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
}],
|
|
771
|
-
}
|
|
1072
|
+
],
|
|
1073
|
+
};
|
|
772
1074
|
}
|
|
773
1075
|
|
|
774
|
-
function mapSeverityToSARIF(
|
|
1076
|
+
function mapSeverityToSARIF(
|
|
1077
|
+
severity: VulnerabilitySeverity,
|
|
1078
|
+
): "error" | "warning" | "note" {
|
|
775
1079
|
switch (severity) {
|
|
776
|
-
case
|
|
777
|
-
case
|
|
778
|
-
return
|
|
779
|
-
case
|
|
780
|
-
return
|
|
1080
|
+
case "critical":
|
|
1081
|
+
case "high":
|
|
1082
|
+
return "error";
|
|
1083
|
+
case "medium":
|
|
1084
|
+
return "warning";
|
|
781
1085
|
default:
|
|
782
|
-
return
|
|
1086
|
+
return "note";
|
|
783
1087
|
}
|
|
784
1088
|
}
|
|
785
1089
|
|
|
786
|
-
function getRuleIndex(
|
|
787
|
-
|
|
788
|
-
|
|
1090
|
+
function getRuleIndex(
|
|
1091
|
+
vulnerabilities: Vulnerability[],
|
|
1092
|
+
category: string,
|
|
1093
|
+
): number {
|
|
1094
|
+
const seen = new Set<string>();
|
|
1095
|
+
let index = 0;
|
|
789
1096
|
for (const v of vulnerabilities) {
|
|
790
1097
|
if (!seen.has(v.category)) {
|
|
791
|
-
if (v.category === category) return index
|
|
792
|
-
seen.add(v.category)
|
|
793
|
-
index
|
|
1098
|
+
if (v.category === category) return index;
|
|
1099
|
+
seen.add(v.category);
|
|
1100
|
+
index++;
|
|
794
1101
|
}
|
|
795
1102
|
}
|
|
796
|
-
return 0
|
|
1103
|
+
return 0;
|
|
797
1104
|
}
|
|
798
1105
|
|
|
799
1106
|
function getUniqueRules(vulnerabilities: Vulnerability[]): object[] {
|
|
800
|
-
const seen = new Set<string>()
|
|
801
|
-
const rules: object[] = []
|
|
1107
|
+
const seen = new Set<string>();
|
|
1108
|
+
const rules: object[] = [];
|
|
802
1109
|
|
|
803
1110
|
for (const v of vulnerabilities) {
|
|
804
|
-
if (seen.has(v.category)) continue
|
|
805
|
-
seen.add(v.category)
|
|
1111
|
+
if (seen.has(v.category)) continue;
|
|
1112
|
+
seen.add(v.category);
|
|
806
1113
|
|
|
807
|
-
const metadata = RULE_METADATA[v.category]
|
|
808
|
-
const ruleName =
|
|
1114
|
+
const metadata = RULE_METADATA[v.category];
|
|
1115
|
+
const ruleName =
|
|
1116
|
+
metadata?.name ||
|
|
1117
|
+
v.category.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
809
1118
|
|
|
810
1119
|
rules.push({
|
|
811
1120
|
id: v.category,
|
|
@@ -814,36 +1123,43 @@ function getUniqueRules(vulnerabilities: Vulnerability[]): object[] {
|
|
|
814
1123
|
fullDescription: {
|
|
815
1124
|
text: metadata?.description || v.description,
|
|
816
1125
|
},
|
|
817
|
-
helpUri:
|
|
1126
|
+
helpUri:
|
|
1127
|
+
metadata?.helpUri ||
|
|
1128
|
+
`https://oculum.dev/docs/rules/${v.category.replace(/_/g, "-")}`,
|
|
818
1129
|
help: {
|
|
819
1130
|
text: metadata?.description || v.description,
|
|
820
|
-
markdown: `# ${ruleName}\n\n${metadata?.description || v.description}\n\n[Learn more](${metadata?.helpUri ||
|
|
1131
|
+
markdown: `# ${ruleName}\n\n${metadata?.description || v.description}\n\n[Learn more](${metadata?.helpUri || "https://oculum.dev/docs"})`,
|
|
821
1132
|
},
|
|
822
1133
|
defaultConfiguration: {
|
|
823
1134
|
level: mapSeverityToSARIF(v.severity),
|
|
824
1135
|
},
|
|
825
1136
|
properties: {
|
|
826
|
-
tags: metadata?.tags || [
|
|
827
|
-
precision:
|
|
828
|
-
|
|
1137
|
+
tags: metadata?.tags || ["security"],
|
|
1138
|
+
precision:
|
|
1139
|
+
v.confidence === "high"
|
|
1140
|
+
? "high"
|
|
1141
|
+
: v.confidence === "medium"
|
|
1142
|
+
? "medium"
|
|
1143
|
+
: "low",
|
|
1144
|
+
"security-severity": mapSeverityToScore(v.severity),
|
|
829
1145
|
},
|
|
830
|
-
})
|
|
1146
|
+
});
|
|
831
1147
|
}
|
|
832
1148
|
|
|
833
|
-
return rules
|
|
1149
|
+
return rules;
|
|
834
1150
|
}
|
|
835
1151
|
|
|
836
1152
|
function mapSeverityToScore(severity: VulnerabilitySeverity): string {
|
|
837
1153
|
switch (severity) {
|
|
838
|
-
case
|
|
839
|
-
return
|
|
840
|
-
case
|
|
841
|
-
return
|
|
842
|
-
case
|
|
843
|
-
return
|
|
844
|
-
case
|
|
845
|
-
return
|
|
1154
|
+
case "critical":
|
|
1155
|
+
return "9.0";
|
|
1156
|
+
case "high":
|
|
1157
|
+
return "7.0";
|
|
1158
|
+
case "medium":
|
|
1159
|
+
return "5.0";
|
|
1160
|
+
case "low":
|
|
1161
|
+
return "3.0";
|
|
846
1162
|
default:
|
|
847
|
-
return
|
|
1163
|
+
return "1.0";
|
|
848
1164
|
}
|
|
849
1165
|
}
|