torusguard 1.3.4 → 1.3.5
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/.torusguard/.manifest.json +66 -63
- package/.torusguard/rules/business-logic/TG-BIZ-001-client-controlled-sensitive-business-value.md +30 -14
- package/.torusguard/rules/business-logic/TG-BIZ-002-replayable-one-time-operation.md +33 -16
- package/.torusguard/rules/business-logic/TG-BIZ-003-missing-workflow-state-validation.md +31 -15
- package/.torusguard/rules/business-logic/TG-BIZ-004-unrestricted-sensitive-business-flow.md +26 -16
- package/.torusguard/rules/cache/TG-CACHE-001-sensitive-response-publicly-cacheable.md +24 -16
- package/.torusguard/rules/cache/TG-CACHE-002-missing-user-cache-isolation.md +32 -18
- package/.torusguard/rules/cache/TG-CACHE-003-sensitive-data-in-url.md +24 -17
- package/.torusguard/rules/csrf/TG-CSRF-001-missing-csrf-protection.md +31 -18
- package/.torusguard/rules/csrf/TG-CSRF-002-unsafe-credentialed-cross-origin-request.md +28 -17
- package/.torusguard/rules/graphql/TG-GQL-002-resolver-missing-authorization.md +33 -17
- package/.torusguard/rules/graphql/TG-GQL-003-unbounded-graphql-pagination-or-batching.md +31 -16
- package/.torusguard/rules/graphql/TG-GQL-004-unnecessary-production-introspection.md +25 -16
- package/.torusguard/rules/secrets/TG-SEC-005-secret-in-git-history.md +24 -19
- package/.torusguard/rules/secrets/TG-SEC-006-secret-in-build-artifact.md +36 -19
- package/.torusguard/rules/secrets/TG-SEC-007-secret-in-test-or-example-fixture.md +21 -16
- package/.torusguard/rules/ssrf/TG-SSRF-002-missing-internal-network-protection.md +45 -18
- package/.torusguard/rules/ssrf/TG-SSRF-003-unsafe-redirect-following.md +20 -16
- package/.torusguard/rules/ssrf/TG-SSRF-004-unbounded-outbound-request.md +28 -19
- package/.torusguard/rules/supply-chain/TG-SUPPLY-001-missing-or-ignored-dependency-lockfile.md +25 -18
- package/.torusguard/rules/supply-chain/TG-SUPPLY-003-unsafe-ci-cd-secret-exposure.md +29 -19
- package/.torusguard/rules/supply-chain/TG-SUPPLY-004-unpinned-ci-action.md +23 -18
- package/.torusguard/rules/supply-chain/TG-SUPPLY-005-unsafe-dependency-install-script.md +23 -18
- package/.torusguard/rules/webhook/TG-WEBHOOK-001-missing-webhook-signature-verification.md +36 -16
- package/.torusguard/rules/webhook/TG-WEBHOOK-002-replayable-webhook.md +26 -17
- package/.torusguard/rules/webhook/TG-WEBHOOK-003-missing-webhook-idempotency.md +30 -16
- package/.torusguard/rules/webhook/TG-WEBHOOK-004-unvalidated-webhook-event-type.md +25 -16
- package/.torusguard/rules/websocket/TG-WS-002-missing-channel-level-authorization.md +28 -17
- package/.torusguard/rules/websocket/TG-WS-003-unvalidated-websocket-message.md +31 -17
- package/.torusguard/rules/websocket/TG-WS-004-unbounded-websocket-connections.md +31 -17
- package/.torusguard/rules_catalog.json +520 -0
- package/.torusguard/runs/report-latest.html +93 -7
- package/.torusguard/runs/run-20260912-214110-audit/findings.json +1256 -0
- package/.torusguard/runs/run-20260912-214110-audit/findings.md +534 -0
- package/.torusguard/runs/run-20260912-214110-audit/manifest.json +12 -0
- package/.torusguard/runs/run-20260912-214110-audit/summary.md +5 -0
- package/.torusguard/runs/run-20260912-214813-audit/findings.json +992 -0
- package/.torusguard/runs/run-20260912-214813-audit/findings.md +422 -0
- package/.torusguard/runs/run-20260912-214813-audit/manifest.json +12 -0
- package/.torusguard/runs/run-20260912-214813-audit/summary.md +5 -0
- package/.torusguard/runs/run-20260912-215555-audit/bundles/bnd-tg-auth-003-49-7c96f3/metadata.json +17 -0
- package/.torusguard/runs/run-20260912-215555-audit/bundles/bnd-tg-auth-003-49-7c96f3/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260912-215555-audit/bundles/bnd-tg-auth-003-49-7c96f3/patch.diff +9 -0
- package/.torusguard/runs/run-20260912-215555-audit/bundles/bnd-tg-input-003-53-d167b4/metadata.json +17 -0
- package/.torusguard/runs/run-20260912-215555-audit/bundles/bnd-tg-input-003-53-d167b4/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260912-215555-audit/bundles/bnd-tg-input-003-53-d167b4/patch.diff +9 -0
- package/.torusguard/runs/run-20260912-215555-audit/bundles/bnd-tg-platform-001-12-cf8156/metadata.json +17 -0
- package/.torusguard/runs/run-20260912-215555-audit/bundles/bnd-tg-platform-001-12-cf8156/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260912-215555-audit/bundles/bnd-tg-platform-001-12-cf8156/patch.diff +9 -0
- package/.torusguard/runs/run-20260912-215555-audit/bundles/bnd-tg-rate-001-26-affcfa/metadata.json +17 -0
- package/.torusguard/runs/run-20260912-215555-audit/bundles/bnd-tg-rate-001-26-affcfa/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260912-215555-audit/bundles/bnd-tg-rate-001-26-affcfa/patch.diff +9 -0
- package/.torusguard/runs/run-20260912-215555-audit/bundles/bnd-tg-sec-001-9-e22e50/metadata.json +17 -0
- package/.torusguard/runs/run-20260912-215555-audit/bundles/bnd-tg-sec-001-9-e22e50/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260912-215555-audit/bundles/bnd-tg-sec-001-9-e22e50/patch.diff +9 -0
- package/.torusguard/runs/run-20260912-215555-audit/bundles/bnd-tg-ssrf-004-9-9803ad/metadata.json +17 -0
- package/.torusguard/runs/run-20260912-215555-audit/bundles/bnd-tg-ssrf-004-9-9803ad/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260912-215555-audit/bundles/bnd-tg-ssrf-004-9-9803ad/patch.diff +9 -0
- package/.torusguard/runs/run-20260912-215555-audit/findings.json +530 -0
- package/.torusguard/runs/run-20260912-215555-audit/findings.md +232 -0
- package/.torusguard/runs/run-20260912-215555-audit/manifest.json +13 -0
- package/.torusguard/runs/run-20260912-215555-audit/remediation.md +102 -0
- package/.torusguard/runs/run-20260912-215555-audit/summary.md +5 -0
- package/.torusguard/runs/run-20260912-215731-audit/apply_plan.md +6 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-client-001-7-587129/metadata.json +17 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-client-001-7-587129/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-client-001-7-587129/patch.diff +9 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-db-002-9-5f7850/metadata.json +17 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-db-002-9-5f7850/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-db-002-9-5f7850/patch.diff +9 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-input-001-27-2486f1/metadata.json +17 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-input-001-27-2486f1/minimal_patch_plan.md +22 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-input-001-27-2486f1/patch.diff +10 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-input-003-53-d167b4/metadata.json +17 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-input-003-53-d167b4/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-input-003-53-d167b4/patch.diff +9 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-platform-001-12-cf8156/metadata.json +17 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-platform-001-12-cf8156/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-platform-001-12-cf8156/patch.diff +9 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-platform-002-17-876973/metadata.json +17 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-platform-002-17-876973/minimal_patch_plan.md +23 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-platform-002-17-876973/patch.diff +11 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-platform-002-5-40c794/metadata.json +17 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-platform-002-5-40c794/minimal_patch_plan.md +23 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-platform-002-5-40c794/patch.diff +11 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-rate-001-26-affcfa/metadata.json +17 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-rate-001-26-affcfa/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-rate-001-26-affcfa/patch.diff +9 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-rate-002-54-0b38d2/metadata.json +17 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-rate-002-54-0b38d2/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-rate-002-54-0b38d2/patch.diff +9 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-sec-001-18-a3c1e8/metadata.json +17 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-sec-001-18-a3c1e8/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-sec-001-18-a3c1e8/patch.diff +9 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-sec-001-9-e22e50/metadata.json +17 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-sec-001-9-e22e50/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-sec-001-9-e22e50/patch.diff +9 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-sec-004-28-a1a0a1/metadata.json +17 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-sec-004-28-a1a0a1/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-sec-004-28-a1a0a1/patch.diff +9 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-sec-004-30-00569e/metadata.json +17 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-sec-004-30-00569e/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-sec-004-30-00569e/patch.diff +9 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-ssrf-004-9-9803ad/metadata.json +17 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-ssrf-004-9-9803ad/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260912-215731-audit/bundles/bnd-tg-ssrf-004-9-9803ad/patch.diff +9 -0
- package/.torusguard/runs/run-20260912-215731-audit/diff_summary.md +186 -0
- package/.torusguard/runs/run-20260912-215731-audit/findings.json +497 -0
- package/.torusguard/runs/run-20260912-215731-audit/findings.md +218 -0
- package/.torusguard/runs/run-20260912-215731-audit/manifest.json +14 -0
- package/.torusguard/runs/run-20260912-215731-audit/recheck.md +76 -0
- package/.torusguard/runs/run-20260912-215731-audit/remediation.md +234 -0
- package/.torusguard/runs/run-20260912-215731-audit/summary.md +5 -0
- package/.torusguard/runs/run-20260912-220134-audit/findings.json +68 -0
- package/.torusguard/runs/run-20260912-220134-audit/findings.md +36 -0
- package/.torusguard/runs/run-20260912-220134-audit/manifest.json +12 -0
- package/.torusguard/runs/run-20260912-220134-audit/summary.md +5 -0
- package/.torusguard/runs/run-20260912-220200-audit/findings.json +1 -0
- package/.torusguard/runs/run-20260912-220200-audit/findings.md +8 -0
- package/.torusguard/runs/run-20260912-220200-audit/manifest.json +12 -0
- package/.torusguard/runs/run-20260912-220200-audit/recheck.md +6 -0
- package/.torusguard/runs/run-20260912-220200-audit/summary.md +5 -0
- package/.torusguard/runs/run-20260912-220227-audit/findings.json +1 -0
- package/.torusguard/runs/run-20260912-220227-audit/findings.md +8 -0
- package/.torusguard/runs/run-20260912-220227-audit/manifest.json +12 -0
- package/.torusguard/runs/run-20260912-220227-audit/recheck.md +6 -0
- package/.torusguard/runs/run-20260912-220227-audit/summary.md +5 -0
- package/.torusguard/scripts/__pycache__/audit_runner.cpython-311.pyc +0 -0
- package/.torusguard/scripts/__pycache__/finding_scorer.cpython-311.pyc +0 -0
- package/.torusguard/scripts/__pycache__/report_sync.cpython-311.pyc +0 -0
- package/.torusguard/scripts/__pycache__/term_ui.cpython-311.pyc +0 -0
- package/.torusguard/scripts/apply_runner.py +383 -377
- package/.torusguard/scripts/audit_runner.py +1306 -653
- package/.torusguard/scripts/finding_scorer.py +14 -2
- package/.torusguard/scripts/harden_runner.py +628 -455
- package/.torusguard/scripts/recheck_runner.py +248 -238
- package/.torusguard/scripts/recipes_runner.py +137 -137
- package/.torusguard/scripts/report_sync.py +423 -0
- package/.torusguard/scripts/sarif_exporter.py +116 -116
- package/.torusguard/scripts/term_ui.py +162 -162
- package/.torusguard/snapshots/run-20260912-215731-audit/demo/playground/vulnerable_nextjs/actions.ts.bak +24 -0
- package/.torusguard/snapshots/run-20260912-215731-audit/examples/hardened-react-express/server/index.js.bak +121 -0
- package/.torusguard/snapshots/run-20260912-215731-audit/examples/python/fastapi-vuln/main.py.bak +20 -0
- package/.torusguard/snapshots/run-20260912-215731-audit/examples/vulnerable-react-express/client/src/App.jsx.bak +63 -0
- package/.torusguard/snapshots/run-20260912-215731-audit/examples/vulnerable-react-express/client/vite.config.js.bak +12 -0
- package/.torusguard/snapshots/run-20260912-215731-audit/examples/vulnerable-react-express/server/index.js.bak +82 -0
- package/.torusguard/workflows/apply.md +11 -4
- package/.torusguard/workflows/audit.md +7 -1
- package/.torusguard/workflows/authorize.md +2 -1
- package/.torusguard/workflows/exploit-check.md +2 -1
- package/.torusguard/workflows/harden.md +7 -1
- package/.torusguard/workflows/init.md +6 -1
- package/.torusguard/workflows/memory.md +2 -1
- package/.torusguard/workflows/recheck.md +7 -1
- package/.torusguard/workflows/report.md +7 -1
- package/.torusguard/workflows/status.md +6 -1
- package/.torusguard/workflows/verify.md +6 -1
- package/.torusguard/workflows/web-validate.md +2 -1
- package/README.md +470 -345
- package/bin/torusguard.js +550 -545
- package/package.json +1 -1
- package/skills/torusguard/SKILL.md +73 -72
- package/skills/torusguard/payload/.manifest.json +66 -63
- package/skills/torusguard/payload/rules/business-logic/TG-BIZ-001-client-controlled-sensitive-business-value.md +30 -14
- package/skills/torusguard/payload/rules/business-logic/TG-BIZ-002-replayable-one-time-operation.md +33 -16
- package/skills/torusguard/payload/rules/business-logic/TG-BIZ-003-missing-workflow-state-validation.md +31 -15
- package/skills/torusguard/payload/rules/business-logic/TG-BIZ-004-unrestricted-sensitive-business-flow.md +26 -16
- package/skills/torusguard/payload/rules/cache/TG-CACHE-001-sensitive-response-publicly-cacheable.md +24 -16
- package/skills/torusguard/payload/rules/cache/TG-CACHE-002-missing-user-cache-isolation.md +32 -18
- package/skills/torusguard/payload/rules/cache/TG-CACHE-003-sensitive-data-in-url.md +24 -17
- package/skills/torusguard/payload/rules/csrf/TG-CSRF-001-missing-csrf-protection.md +31 -18
- package/skills/torusguard/payload/rules/csrf/TG-CSRF-002-unsafe-credentialed-cross-origin-request.md +28 -17
- package/skills/torusguard/payload/rules/graphql/TG-GQL-002-resolver-missing-authorization.md +33 -17
- package/skills/torusguard/payload/rules/graphql/TG-GQL-003-unbounded-graphql-pagination-or-batching.md +31 -16
- package/skills/torusguard/payload/rules/graphql/TG-GQL-004-unnecessary-production-introspection.md +25 -16
- package/skills/torusguard/payload/rules/secrets/TG-SEC-005-secret-in-git-history.md +24 -19
- package/skills/torusguard/payload/rules/secrets/TG-SEC-006-secret-in-build-artifact.md +36 -19
- package/skills/torusguard/payload/rules/secrets/TG-SEC-007-secret-in-test-or-example-fixture.md +21 -16
- package/skills/torusguard/payload/rules/ssrf/TG-SSRF-002-missing-internal-network-protection.md +45 -18
- package/skills/torusguard/payload/rules/ssrf/TG-SSRF-003-unsafe-redirect-following.md +20 -16
- package/skills/torusguard/payload/rules/ssrf/TG-SSRF-004-unbounded-outbound-request.md +28 -19
- package/skills/torusguard/payload/rules/supply-chain/TG-SUPPLY-001-missing-or-ignored-dependency-lockfile.md +25 -18
- package/skills/torusguard/payload/rules/supply-chain/TG-SUPPLY-003-unsafe-ci-cd-secret-exposure.md +29 -19
- package/skills/torusguard/payload/rules/supply-chain/TG-SUPPLY-004-unpinned-ci-action.md +23 -18
- package/skills/torusguard/payload/rules/supply-chain/TG-SUPPLY-005-unsafe-dependency-install-script.md +23 -18
- package/skills/torusguard/payload/rules/webhook/TG-WEBHOOK-001-missing-webhook-signature-verification.md +36 -16
- package/skills/torusguard/payload/rules/webhook/TG-WEBHOOK-002-replayable-webhook.md +26 -17
- package/skills/torusguard/payload/rules/webhook/TG-WEBHOOK-003-missing-webhook-idempotency.md +30 -16
- package/skills/torusguard/payload/rules/webhook/TG-WEBHOOK-004-unvalidated-webhook-event-type.md +25 -16
- package/skills/torusguard/payload/rules/websocket/TG-WS-002-missing-channel-level-authorization.md +28 -17
- package/skills/torusguard/payload/rules/websocket/TG-WS-003-unvalidated-websocket-message.md +31 -17
- package/skills/torusguard/payload/rules/websocket/TG-WS-004-unbounded-websocket-connections.md +31 -17
- package/skills/torusguard/payload/rules_catalog.json +520 -0
- package/skills/torusguard/payload/scripts/apply_runner.py +383 -377
- package/skills/torusguard/payload/scripts/audit_runner.py +1306 -653
- package/skills/torusguard/payload/scripts/finding_scorer.py +14 -2
- package/skills/torusguard/payload/scripts/harden_runner.py +628 -455
- package/skills/torusguard/payload/scripts/recheck_runner.py +248 -238
- package/skills/torusguard/payload/scripts/recipes_runner.py +137 -137
- package/skills/torusguard/payload/scripts/report_sync.py +423 -0
- package/skills/torusguard/payload/scripts/sarif_exporter.py +116 -116
- package/skills/torusguard/payload/scripts/term_ui.py +162 -162
- package/skills/torusguard/payload/skills/torusguard/SKILL.md +75 -72
- package/skills/torusguard/payload/skills/torusguard-apply/SKILL.md +84 -80
- package/skills/torusguard/payload/skills/torusguard-audit/SKILL.md +87 -83
- package/skills/torusguard/payload/skills/torusguard-authorize/SKILL.md +7 -2
- package/skills/torusguard/payload/skills/torusguard-exploit-check/SKILL.md +7 -2
- package/skills/torusguard/payload/skills/torusguard-full/SKILL.md +7 -2
- package/skills/torusguard/payload/skills/torusguard-harden/SKILL.md +98 -94
- package/skills/torusguard/payload/skills/torusguard-init/SKILL.md +68 -64
- package/skills/torusguard/payload/skills/torusguard-recheck/SKILL.md +81 -77
- package/skills/torusguard/payload/skills/torusguard-report/SKILL.md +76 -72
- package/skills/torusguard/payload/skills/torusguard-status/SKILL.md +62 -58
- package/skills/torusguard/payload/skills/torusguard-verify/SKILL.md +7 -2
- package/skills/torusguard/payload/skills/torusguard-web-validate/SKILL.md +7 -2
- package/skills/torusguard/payload/workflows/apply.md +11 -4
- package/skills/torusguard/payload/workflows/audit.md +7 -1
- package/skills/torusguard/payload/workflows/authorize.md +2 -1
- package/skills/torusguard/payload/workflows/exploit-check.md +2 -1
- package/skills/torusguard/payload/workflows/harden.md +7 -1
- package/skills/torusguard/payload/workflows/init.md +6 -1
- package/skills/torusguard/payload/workflows/memory.md +2 -1
- package/skills/torusguard/payload/workflows/recheck.md +7 -1
- package/skills/torusguard/payload/workflows/report.md +7 -1
- package/skills/torusguard/payload/workflows/status.md +6 -1
- package/skills/torusguard/payload/workflows/verify.md +6 -1
- package/skills/torusguard/payload/workflows/web-validate.md +2 -1
- package/skills/torusguard-apply/SKILL.md +84 -80
- package/skills/torusguard-audit/SKILL.md +87 -83
- package/skills/torusguard-authorize/SKILL.md +7 -2
- package/skills/torusguard-exploit-check/SKILL.md +7 -2
- package/skills/torusguard-full/SKILL.md +7 -2
- package/skills/torusguard-harden/SKILL.md +98 -94
- package/skills/torusguard-init/SKILL.md +68 -64
- package/skills/torusguard-recheck/SKILL.md +81 -77
- package/skills/torusguard-report/SKILL.md +76 -72
- package/skills/torusguard-status/SKILL.md +62 -58
- package/skills/torusguard-verify/SKILL.md +7 -2
- package/skills/torusguard-web-validate/SKILL.md +7 -2
package/package.json
CHANGED
|
@@ -1,72 +1,73 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: torusguard
|
|
3
|
-
description: Universal autonomous security engine:
|
|
4
|
-
version: 1.3.
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# TorusGuard Master Security Engine & Command Router
|
|
8
|
-
|
|
9
|
-
**Core Invariant:** If the browser or client receives it, users can inspect it. Never expose database credentials, master keys, or private API secrets in client bundles. Always isolate multi-tenant database queries.
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## Command Catalog: Terminal CLI & AI Chat Parity
|
|
14
|
-
|
|
15
|
-
TorusGuard operates with 100% feature parity across both the terminal CLI and AI chat slash commands:
|
|
16
|
-
|
|
17
|
-
| Capability | Terminal CLI Command | AI Chat Slash Command | Specialist Skill | Purpose |
|
|
18
|
-
| :--- | :--- | :--- | :--- | :--- |
|
|
19
|
-
| **Init** | `npx torusguard init` | `/torusguard init` | `skills/torusguard-init` | Stack discovery, rule activation, workspace scaffolding |
|
|
20
|
-
| **Status** | `npx torusguard status` | `/torusguard status` | `skills/torusguard-status` | Posture score, active rules, run history, scope check |
|
|
21
|
-
| **Audit** | `npx torusguard audit` | `/torusguard audit` | `skills/torusguard-audit` | Static AST scan, invariant fingerprinting, confidence scoring |
|
|
22
|
-
| **Verify** | `npx torusguard verify` | `/torusguard verify` | `skills/torusguard-verify` | Evidence sufficiency audit & line match calibration |
|
|
23
|
-
| **Harden** | `npx torusguard harden` | `/torusguard harden` | `skills/torusguard-harden` | Ponytail patch formulation ($\le 35$ add, $\le 25$ del) |
|
|
24
|
-
| **Apply** | `npx torusguard apply [--yes]` | `/torusguard apply` | `skills/torusguard-apply` | Human Gate review, `.bak` snapshots, patch application |
|
|
25
|
-
| **Rollback** | `npx torusguard rollback` | `/torusguard rollback` | `skills/torusguard-apply` | Instant 1-step rollback from pre-apply snapshots |
|
|
26
|
-
| **Recheck** | `npx torusguard recheck` | `/torusguard recheck` | `skills/torusguard-recheck` | Targeted differential AST scan, fix closure verification |
|
|
27
|
-
| **Recipes** | `npx torusguard recipes` | `/torusguard recipes` | `skills/torusguard-harden` | Explore verified Golden Fix Recipes from persistent memory |
|
|
28
|
-
| **Report** | `npx torusguard report --html` | `/torusguard report` | `skills/torusguard-report` | Executive posture reporting, SARIF v2.1.0 & visual HTML |
|
|
29
|
-
| **Authorize** | `npx torusguard authorize` | `/torusguard authorize` | `skills/torusguard-authorize`| Legal scope definition & safety boundaries |
|
|
30
|
-
| **Validate** | `npx torusguard web-validate` | `/torusguard web-validate` | `skills/torusguard-web-validate`| Authorized non-destructive HTTP probing |
|
|
31
|
-
| **Exploit** | `npx torusguard exploit-check` | `/torusguard exploit-check`| `skills/torusguard-exploit-check`| Bounded single-step exploitability confirmation |
|
|
32
|
-
| **Full** | `npx torusguard full` | `/torusguard full` | `skills/torusguard-full` | End-to-end 7-stage closed-loop execution |
|
|
33
|
-
| **Sync** | `npx torusguard rules sync` | `/torusguard rules sync` | `skills/torusguard-init` | Synchronize rules across AI editors (Cursor, Claude, Antigravity) |
|
|
34
|
-
|
|
35
|
-
---
|
|
36
|
-
|
|
37
|
-
## Non-Negotiable Invariants
|
|
38
|
-
|
|
39
|
-
1. **Browser-Code Truth:** If the client receives it, it is public. Zero hardcoded secrets (`SUPABASE_SERVICE_ROLE_KEY`, private tokens, live API keys) in frontend code.
|
|
40
|
-
2. **Multi-Tenant Isolation:** All database lookups must be scoped by organization or user ownership (`tenant_id`, `organization_id`, `where: { tenantId }`).
|
|
41
|
-
3. **Ponytail Churn Bounds:** Patches must be minimal and surgical ($\le 35$ additions, $\le 25$ deletions). Never perform full-file rewrites.
|
|
42
|
-
4. **Standardized 75-Column Terminal:** All CLI terminal output is strictly normalized to 75 visual columns with Unicode emoji width calculation, ANSI escape handling, and visual truncation with ellipsis (`...`).
|
|
43
|
-
5. **Zero Security Bypasses:** Never insert `# nosec`, `verify=False`, `InsecureSkipVerify: true`, `[AllowAnonymous]`, or `csrf().disable()`.
|
|
44
|
-
6. **Snapshots Before Edits:** Every code modification must capture a byte-for-byte pre-apply backup in `.torusguard/snapshots/<run_id>/` before touching disk code.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
│
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
│ ├──
|
|
57
|
-
│
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
│
|
|
63
|
-
│ ├── findings.
|
|
64
|
-
│ ├──
|
|
65
|
-
│ ├──
|
|
66
|
-
│ ├──
|
|
67
|
-
│ ├──
|
|
68
|
-
│ ├──
|
|
69
|
-
│
|
|
70
|
-
└──
|
|
71
|
-
|
|
72
|
-
|
|
1
|
+
---
|
|
2
|
+
name: torusguard
|
|
3
|
+
description: Universal autonomous security engine: 74 canonical rules across 18 families, polyglot stack detection across 16+ languages, Ponytail remediation bounds (<=35 add, <=25 del), standardized 75-column terminal UI, living security_report.md ground-truth ledger, SARIF v2.1.0 exports, and persistent security memory context.
|
|
4
|
+
version: 1.3.5
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# TorusGuard Master Security Engine & Command Router
|
|
8
|
+
|
|
9
|
+
**Core Invariant:** If the browser or client receives it, users can inspect it. Never expose database credentials, master keys, or private API secrets in client bundles. Always isolate multi-tenant database queries.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Command Catalog: Terminal CLI & AI Chat Parity
|
|
14
|
+
|
|
15
|
+
TorusGuard operates with 100% feature parity across both the terminal CLI and AI chat slash commands:
|
|
16
|
+
|
|
17
|
+
| Capability | Terminal CLI Command | AI Chat Slash Command | Specialist Skill | Purpose |
|
|
18
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
19
|
+
| **Init** | `npx torusguard init` | `/torusguard init` | `skills/torusguard-init` | Stack discovery, rule activation, workspace scaffolding |
|
|
20
|
+
| **Status** | `npx torusguard status` | `/torusguard status` | `skills/torusguard-status` | Posture score, active rules, run history, scope check |
|
|
21
|
+
| **Audit** | `npx torusguard audit` | `/torusguard audit` | `skills/torusguard-audit` | Static AST scan, invariant fingerprinting, confidence scoring |
|
|
22
|
+
| **Verify** | `npx torusguard verify` | `/torusguard verify` | `skills/torusguard-verify` | Evidence sufficiency audit & line match calibration |
|
|
23
|
+
| **Harden** | `npx torusguard harden` | `/torusguard harden` | `skills/torusguard-harden` | Ponytail patch formulation ($\le 35$ add, $\le 25$ del) |
|
|
24
|
+
| **Apply** | `npx torusguard apply [--yes]` | `/torusguard apply` | `skills/torusguard-apply` | Human Gate review, `.bak` snapshots, patch application |
|
|
25
|
+
| **Rollback** | `npx torusguard rollback` | `/torusguard rollback` | `skills/torusguard-apply` | Instant 1-step rollback from pre-apply snapshots |
|
|
26
|
+
| **Recheck** | `npx torusguard recheck` | `/torusguard recheck` | `skills/torusguard-recheck` | Targeted differential AST scan, fix closure verification |
|
|
27
|
+
| **Recipes** | `npx torusguard recipes` | `/torusguard recipes` | `skills/torusguard-harden` | Explore verified Golden Fix Recipes from persistent memory |
|
|
28
|
+
| **Report** | `npx torusguard report --html` | `/torusguard report` | `skills/torusguard-report` | Executive posture reporting, SARIF v2.1.0 & visual HTML |
|
|
29
|
+
| **Authorize** | `npx torusguard authorize` | `/torusguard authorize` | `skills/torusguard-authorize`| Legal scope definition & safety boundaries |
|
|
30
|
+
| **Validate** | `npx torusguard web-validate` | `/torusguard web-validate` | `skills/torusguard-web-validate`| Authorized non-destructive HTTP probing |
|
|
31
|
+
| **Exploit** | `npx torusguard exploit-check` | `/torusguard exploit-check`| `skills/torusguard-exploit-check`| Bounded single-step exploitability confirmation |
|
|
32
|
+
| **Full** | `npx torusguard full` | `/torusguard full` | `skills/torusguard-full` | End-to-end 7-stage closed-loop execution |
|
|
33
|
+
| **Sync** | `npx torusguard rules sync` | `/torusguard rules sync` | `skills/torusguard-init` | Synchronize rules across AI editors (Cursor, Claude, Antigravity) |
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Non-Negotiable Invariants
|
|
38
|
+
|
|
39
|
+
1. **Browser-Code Truth:** If the client receives it, it is public. Zero hardcoded secrets (`SUPABASE_SERVICE_ROLE_KEY`, private tokens, live API keys) in frontend code.
|
|
40
|
+
2. **Multi-Tenant Isolation:** All database lookups must be scoped by organization or user ownership (`tenant_id`, `organization_id`, `where: { tenantId }`).
|
|
41
|
+
3. **Ponytail Churn Bounds:** Patches must be minimal and surgical ($\le 35$ additions, $\le 25$ deletions). Never perform full-file rewrites.
|
|
42
|
+
4. **Standardized 75-Column Terminal:** All CLI terminal output is strictly normalized to 75 visual columns with Unicode emoji width calculation, ANSI escape handling, and visual truncation with ellipsis (`...`).
|
|
43
|
+
5. **Zero Security Bypasses:** Never insert `# nosec`, `verify=False`, `InsecureSkipVerify: true`, `[AllowAnonymous]`, or `csrf().disable()`.
|
|
44
|
+
6. **Snapshots Before Edits:** Every code modification must capture a byte-for-byte pre-apply backup in `.torusguard/snapshots/<run_id>/` before touching disk code.
|
|
45
|
+
7. **Living Security Report Ground Truth:** All finding discoveries, patch formulations, applications, and recheck verifications must synchronize with `security_report.md` at the workspace root to maintain verifiable finding state and eliminate hallucination.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Workspace Layout Structure
|
|
50
|
+
```
|
|
51
|
+
.torusguard/
|
|
52
|
+
├── config/
|
|
53
|
+
│ ├── torusguard.json # Detected stack, settings, and rule counts
|
|
54
|
+
│ └── scope.json # Authorized runtime validation targets & TTL
|
|
55
|
+
├── memory/
|
|
56
|
+
│ ├── context.json # Aggregated security memory context
|
|
57
|
+
│ ├── patterns.json # Distilled Golden Fix Recipes
|
|
58
|
+
│ └── events.json # Historical audit, apply, and recheck events
|
|
59
|
+
├── rules/
|
|
60
|
+
│ └── active/ # Active TG-* rule definitions
|
|
61
|
+
├── runs/
|
|
62
|
+
│ └── run-YYYYMMDD-HHMMSS-audit/
|
|
63
|
+
│ ├── findings.json # Machine-readable AST findings
|
|
64
|
+
│ ├── findings.md # Actionable markdown finding cards
|
|
65
|
+
│ ├── remediation.md # Formulated candidate patch catalog
|
|
66
|
+
│ ├── diff_summary.md # Summary of applied diffs
|
|
67
|
+
│ ├── recheck.md # Differential recheck status transitions
|
|
68
|
+
│ ├── report.html # Single-file visual dark-mode HTML report
|
|
69
|
+
│ ├── results.sarif # OASIS SARIF v2.1.0 log
|
|
70
|
+
│ └── bundles/ # Formulated Ponytail remediation bundles
|
|
71
|
+
└── snapshots/
|
|
72
|
+
└── run-YYYYMMDD-HHMMSS-audit/ # Pre-apply .bak files for instant rollback
|
|
73
|
+
```
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"ARCHITECTURE.md": "cdc690a856e82574a6574ab6b1ad8a2d8b3b8264c36931c6212321066eed82e4",
|
|
3
3
|
"TORUSGUARD.md": "c980b0ddd3778d5981f6c16c64015c60dc713b6f151fc531bc5681ecd770fb50",
|
|
4
|
+
"rules_catalog.json": "e0b32c1bdde0f19fa390aba26a02b7e5ba1b59b251f9fffd501815b48f2d9af9",
|
|
4
5
|
"agents/auditor.md": "4ba2c92982823d0886c7ae369126cd5ddd322085a85d3b7e7fa23154f8753314",
|
|
5
6
|
"agents/profiler.md": "0ee9ebbddf4ebd557d454dda8472fffea471e263abeccf40298163084b7ce9a9",
|
|
6
7
|
"agents/remediator.md": "f708a0e315760e8d519bd640d22bdf6b7ec61ed7de3da69bd038bd60dc3d5b47",
|
|
@@ -92,43 +93,43 @@
|
|
|
92
93
|
"rules/authorization/TG-AUTH-006-mass-assignment.md": "9544e6df5d7420eb4dce4fbddd63f21103d82d91fedaedcfe041943b18452472",
|
|
93
94
|
"rules/authorization/TG-AUTH-007-missing-property-level-authorization.md": "5a1afe03c03d8d3fe7ce952ead8ab011c1c209d029361ce183bf8091216914d0",
|
|
94
95
|
"rules/authorization/TG-AUTH-008-untrusted-role-header-injection.md": "74cac648fd6c6b49523be499ecf878240b9ea58d1086c1b84c17532d4ba4ee49",
|
|
95
|
-
"rules/business-logic/TG-BIZ-001-client-controlled-sensitive-business-value.md": "
|
|
96
|
-
"rules/business-logic/TG-BIZ-002-replayable-one-time-operation.md": "
|
|
97
|
-
"rules/business-logic/TG-BIZ-003-missing-workflow-state-validation.md": "
|
|
98
|
-
"rules/business-logic/TG-BIZ-004-unrestricted-sensitive-business-flow.md": "
|
|
99
|
-
"rules/cache/TG-CACHE-001-sensitive-response-publicly-cacheable.md": "
|
|
100
|
-
"rules/cache/TG-CACHE-002-missing-user-cache-isolation.md": "
|
|
101
|
-
"rules/cache/TG-CACHE-003-sensitive-data-in-url.md": "
|
|
102
|
-
"rules/csrf/TG-CSRF-001-missing-csrf-protection.md": "
|
|
103
|
-
"rules/csrf/TG-CSRF-002-unsafe-credentialed-cross-origin-request.md": "
|
|
96
|
+
"rules/business-logic/TG-BIZ-001-client-controlled-sensitive-business-value.md": "e86c4f9c9d791f8eeea2464fdaf280bfb6a03bd3704e4a5c04725206ed117fd3",
|
|
97
|
+
"rules/business-logic/TG-BIZ-002-replayable-one-time-operation.md": "fc30c85ba39ff14f701958c50aba5fc8fe381944dd8a0beecbb1692797fc7fb7",
|
|
98
|
+
"rules/business-logic/TG-BIZ-003-missing-workflow-state-validation.md": "120d8cb59423b01b887a2f6d96f52a485fe9463ee48d77f7d05d9cd7ec4d69b4",
|
|
99
|
+
"rules/business-logic/TG-BIZ-004-unrestricted-sensitive-business-flow.md": "ccd82baec26c015079d78c9c70fc5cca35dcbc6dc973a860b23d7392708e6e79",
|
|
100
|
+
"rules/cache/TG-CACHE-001-sensitive-response-publicly-cacheable.md": "e84d9d314b1616bdda54345fdf0203732e68e375dc7e144d9e2aa7619f9cafb8",
|
|
101
|
+
"rules/cache/TG-CACHE-002-missing-user-cache-isolation.md": "4e305be49dd14a34d29c9283b535a72ad6cd84c5bd52afb3f006403f2e5a6850",
|
|
102
|
+
"rules/cache/TG-CACHE-003-sensitive-data-in-url.md": "235f3eed546b58aa8f04e155aeaef4e0206dd696517a7854983ab9ce8fe61030",
|
|
103
|
+
"rules/csrf/TG-CSRF-001-missing-csrf-protection.md": "42fcf19ae244a36b3b64d03200b6d4c1acf1b265fdb2fe6a85de8dd69b3837fe",
|
|
104
|
+
"rules/csrf/TG-CSRF-002-unsafe-credentialed-cross-origin-request.md": "c01a55e31e4aaaea8c9f630b514c1ad242b513ab99111534939584ae4fe1a58c",
|
|
104
105
|
"rules/custom/README.md": "f2128661ad3bc4085a69ddfbabbb2211930215fc42a25e2ab2d3e7a4b749a639",
|
|
105
106
|
"rules/edge/TG-EDGE-001-serverless-global-state-leak.md": "82fe764a67228c71359b340a983cb37dc8bf4521d030846e0cea433de43c52d3",
|
|
106
107
|
"rules/edge/TG-EDGE-003-aws-lambda-ephemeral-cold-start.md": "2659db7d38b6689d1d3a99ad5f2504ea264b3d3a601ab38186737b12d4d42c17",
|
|
107
108
|
"rules/graphql/TG-GQL-001-missing-query-depth-or-complexity-limits.md": "bfee2cb26c71871cc4b93e224dc56c18de0d0ea692a431f7b27a51e7e408873f",
|
|
108
|
-
"rules/graphql/TG-GQL-002-resolver-missing-authorization.md": "
|
|
109
|
-
"rules/graphql/TG-GQL-003-unbounded-graphql-pagination-or-batching.md": "
|
|
110
|
-
"rules/graphql/TG-GQL-004-unnecessary-production-introspection.md": "
|
|
111
|
-
"rules/secrets/TG-SEC-005-secret-in-git-history.md": "
|
|
112
|
-
"rules/secrets/TG-SEC-006-secret-in-build-artifact.md": "
|
|
113
|
-
"rules/secrets/TG-SEC-007-secret-in-test-or-example-fixture.md": "
|
|
109
|
+
"rules/graphql/TG-GQL-002-resolver-missing-authorization.md": "e6429fdcf130478446a2711eac83bd64cc502aad8baa35c04de26958d23e5b0f",
|
|
110
|
+
"rules/graphql/TG-GQL-003-unbounded-graphql-pagination-or-batching.md": "c2e2beb37c4d86f4ba564e1a1fd9587626df3793b9c5dc9e13d0cf0ce3bfe09a",
|
|
111
|
+
"rules/graphql/TG-GQL-004-unnecessary-production-introspection.md": "54311588945abc1d79e99a0001390821ccb4434772297b2395e7081d276d6602",
|
|
112
|
+
"rules/secrets/TG-SEC-005-secret-in-git-history.md": "089dbe9653b2a4df652ba049b40147434d6abc70c239ac7db81bdcb9d6579387",
|
|
113
|
+
"rules/secrets/TG-SEC-006-secret-in-build-artifact.md": "ed20b1c9044149df5257ad8140bd787db7f77063b890dad9ba32efaf4d554fe5",
|
|
114
|
+
"rules/secrets/TG-SEC-007-secret-in-test-or-example-fixture.md": "b3d4b9f1d0fd9656aa9a586e133209904c1f3b75a2b7e7c1ecb825a125663e6d",
|
|
114
115
|
"rules/ssrf/TG-SSRF-001-user-controlled-server-side-url-fetch.md": "d6a9bee4b60c1f2a02f83dfc59c71e4aefb2284431cead83703d2882ba8813e1",
|
|
115
|
-
"rules/ssrf/TG-SSRF-002-missing-internal-network-protection.md": "
|
|
116
|
-
"rules/ssrf/TG-SSRF-003-unsafe-redirect-following.md": "
|
|
117
|
-
"rules/ssrf/TG-SSRF-004-unbounded-outbound-request.md": "
|
|
118
|
-
"rules/supply-chain/TG-SUPPLY-001-missing-or-ignored-dependency-lockfile.md": "
|
|
116
|
+
"rules/ssrf/TG-SSRF-002-missing-internal-network-protection.md": "6cc87c5be9de739f291d724cec9e2897b7c4abb48bf938cafe824ec29634c878",
|
|
117
|
+
"rules/ssrf/TG-SSRF-003-unsafe-redirect-following.md": "1f0e92b6783f1ab10310f98bea64df6fec82bd61b311828787e273e2db9878fa",
|
|
118
|
+
"rules/ssrf/TG-SSRF-004-unbounded-outbound-request.md": "24fbbb0b5d57a1399397e25849bb25b307f9f03c66c34d67bffe9bdc675c4aeb",
|
|
119
|
+
"rules/supply-chain/TG-SUPPLY-001-missing-or-ignored-dependency-lockfile.md": "30ceac40228e8777491d3f5613f7660e75f186a07256be7af1c6bc1576f17f3d",
|
|
119
120
|
"rules/supply-chain/TG-SUPPLY-002-vulnerable-dependency-review-missing.md": "f80f2717fdba26e1520bb40276edb6d88835eb8c307e170ff8ab9572187f338f",
|
|
120
|
-
"rules/supply-chain/TG-SUPPLY-003-unsafe-ci-cd-secret-exposure.md": "
|
|
121
|
-
"rules/supply-chain/TG-SUPPLY-004-unpinned-ci-action.md": "
|
|
122
|
-
"rules/supply-chain/TG-SUPPLY-005-unsafe-dependency-install-script.md": "
|
|
121
|
+
"rules/supply-chain/TG-SUPPLY-003-unsafe-ci-cd-secret-exposure.md": "43add6a6a01e8a1f206d67678906bb21349889453b148247694dfd53e8aa6b93",
|
|
122
|
+
"rules/supply-chain/TG-SUPPLY-004-unpinned-ci-action.md": "d8f4ea71de97a6455c84734c94805d520a6666fa0460a3dd63780c7fd4618052",
|
|
123
|
+
"rules/supply-chain/TG-SUPPLY-005-unsafe-dependency-install-script.md": "20657c6ad29b1ad046fbab5523fbf809f37598898415b2dfbf76f55826578305",
|
|
123
124
|
"rules/supply-chain/TG-SUPPLY-006-container-build-secret-persistence.md": "eaadfc37364f150aa08212afd9a629bb084bdd705c6663534b6ea6c74f383053",
|
|
124
|
-
"rules/webhook/TG-WEBHOOK-001-missing-webhook-signature-verification.md": "
|
|
125
|
-
"rules/webhook/TG-WEBHOOK-002-replayable-webhook.md": "
|
|
126
|
-
"rules/webhook/TG-WEBHOOK-003-missing-webhook-idempotency.md": "
|
|
127
|
-
"rules/webhook/TG-WEBHOOK-004-unvalidated-webhook-event-type.md": "
|
|
125
|
+
"rules/webhook/TG-WEBHOOK-001-missing-webhook-signature-verification.md": "4d4e516a0765c4b9d26c675374ea5fe73319a3883555dc368ef2633d67499e6a",
|
|
126
|
+
"rules/webhook/TG-WEBHOOK-002-replayable-webhook.md": "9d0dad0f993bfc4b3aaf035bb5b1fb362c3e6556168ef63e2b7053f288dbf8a6",
|
|
127
|
+
"rules/webhook/TG-WEBHOOK-003-missing-webhook-idempotency.md": "6a9b2346379ee37b73079a8ed67c9cbae8ba2b1f8c6b862eeb76a9d1a8d465c9",
|
|
128
|
+
"rules/webhook/TG-WEBHOOK-004-unvalidated-webhook-event-type.md": "676dc47739de188ef44315be88745dd23c0b72fbed90b461b7865aadba1ff8dd",
|
|
128
129
|
"rules/websocket/TG-WS-001-unauthenticated-websocket-handshake.md": "b700f08ae47d12f9ed014905c04a4542fcb1bdc34064fb8eb01168f92f5752ae",
|
|
129
|
-
"rules/websocket/TG-WS-002-missing-channel-level-authorization.md": "
|
|
130
|
-
"rules/websocket/TG-WS-003-unvalidated-websocket-message.md": "
|
|
131
|
-
"rules/websocket/TG-WS-004-unbounded-websocket-connections.md": "
|
|
130
|
+
"rules/websocket/TG-WS-002-missing-channel-level-authorization.md": "7a6a4be54c8fad3575bfa1bef02960285ec304f0021bdb22c586e238ad026c0d",
|
|
131
|
+
"rules/websocket/TG-WS-003-unvalidated-websocket-message.md": "f593e1f7fa3678150f1fcfa368c6f3b741cd236de19f15cb340bb906e12ba9ce",
|
|
132
|
+
"rules/websocket/TG-WS-004-unbounded-websocket-connections.md": "e700a0fddd7febf8c520bf0e5c5d4c3a2fb1d29d46dabaeb7bf982b95404e0c1",
|
|
132
133
|
"schemas/authorization.schema.json": "84885c9edc930a22c777d8685219f1f25b5320c0c6062722e3ba09f1fe417ad4",
|
|
133
134
|
"schemas/confidence.schema.json": "09c5098f55f3936e9231ba417ace4fa7aa9ebc49233b4bfa88a4103ef6f1202c",
|
|
134
135
|
"schemas/evidence.schema.json": "7dff029c34965e9aeee932028d11bf30d4f3ff76f8137af382bf3d3dc2c0df10",
|
|
@@ -141,23 +142,25 @@
|
|
|
141
142
|
"schemas/remediation.schema.json": "544904239f871dec9552973e01e09dc1f40dbb8330f20d98c319f3b24031d630",
|
|
142
143
|
"schemas/retest.schema.json": "97c0407ca4365a524020c430912f686f698cc0de90043194621071e9fc681cc7",
|
|
143
144
|
"schemas/runtime-evidence.schema.json": "929d2b094c1cd1f7f9db07be1eba5994e8002477eab3fd24140e1e973fd18cc1",
|
|
144
|
-
"scripts/apply_runner.py": "
|
|
145
|
-
"scripts/audit_runner.py": "
|
|
145
|
+
"scripts/apply_runner.py": "3863c894d0a57f4a71206dca802b26755f361958f085b4636f112350bde221a2",
|
|
146
|
+
"scripts/audit_runner.py": "bdf4784ebec526a6f980879ce80aa7693ad2a8268fd4fa0334130ac3c1a7b22a",
|
|
146
147
|
"scripts/diff_guard.py": "0dc178cdde1ac0ae1a1ea4b2eb2ce1756b2126f6156909cf55d85249f115fcbd",
|
|
147
|
-
"scripts/finding_scorer.py": "
|
|
148
|
-
"scripts/harden_runner.py": "
|
|
149
|
-
"scripts/html_reporter.py": "
|
|
148
|
+
"scripts/finding_scorer.py": "a5315be6ee256c01c4539da3d1905ebc8d0840a356b83c55f9f6f2654a9f0c60",
|
|
149
|
+
"scripts/harden_runner.py": "c7a8074eaa9f6ebe61a17c553fd07bb543efcb1d5b4e01f24fd856367c048a70",
|
|
150
|
+
"scripts/html_reporter.py": "30982f279b501834009159d7142624c973f36f2517b884a0ce4868d7ca42d1f3",
|
|
150
151
|
"scripts/manifest_builder.py": "c0137927789a9e40a08243e630ac3c6990beb1b87807934e98906c8ad0b99a97",
|
|
151
152
|
"scripts/memory_engine.py": "b715d0ca030e95eb06ad6eda99027535df8a7e37d64897c023be6a291cf13dc6",
|
|
152
153
|
"scripts/monorepo_detector.py": "5603674136a5294ebfff89efeca0a546dd4a7deb1d184a2592ff21aff2131f73",
|
|
153
|
-
"scripts/recheck_runner.py": "
|
|
154
|
-
"scripts/recipes_runner.py": "
|
|
154
|
+
"scripts/recheck_runner.py": "0c51d91b37bd3babf228b4b12b0e9d65953c8eae2e2e46596a1d42af8d057f71",
|
|
155
|
+
"scripts/recipes_runner.py": "cd9ffba5fed53057aac56241dcbfda1e68248f323e51bbde3fe711634b099600",
|
|
156
|
+
"scripts/report_sync.py": "278666954207a9eef1d479872546b99c16a8ded46bd3238ac9a09e2856b69813",
|
|
155
157
|
"scripts/rules_sync.py": "4101b2ca8036ff4f468800b32a8d08898e8640a74d14124af53d454706a62d3a",
|
|
156
158
|
"scripts/run_manager.py": "b738ff70879e46547d32fac6befc61de9599f676411384280fb9819ea3ad7035",
|
|
157
159
|
"scripts/safety_gate.py": "3379b7534b2590cf563717a448983ad8ed7e8f174f0ad65683d33e8a10f51558",
|
|
158
|
-
"scripts/sarif_exporter.py": "
|
|
159
|
-
"scripts/stack_detect.py": "
|
|
160
|
-
"
|
|
160
|
+
"scripts/sarif_exporter.py": "f060cfaf91dfb6b8e9c4036e354704204dfa8054720501f0ce2fadae0fb89540",
|
|
161
|
+
"scripts/stack_detect.py": "3f755d9353d5a8fd33a25486d6af0101a1d1b0c2f70f5a28bb2af2fe6050adc2",
|
|
162
|
+
"scripts/term_ui.py": "4870714add208f3da53c76a1250b1ceb8c104c0b708384e73427210dd0b50e6a",
|
|
163
|
+
"skills/torusguard/SKILL.md": "3e63aaa90f5453ba2b7ea79ed6afbd64985fb083d198a34d552857abb2f183f4",
|
|
161
164
|
"skills/torusguard/bootstrap.py": "3d946f388cb4befa739c9d3b1404255d9a8ea5770ebbb79e5a1b9839589e9bc7",
|
|
162
165
|
"skills/torusguard/references/auth-and-sessions.md": "c3e4b9600cb53fc28c993922dc880accbec5783ac90d5ee98d63b52762d19525",
|
|
163
166
|
"skills/torusguard/references/business-logic-and-abuse.md": "58e87df2864d468af70c1ff39f5d540c687fa846b671457f85046ab2065fe99c",
|
|
@@ -187,32 +190,32 @@
|
|
|
187
190
|
"skills/torusguard/references/ssrf-and-outbound-requests.md": "5ce59ebada2f227b3e0a27f612b59a47801c152d24d2d4d533bee435f32b1b05",
|
|
188
191
|
"skills/torusguard/references/webhook-security.md": "8fd27cce1562a3dfda8d4fae29bef7cfd47a65c1e89c6868cdbcac161ccd2be8",
|
|
189
192
|
"skills/torusguard/references/websocket-security.md": "b5315e49432184c006664436d689d426b7322fc6fbbba2899a9ea5e5bab74c92",
|
|
190
|
-
"skills/torusguard-apply/SKILL.md": "
|
|
191
|
-
"skills/torusguard-audit/SKILL.md": "
|
|
192
|
-
"skills/torusguard-authorize/SKILL.md": "
|
|
193
|
-
"skills/torusguard-exploit-check/SKILL.md": "
|
|
194
|
-
"skills/torusguard-full/SKILL.md": "
|
|
195
|
-
"skills/torusguard-harden/SKILL.md": "
|
|
196
|
-
"skills/torusguard-init/SKILL.md": "
|
|
197
|
-
"skills/torusguard-recheck/SKILL.md": "
|
|
198
|
-
"skills/torusguard-report/SKILL.md": "
|
|
199
|
-
"skills/torusguard-status/SKILL.md": "
|
|
200
|
-
"skills/torusguard-verify/SKILL.md": "
|
|
201
|
-
"skills/torusguard-web-validate/SKILL.md": "
|
|
193
|
+
"skills/torusguard-apply/SKILL.md": "453e1099ce3ae2184ae7bba34156cdafc6437976283e3839bef1c014bbc4bd9a",
|
|
194
|
+
"skills/torusguard-audit/SKILL.md": "b8e2d0058bce604a00fee93055112b3872290373e8b90d95b3414ce2c33bf9d9",
|
|
195
|
+
"skills/torusguard-authorize/SKILL.md": "67051f2db03f1957a63c10e6d39c963561c9c93f2c0c2e3289e936fe85b70da5",
|
|
196
|
+
"skills/torusguard-exploit-check/SKILL.md": "7b040abfc10e6aedd56a432247b5c36c4872966b2bf363e56c5ae393db825e23",
|
|
197
|
+
"skills/torusguard-full/SKILL.md": "f225de0e29d46f96fc0735e310394313dfecc987be430af14504498fc90847de",
|
|
198
|
+
"skills/torusguard-harden/SKILL.md": "11039ce21f6990d7b15c176e0aefb5ee6d7631ab083391e3442c1020d5cae956",
|
|
199
|
+
"skills/torusguard-init/SKILL.md": "89518de3585f4016b1e2ff6400979dcd7362c4b4f93fbdabd72e3ff4a59ba4d5",
|
|
200
|
+
"skills/torusguard-recheck/SKILL.md": "d839251dbe5571769da0d4ae3ff2ef18533ee96f87bf460b44bb51279866be22",
|
|
201
|
+
"skills/torusguard-report/SKILL.md": "f361f2e61141a4d0cea891da827146c3fce42b8b55c81d60d0ac999312e4d6cd",
|
|
202
|
+
"skills/torusguard-status/SKILL.md": "e14ab6276207bf4921749ec38a4c4b0bf482e84010a4e1b7c2b6f8ce7804f047",
|
|
203
|
+
"skills/torusguard-verify/SKILL.md": "f9aff4ca514e72883ac630245b6f3b62e035a9e54bdbe69ae8edb59bd9153691",
|
|
204
|
+
"skills/torusguard-web-validate/SKILL.md": "006d638d9d6f7ee5f9eb880704955f01eff1c3b9bb3baa8ac900fd807f6f589a",
|
|
202
205
|
"templates/audit-report.template.md": "71149dd05b01a74287a47781fdc71fd2d1b4b70337da303bf78767d0410a6c90",
|
|
203
206
|
"templates/authorization.template.md": "81ef843d42a19412c369f383b787465ac24173c0b14c1f5f211786eab3d10e8b",
|
|
204
207
|
"templates/finding-card.template.md": "8f756edbd3e4139d3da2fb96f35bd2d2b267b33b754f187b590a89584265c1e6",
|
|
205
208
|
"templates/remediation-bundle.template.md": "4d85a540e3a2e74f9b21fc8a2a1072e27ca03e97cd67ca482f529cfe722acc4d",
|
|
206
|
-
"workflows/apply.md": "
|
|
207
|
-
"workflows/audit.md": "
|
|
208
|
-
"workflows/authorize.md": "
|
|
209
|
-
"workflows/exploit-check.md": "
|
|
210
|
-
"workflows/harden.md": "
|
|
211
|
-
"workflows/init.md": "
|
|
212
|
-
"workflows/memory.md": "
|
|
213
|
-
"workflows/recheck.md": "
|
|
214
|
-
"workflows/report.md": "
|
|
215
|
-
"workflows/status.md": "
|
|
216
|
-
"workflows/verify.md": "
|
|
217
|
-
"workflows/web-validate.md": "
|
|
209
|
+
"workflows/apply.md": "fde7e879db5879bc6c8e67b5bd40473065688bba91149a01f66ad4739f4c8443",
|
|
210
|
+
"workflows/audit.md": "b02a7d2536c81b35ab4519b7f9eda3396d08f09da581ef299dc8fed83b4c082d",
|
|
211
|
+
"workflows/authorize.md": "71b14c2ffa24b1ad511d019a7da86854bf1bf94c282f563e05e9ad3b8493e8ca",
|
|
212
|
+
"workflows/exploit-check.md": "01c0a51e4b12a9dbb1d4f2b28d0bb495d92f95b786f5f1df59467b8fc6c61855",
|
|
213
|
+
"workflows/harden.md": "e68a78c47a2c4ec1d65adb08104d2fa16eb0c4530cf9b78400fd147f2076fb95",
|
|
214
|
+
"workflows/init.md": "f71438745a7e8d59dcf2e1089f7c5ccf2340e7909e56e1257b24c8ca79353162",
|
|
215
|
+
"workflows/memory.md": "faf93f39917fb6d0da23f9794e8337e643fd0a240cc46ca702fef84e02f5b867",
|
|
216
|
+
"workflows/recheck.md": "426a719a9c4233a653daa8fe0265370492f3a17a422517f7930549c991d25c93",
|
|
217
|
+
"workflows/report.md": "2aad2cbf2ffc781355e1186bb28a29b3da5efbacc57c8f44c9976aa635f0b120",
|
|
218
|
+
"workflows/status.md": "f3445bbf90402df819472180d5ae251a17b4f491ea3402d74f134bf55c2bf570",
|
|
219
|
+
"workflows/verify.md": "48f37892d329287059492ffaebf7022253fd5515a0a1a3253799e5cea765a21a",
|
|
220
|
+
"workflows/web-validate.md": "4d81294432e4d06e6c21db9a517b7cf1052744df3d821ed947a7751acb4fe39f"
|
|
218
221
|
}
|
|
@@ -1,37 +1,53 @@
|
|
|
1
1
|
# TG-BIZ-001: Client-Controlled Sensitive Business Value
|
|
2
2
|
|
|
3
3
|
## Severity
|
|
4
|
-
|
|
4
|
+
Critical. Relying on client-submitted values for critical financial, authorization, or pricing attributes allows malicious users to manipulate monetary amounts, discounts, or permissions.
|
|
5
5
|
|
|
6
6
|
## Applies To
|
|
7
|
-
-
|
|
7
|
+
- E-Commerce Checkout, Payment Handlers, Subscription APIs
|
|
8
|
+
- Node.js (Express, NestJS, Next.js), Python (FastAPI, Django, Flask), Go, Java, C#
|
|
8
9
|
|
|
9
10
|
## Why It Matters
|
|
10
|
-
|
|
11
|
+
When client requests directly dictate sensitive pricing or balance fields (such as `amount`, `unit_price`, `discount_percent`, or `credit_balance`), attackers can tamper with request payloads to purchase items at arbitrary prices ($0.01) or grant themselves unearned credits.
|
|
11
12
|
|
|
12
13
|
## What TorusGuard Looks For
|
|
13
|
-
-
|
|
14
|
+
- Destructuring sensitive price or discount attributes directly from `req.body` or `request.data` into payment gateways or order creation queries.
|
|
15
|
+
- Absence of server-side database lookup for product prices prior to charge generation.
|
|
14
16
|
|
|
15
17
|
## Unsafe Example
|
|
16
18
|
```javascript
|
|
17
|
-
//
|
|
19
|
+
// UNSAFE: Directly trusting price and amount from client payload
|
|
20
|
+
app.post('/api/checkout', async (req, res) => {
|
|
21
|
+
const { productId, price, quantity } = req.body;
|
|
22
|
+
const total = price * quantity; // Attacker sends price: 0.01
|
|
23
|
+
await paymentGateway.charge({ amount: total });
|
|
24
|
+
});
|
|
18
25
|
```
|
|
19
26
|
|
|
20
27
|
## Safe Example
|
|
21
28
|
```javascript
|
|
22
|
-
//
|
|
29
|
+
// SAFE: Fetching canonical price from authoritative server database
|
|
30
|
+
app.post('/api/checkout', async (req, res) => {
|
|
31
|
+
const { productId, quantity } = req.body;
|
|
32
|
+
const product = await db.product.findUnique({ where: { id: productId } });
|
|
33
|
+
if (!product) return res.status(404).json({ error: 'Product not found' });
|
|
34
|
+
const total = product.price * quantity;
|
|
35
|
+
await paymentGateway.charge({ amount: total });
|
|
36
|
+
});
|
|
23
37
|
```
|
|
24
38
|
|
|
39
|
+
## Ponytail Remediation Budget
|
|
40
|
+
- Additions: <= 12 lines
|
|
41
|
+
- Deletions: <= 4 lines
|
|
42
|
+
|
|
25
43
|
## Remediation
|
|
26
|
-
1.
|
|
27
|
-
2.
|
|
44
|
+
1. Remove sensitive pricing and discount parameters from incoming client request schemas.
|
|
45
|
+
2. Query the authoritative server database or catalog for the verified unit price.
|
|
46
|
+
3. Calculate subtotal, taxes, and final charge amounts exclusively on the trusted server.
|
|
28
47
|
|
|
29
48
|
## Verification
|
|
30
|
-
-
|
|
31
|
-
- Test case 2
|
|
32
|
-
|
|
33
|
-
## False Positives and Exceptions
|
|
34
|
-
An exception requires documented review.
|
|
49
|
+
- Submit a checkout payload with `price: 0.01` and verify the server rejects or ignores the parameter and bills the canonical catalog price.
|
|
35
50
|
|
|
36
51
|
## Related Rules
|
|
37
|
-
- TG-
|
|
52
|
+
- `TG-INPUT-001`: Missing Request Body Validation Schema
|
|
53
|
+
- `TG-BIZ-004`: Unrestricted Sensitive Business Workflow
|
package/skills/torusguard/payload/rules/business-logic/TG-BIZ-002-replayable-one-time-operation.md
CHANGED
|
@@ -1,37 +1,54 @@
|
|
|
1
1
|
# TG-BIZ-002: Replayable One-Time Operation
|
|
2
2
|
|
|
3
3
|
## Severity
|
|
4
|
-
High
|
|
4
|
+
High. Lack of idempotent tokens, nonces, or single-use consumption flags allows attackers or network retries to execute financial charges, coupon redemptions, or password resets multiple times.
|
|
5
5
|
|
|
6
6
|
## Applies To
|
|
7
|
-
-
|
|
7
|
+
- Coupon Redemptions, Financial Transfers, Voucher APIs, Password Reset Consumptions
|
|
8
|
+
- Node.js, Python, Go, Java, C#
|
|
8
9
|
|
|
9
10
|
## Why It Matters
|
|
10
|
-
|
|
11
|
+
Transient network glitches, automated retry loops, or intentional race condition attacks (TOCTOU) can submit duplicate requests. Without single-use atomic locking, a user can redeem a $50 gift card 10 times concurrently.
|
|
11
12
|
|
|
12
13
|
## What TorusGuard Looks For
|
|
13
|
-
-
|
|
14
|
+
- State-changing transaction handlers lacking idempotency keys, single-use nonce validation, or atomic database lock transactions (`SELECT ... FOR UPDATE`).
|
|
14
15
|
|
|
15
16
|
## Unsafe Example
|
|
16
|
-
```
|
|
17
|
-
|
|
17
|
+
```python
|
|
18
|
+
# UNSAFE: Checking balance and deducting without atomic idempotency lock
|
|
19
|
+
@app.post("/api/redeem-coupon")
|
|
20
|
+
def redeem_coupon(code: str, user_id: str):
|
|
21
|
+
coupon = db.query(Coupon).filter_by(code=code, used=False).first()
|
|
22
|
+
if coupon:
|
|
23
|
+
apply_credit(user_id, coupon.amount)
|
|
24
|
+
coupon.used = True
|
|
25
|
+
db.commit()
|
|
18
26
|
```
|
|
19
27
|
|
|
20
28
|
## Safe Example
|
|
21
|
-
```
|
|
22
|
-
|
|
29
|
+
```python
|
|
30
|
+
# SAFE: Atomic database update with idempotency check
|
|
31
|
+
@app.post("/api/redeem-coupon")
|
|
32
|
+
def redeem_coupon(code: str, user_id: str, idempotency_key: str):
|
|
33
|
+
with db.begin():
|
|
34
|
+
rows = db.query(Coupon).filter_by(code=code, used=False).update({"used": True})
|
|
35
|
+
if rows == 0:
|
|
36
|
+
raise HTTPException(status_code=400, detail="Coupon already redeemed")
|
|
37
|
+
apply_credit(user_id, coupon.amount)
|
|
23
38
|
```
|
|
24
39
|
|
|
40
|
+
## Ponytail Remediation Budget
|
|
41
|
+
- Additions: <= 14 lines
|
|
42
|
+
- Deletions: <= 5 lines
|
|
43
|
+
|
|
25
44
|
## Remediation
|
|
26
|
-
1.
|
|
27
|
-
2.
|
|
45
|
+
1. Require an `Idempotency-Key` header on all sensitive mutations.
|
|
46
|
+
2. Execute state-changing consumption operations inside atomic database transactions with row-level locks.
|
|
47
|
+
3. Mark vouchers or tokens as `consumed` in the same atomic operation before dispatching external side-effects.
|
|
28
48
|
|
|
29
49
|
## Verification
|
|
30
|
-
-
|
|
31
|
-
- Test case 2
|
|
32
|
-
|
|
33
|
-
## False Positives and Exceptions
|
|
34
|
-
An exception requires documented review.
|
|
50
|
+
- Send 5 concurrent identical redemption requests with the same coupon code; assert exactly 1 succeeds (200 OK) and 4 fail (400/409 Conflict).
|
|
35
51
|
|
|
36
52
|
## Related Rules
|
|
37
|
-
- TG-
|
|
53
|
+
- `TG-WEBHOOK-003`: Missing Webhook Idempotency
|
|
54
|
+
- `TG-BIZ-003`: Missing Workflow State Validation
|
|
@@ -1,37 +1,53 @@
|
|
|
1
|
-
# TG-BIZ-003: Missing Workflow
|
|
1
|
+
# TG-BIZ-003: Missing Workflow State Validation
|
|
2
2
|
|
|
3
3
|
## Severity
|
|
4
|
-
High
|
|
4
|
+
High. Skipping validation of intermediate business lifecycle states allows users to bypass mandatory verification, payment, or approval steps.
|
|
5
5
|
|
|
6
6
|
## Applies To
|
|
7
|
-
-
|
|
7
|
+
- Order Processing, Multi-Step Onboarding, Approval Pipelines, KYC Verification
|
|
8
|
+
- Node.js, Python, Go, Java, C#
|
|
8
9
|
|
|
9
10
|
## Why It Matters
|
|
10
|
-
|
|
11
|
+
When endpoints assume prerequisite stages were completed without strictly querying the current entity state, malicious actors can invoke late-stage endpoints directly (e.g. calling `/api/orders/{id}/fulfill` on an order whose state is `PENDING_PAYMENT`).
|
|
11
12
|
|
|
12
13
|
## What TorusGuard Looks For
|
|
13
|
-
-
|
|
14
|
+
- State transitions (`status = 'SHIPPED'`, `status = 'APPROVED'`) executed without asserting that current status matches required prior state (`where: { status: 'PAID' }`).
|
|
14
15
|
|
|
15
16
|
## Unsafe Example
|
|
16
17
|
```javascript
|
|
17
|
-
//
|
|
18
|
+
// UNSAFE: Transitioning order to fulfilled without checking current status
|
|
19
|
+
app.post('/api/orders/:id/fulfill', async (req, res) => {
|
|
20
|
+
await db.order.update({
|
|
21
|
+
where: { id: req.params.id },
|
|
22
|
+
data: { status: 'FULFILLED' }
|
|
23
|
+
});
|
|
24
|
+
});
|
|
18
25
|
```
|
|
19
26
|
|
|
20
27
|
## Safe Example
|
|
21
28
|
```javascript
|
|
22
|
-
//
|
|
29
|
+
// SAFE: Atomic conditional transition verifying prerequisite state
|
|
30
|
+
app.post('/api/orders/:id/fulfill', async (req, res) => {
|
|
31
|
+
const result = await db.order.updateMany({
|
|
32
|
+
where: { id: req.params.id, status: 'PAID' },
|
|
33
|
+
data: { status: 'FULFILLED' }
|
|
34
|
+
});
|
|
35
|
+
if (result.count === 0) return res.status(400).json({ error: 'Order not ready for fulfillment' });
|
|
36
|
+
});
|
|
23
37
|
```
|
|
24
38
|
|
|
39
|
+
## Ponytail Remediation Budget
|
|
40
|
+
- Additions: <= 10 lines
|
|
41
|
+
- Deletions: <= 4 lines
|
|
42
|
+
|
|
25
43
|
## Remediation
|
|
26
|
-
1.
|
|
27
|
-
2.
|
|
44
|
+
1. Define a strict state machine with allowable transitions.
|
|
45
|
+
2. Enforce atomic conditional updates asserting the expected source state.
|
|
46
|
+
3. Return 400 or 409 errors when an invalid transition is attempted.
|
|
28
47
|
|
|
29
48
|
## Verification
|
|
30
|
-
-
|
|
31
|
-
- Test case 2
|
|
32
|
-
|
|
33
|
-
## False Positives and Exceptions
|
|
34
|
-
An exception requires documented review.
|
|
49
|
+
- Attempt to fulfill an unpaid order; confirm 400 rejection.
|
|
35
50
|
|
|
36
51
|
## Related Rules
|
|
37
|
-
- TG-
|
|
52
|
+
- `TG-BIZ-001`: Client-Controlled Sensitive Business Value
|
|
53
|
+
- `TG-AUTH-003`: Missing Object-Level Authorization
|