@mmerterden/multi-agent-pipeline 20.37.1 → 20.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +98 -49
- package/README.md +12 -10
- package/README.tr.md +12 -10
- package/docs/adr/0006-skills-core-external-split.md +5 -5
- package/docs/adr/0010-own-code-graph.md +6 -7
- package/docs/adr/0013-lsp-code-intelligence.md +6 -8
- package/docs/adr/0017-change-impact-from-the-graph.md +4 -5
- package/docs/adr/0018-cross-repo-links-not-a-global-graph.md +1 -1
- package/docs/adr/README.md +1 -1
- package/docs/ecosystem.md +53 -41
- package/docs/facts.json +15 -13
- package/docs/features.md +1 -1
- package/install/_dev-only-files.mjs +3 -0
- package/install/_platform-filter.mjs +1 -23
- package/install/catalog-history.json +1 -1
- package/install/claude.mjs +8 -1
- package/install/codex.mjs +0 -2
- package/install/copilot.mjs +0 -2
- package/install/templates/claude-hooks.json +47 -1
- package/manifest.json +429 -311
- package/package.json +5 -2
- package/pipeline/agents/security-auditor.md +58 -6
- package/pipeline/commands/multi-agent/build-optimize/SKILL.md +1 -2
- package/pipeline/commands/multi-agent/complaint-analysis/SKILL.md +1 -1
- package/pipeline/commands/multi-agent/design-check/SKILL.md +1 -1
- package/pipeline/commands/multi-agent/graph/SKILL.md +12 -3
- package/pipeline/commands/multi-agent/research/SKILL.md +2 -2
- package/pipeline/commands/multi-agent/search/SKILL.md +10 -1
- package/pipeline/commands/multi-agent/security-review/SKILL.md +4 -0
- package/pipeline/commands/multi-agent/setup/SKILL.md +1 -0
- package/pipeline/commands/multi-agent/stack/SKILL.md +8 -0
- package/pipeline/commands/multi-agent/store-ready/SKILL.md +1 -1
- package/pipeline/commands/sim-test.md +34 -1
- package/pipeline/lib/context-budget.mjs +103 -0
- package/pipeline/lib/credential-inventory.sh +2 -3
- package/pipeline/lib/identifier-scan.mjs +145 -0
- package/pipeline/lib/outbound-gate.mjs +28 -1
- package/pipeline/lib/unattended-profile-check.mjs +13 -4
- package/pipeline/multi-agent-refs/analysis/locked.md +1 -1
- package/pipeline/multi-agent-refs/analysis/redesign.md +17 -3
- package/pipeline/multi-agent-refs/analysis-template-corporate.md +8 -4
- package/pipeline/multi-agent-refs/analysis-template.md +7 -5
- package/pipeline/multi-agent-refs/complaint-analysis/phases.md +1 -0
- package/pipeline/multi-agent-refs/features/autopilot-circuit-breaker.md +1 -1
- package/pipeline/multi-agent-refs/features/code-graph.md +25 -0
- package/pipeline/multi-agent-refs/features/design-conformance.md +20 -4
- package/pipeline/multi-agent-refs/features/free-models.md +10 -3
- package/pipeline/multi-agent-refs/features/research.md +4 -3
- package/pipeline/multi-agent-refs/features/security-audit.md +25 -3
- package/pipeline/multi-agent-refs/features/unattended-security.md +20 -0
- package/pipeline/multi-agent-refs/help/en.md +15 -9
- package/pipeline/multi-agent-refs/help/tr.md +15 -9
- package/pipeline/multi-agent-refs/knowledge.md +17 -0
- package/pipeline/multi-agent-refs/outside-the-pipeline.md +9 -0
- package/pipeline/multi-agent-refs/phases/log-format.md +5 -0
- package/pipeline/multi-agent-refs/phases/operations.md +3 -5
- package/pipeline/multi-agent-refs/picker-contract.md +1 -1
- package/pipeline/multi-agent-refs/research/engine.md +2 -1
- package/pipeline/multi-agent-refs/setup/free-models.md +10 -0
- package/pipeline/multi-agent-refs/store-ready/gate-3-policy.md +15 -0
- package/pipeline/multi-agent-refs/web-guide.md +2 -1
- package/pipeline/office/index.html +3 -7
- package/pipeline/office/toolkit.json +1 -1
- package/pipeline/rules/outside-the-pipeline.md +1 -1
- package/pipeline/schemas/learnings-ledger.schema.json +7 -2
- package/pipeline/schemas/prefs.schema.json +16 -3
- package/pipeline/schemas/reviewer-output.schema.json +113 -5
- package/pipeline/schemas/secret-patterns.json +49 -0
- package/pipeline/schemas/security-finding.schema.json +49 -5
- package/pipeline/scripts/_code-graph.mjs +3 -3
- package/pipeline/scripts/_graph-analysis.mjs +51 -0
- package/pipeline/scripts/_memory-policy.mjs +11 -3
- package/pipeline/scripts/_secret-scan.mjs +1 -1
- package/pipeline/scripts/_skill-practices.mjs +178 -0
- package/pipeline/scripts/_stack-routing.mjs +1 -0
- package/pipeline/scripts/autopilot-runner.mjs +8 -3
- package/pipeline/scripts/build-stack-plugins.mjs +8 -44
- package/pipeline/scripts/capture-resume.sh +19 -0
- package/pipeline/scripts/file-context.mjs +306 -70
- package/pipeline/scripts/gen-skills-index.mjs +1 -1
- package/pipeline/scripts/graph-hint.mjs +197 -0
- package/pipeline/scripts/graph-hint.sh +20 -0
- package/pipeline/scripts/graph-query.mjs +306 -11
- package/pipeline/scripts/graph-report.mjs +29 -1
- package/pipeline/scripts/learnings-ledger.mjs +71 -15
- package/pipeline/scripts/note-agent-event.mjs +160 -0
- package/pipeline/scripts/note-agent-event.sh +19 -0
- package/pipeline/scripts/parity-score.mjs +139 -0
- package/pipeline/scripts/pre-commit-check.sh +25 -4
- package/pipeline/scripts/pre-push-check.sh +3 -0
- package/pipeline/scripts/repo-recommend.mjs +321 -0
- package/pipeline/scripts/scan-agent-config.sh +1 -2
- package/pipeline/scripts/security-evidence-gate.mjs +282 -0
- package/pipeline/scripts/unattended_policy.py +3 -2
- package/pipeline/scripts/validate-analysis-doc.mjs +17 -1
- package/pipeline/skills/.skill-manifest.json +72 -68
- package/pipeline/skills/shared/README.md +41 -40
- package/pipeline/skills/shared/core/apple-archive-compliance/SKILL.md +6 -6
- package/pipeline/skills/shared/core/apple-archive-compliance/references/examples.md +1 -1
- package/pipeline/skills/shared/core/apple-archive-compliance/references/version-history.md +1 -1
- package/pipeline/skills/shared/core/google-play-compliance/SKILL.md +1 -1
- package/pipeline/skills/shared/core/google-play-compliance/references/notes.md +1 -1
- package/pipeline/skills/shared/core/multi-agent/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-build-optimize/SKILL.md +0 -1
- package/pipeline/skills/shared/core/multi-agent-complaint-analysis/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-design-check/SKILL.md +5 -5
- package/pipeline/skills/shared/core/multi-agent-graph/SKILL.md +10 -0
- package/pipeline/skills/shared/core/multi-agent-research/SKILL.md +2 -2
- package/pipeline/skills/shared/core/multi-agent-search/SKILL.md +9 -0
- package/pipeline/skills/shared/core/multi-agent-security-review/SKILL.md +3 -2
- package/pipeline/skills/shared/core/multi-agent-setup/SKILL.md +1 -0
- package/pipeline/skills/shared/core/multi-agent-stack/SKILL.md +8 -0
- package/pipeline/skills/shared/core/multi-agent-store-ready/SKILL.md +4 -3
- package/pipeline/skills/shared/core/multi-agent-test/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-test-accessibility/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-test-dark-mode/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-test-dynamic-type/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-test-gen/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-test-screenshots/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-testflight-validation/SKILL.md +2 -2
- package/pipeline/skills/shared/external/accessibility-compliance-accessibility-audit/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/agent-introspection-debugging/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/android-architecture/SKILL.md +1 -1
- package/pipeline/skills/shared/external/android-architecture/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/android-build-quality-gates/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/android-datastore/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/android-design-tokens-codegen/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/android-jetpack-compose-expert/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/android-mvi-viewmodel/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/android-performance/SKILL.md +1 -1
- package/pipeline/skills/shared/external/android-performance/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/android-security/SKILL.md +1 -1
- package/pipeline/skills/shared/external/android-security/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/api-patterns/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/api-security-best-practices/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/app-store-changelog/SKILL.md +65 -49
- package/pipeline/skills/shared/external/app-store-changelog/evals/evals.json +40 -0
- package/pipeline/skills/shared/external/app-store-changelog/references/release-notes-guidelines.md +64 -34
- package/pipeline/skills/shared/external/app-store-changelog/scripts/collect_release_changes.sh +21 -23
- package/pipeline/skills/shared/external/app-store-optimization/SKILL.md +4 -1
- package/pipeline/skills/shared/external/app-store-review/SKILL.md +6 -0
- package/pipeline/skills/shared/external/architecture/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/backlog/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/ci-cd-pipelines/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/clean-code/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/compose-components/SKILL.md +1 -1
- package/pipeline/skills/shared/external/compose-components/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/compose-navigation/SKILL.md +1 -1
- package/pipeline/skills/shared/external/compose-navigation/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/compose-testing/SKILL.md +1 -1
- package/pipeline/skills/shared/external/compose-testing/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/context-compression/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/core-data/SKILL.md +1 -1
- package/pipeline/skills/shared/external/council/evals/evals.json +41 -0
- package/pipeline/skills/shared/external/css-modern/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/css-modern/references/code-examples.md +5 -0
- package/pipeline/skills/shared/external/database-patterns/evals/evals.json +46 -0
- package/pipeline/skills/shared/external/database-patterns/references/orm-examples.md +5 -0
- package/pipeline/skills/shared/external/debugging-strategies/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/docker-expert/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/e2e-testing/SKILL.md +21 -21
- package/pipeline/skills/shared/external/e2e-testing/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/e2e-testing/references/document-fixtures.md +5 -5
- package/pipeline/skills/shared/external/evidence-github/evals/evals.json +41 -0
- package/pipeline/skills/shared/external/evidence-registry/SKILL.md +1 -1
- package/pipeline/skills/shared/external/evidence-registry/evals/evals.json +41 -0
- package/pipeline/skills/shared/external/fastapi-pro/evals/evals.json +57 -0
- package/pipeline/skills/shared/external/firebase/SKILL.md +132 -54
- package/pipeline/skills/shared/external/firebase/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/firebase/references/functions-and-products.md +51 -0
- package/pipeline/skills/shared/external/firebase/references/security-rules.md +59 -0
- package/pipeline/skills/shared/external/fix-review-verdicts/evals/evals.json +57 -0
- package/pipeline/skills/shared/external/free-llm-apis/SKILL.md +70 -0
- package/pipeline/skills/shared/external/free-llm-apis/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/free-llm-apis/references/providers.md +33 -0
- package/pipeline/skills/shared/external/github-actions-templates/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/gradle-kotlin-dsl/SKILL.md +1 -1
- package/pipeline/skills/shared/external/gradle-kotlin-dsl/evals/evals.json +58 -0
- package/pipeline/skills/shared/external/handle-request/SKILL.md +2 -2
- package/pipeline/skills/shared/external/handle-request/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/hig-app-icons/SKILL.md +2 -2
- package/pipeline/skills/shared/external/hig-app-icons/references/icon-workflow.md +1 -1
- package/pipeline/skills/shared/external/hig-components-content/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/hig-components-status/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/hig-components-system/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/hig-inputs/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/hig-patterns/evals/evals.json +46 -0
- package/pipeline/skills/shared/external/hig-platforms/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/hig-technologies/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/html-semantic/evals/evals.json +46 -0
- package/pipeline/skills/shared/external/humanizer/evals/evals.json +46 -0
- package/pipeline/skills/shared/external/ios-coding-standard/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/ios-debugger-agent/SKILL.md +91 -52
- package/pipeline/skills/shared/external/ios-debugger-agent/evals/evals.json +41 -0
- package/pipeline/skills/shared/external/ios-design-review/SKILL.md +12 -12
- package/pipeline/skills/shared/external/ios-design-review/references/appearance-matrix.md +16 -16
- package/pipeline/skills/shared/external/ios-design-review/references/checklist.md +1 -1
- package/pipeline/skills/shared/external/ios-iphone-duo/SKILL.md +0 -1
- package/pipeline/skills/shared/external/ios-module-structure/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/ios-security/SKILL.md +1 -1
- package/pipeline/skills/shared/external/ios-security/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/kotlin-coroutines-expert/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/localization-reuse-map/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/macos-menubar-tuist-app/SKILL.md +170 -74
- package/pipeline/skills/shared/external/macos-menubar-tuist-app/evals/evals.json +52 -0
- package/pipeline/skills/shared/external/macos-spm-app-packaging/SKILL.md +119 -77
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/bootstrap/Package.swift +5 -5
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/bootstrap/Sources/MyApp/MyApp.swift +24 -0
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/bootstrap/version.env +2 -0
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/build_icon.sh +46 -39
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/compile_and_run.sh +70 -49
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/launch.sh +24 -17
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/make_appcast.sh +74 -59
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/package_app.sh +201 -170
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/setup_dev_signing.sh +50 -42
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/sign-and-notarize.sh +65 -35
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/version.env +2 -0
- package/pipeline/skills/shared/external/macos-spm-app-packaging/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/macos-spm-app-packaging/references/packaging.md +49 -17
- package/pipeline/skills/shared/external/macos-spm-app-packaging/references/release.md +48 -23
- package/pipeline/skills/shared/external/macos-spm-app-packaging/references/scaffold.md +74 -44
- package/pipeline/skills/shared/external/monorepo-architect/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/nextjs-app-router/SKILL.md +14 -3
- package/pipeline/skills/shared/external/nextjs-app-router/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/nextjs-app-router/references/app-router-examples.md +3 -0
- package/pipeline/skills/shared/external/nodejs-backend-patterns/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/observability-engineer/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/passkit-wallet/SKILL.md +10 -0
- package/pipeline/skills/shared/external/photos-camera-media/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/play-store-review/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/python-patterns/evals/evals.json +46 -0
- package/pipeline/skills/shared/external/react-best-practices/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/rest-api-design/evals/evals.json +46 -0
- package/pipeline/skills/shared/external/retrofit-networking/SKILL.md +1 -1
- package/pipeline/skills/shared/external/retrofit-networking/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/room-database/SKILL.md +1 -1
- package/pipeline/skills/shared/external/room-database/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/scenario-gap-analysis/SKILL.md +1 -1
- package/pipeline/skills/shared/external/scenario-gap-analysis/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/search-first/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/security-review/SKILL.md +14 -3
- package/pipeline/skills/shared/external/security-review/evals/evals.json +48 -0
- package/pipeline/skills/shared/external/security-review/references/agentic-systems.md +93 -0
- package/pipeline/skills/shared/external/security-review/references/firebase-rules.md +100 -0
- package/pipeline/skills/shared/external/security-review/references/graphql.md +82 -0
- package/pipeline/skills/shared/external/security-review/references/llm-prompt-injection.md +93 -0
- package/pipeline/skills/shared/external/security-review/references/oauth-oidc.md +100 -0
- package/pipeline/skills/shared/external/security-review/references/owasp-mobile-top10-2024.md +1 -1
- package/pipeline/skills/shared/external/security-review/references/owasp-web-api-top10-2021.md +1 -1
- package/pipeline/skills/shared/external/security-review/references/supabase.md +73 -0
- package/pipeline/skills/shared/external/signal-community/SKILL.md +29 -10
- package/pipeline/skills/shared/external/signal-community/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/skill-creator/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/skill-creator/template.md +1 -3
- package/pipeline/skills/shared/external/spm-build-analysis/SKILL.md +80 -61
- package/pipeline/skills/shared/external/spm-build-analysis/evals/evals.json +56 -0
- package/pipeline/skills/shared/external/spm-build-analysis/references/build-optimization-sources.md +83 -133
- package/pipeline/skills/shared/external/spm-build-analysis/references/recommendation-format.md +41 -40
- package/pipeline/skills/shared/external/spm-build-analysis/references/spm-analysis-checks.md +89 -87
- package/pipeline/skills/shared/external/spm-build-analysis/scripts/check_spm_pins.py +90 -85
- package/pipeline/skills/shared/external/swift-concurrency-expert/SKILL.md +78 -69
- package/pipeline/skills/shared/external/swift-concurrency-expert/evals/evals.json +54 -0
- package/pipeline/skills/shared/external/swift-concurrency-expert/references/approachable-concurrency.md +52 -48
- package/pipeline/skills/shared/external/swift-concurrency-expert/references/swift-6-2-concurrency.md +118 -184
- package/pipeline/skills/shared/external/swift-concurrency-expert/references/swiftui-concurrency-tour-wwdc.md +68 -22
- package/pipeline/skills/shared/external/swift-concurrency-pro/SKILL.md +117 -94
- package/pipeline/skills/shared/external/swift-concurrency-pro/evals/evals.json +57 -0
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/actors.md +102 -97
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/async-streams.md +36 -37
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/bridging.md +82 -34
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/bug-patterns.md +90 -52
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/cancellation.md +55 -55
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/diagnostics.md +66 -43
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/hotspots.md +39 -23
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/interop.md +66 -68
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/new-features.md +152 -131
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/structured.md +60 -57
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/testing.md +131 -118
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/unstructured.md +37 -29
- package/pipeline/skills/shared/external/swift-formatstyle/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/swift-testing-pro/SKILL.md +77 -58
- package/pipeline/skills/shared/external/swift-testing-pro/evals/evals.json +59 -0
- package/pipeline/skills/shared/external/swift-testing-pro/references/async-tests.md +139 -144
- package/pipeline/skills/shared/external/swift-testing-pro/references/core-rules.md +90 -28
- package/pipeline/skills/shared/external/swift-testing-pro/references/migrating-from-xctest.md +38 -21
- package/pipeline/skills/shared/external/swift-testing-pro/references/new-features.md +139 -156
- package/pipeline/skills/shared/external/swift-testing-pro/references/writing-better-tests.md +173 -147
- package/pipeline/skills/shared/external/swiftdata-pro/SKILL.md +75 -59
- package/pipeline/skills/shared/external/swiftdata-pro/evals/evals.json +50 -0
- package/pipeline/skills/shared/external/swiftdata-pro/references/cloudkit.md +34 -7
- package/pipeline/skills/shared/external/swiftdata-pro/references/indexing.md +20 -14
- package/pipeline/skills/shared/external/swiftdata-pro/references/inheritance.md +127 -0
- package/pipeline/skills/shared/external/swiftdata-pro/references/model-rules.md +141 -0
- package/pipeline/skills/shared/external/swiftdata-pro/references/predicates.md +37 -44
- package/pipeline/skills/shared/external/swiftlint/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/swiftui-expert-skill/SKILL.md +89 -88
- package/pipeline/skills/shared/external/swiftui-expert-skill/evals/evals.json +55 -0
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/accessibility-patterns.md +104 -122
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/animation-advanced.md +73 -93
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/animation-basics.md +144 -169
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/animation-transitions.md +122 -133
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/charts-accessibility.md +141 -99
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/charts.md +273 -333
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/image-optimization.md +105 -128
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/latest-apis.md +199 -312
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/layout-best-practices.md +129 -169
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/liquid-glass.md +17 -30
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/list-patterns.md +198 -258
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/macos-scenes.md +145 -218
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/macos-views.md +150 -249
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/macos-window-styling.md +109 -208
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/performance-patterns.md +225 -271
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/scroll-patterns.md +117 -210
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/sheet-navigation-patterns.md +171 -237
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/state-management.md +196 -260
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/view-structure.md +167 -230
- package/pipeline/skills/shared/external/swiftui-gestures/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/swiftui-layout-components/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/swiftui-navigation/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/swiftui-navigation/references/navigationstack.md +1 -2
- package/pipeline/skills/shared/external/swiftui-patterns/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/swiftui-performance/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/swiftui-performance-audit/SKILL.md +71 -79
- package/pipeline/skills/shared/external/swiftui-performance-audit/evals/evals.json +55 -0
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/audit-layout.md +50 -0
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/capture-checklist.md +51 -0
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/hangs.md +34 -0
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/instruments-guide.md +68 -0
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/smell-catalog.md +191 -0
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/update-model.md +69 -0
- package/pipeline/skills/shared/external/swiftui-pro/SKILL.md +65 -63
- package/pipeline/skills/shared/external/swiftui-pro/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/swiftui-pro/references/accessibility.md +40 -13
- package/pipeline/skills/shared/external/swiftui-pro/references/api.md +74 -29
- package/pipeline/skills/shared/external/swiftui-pro/references/data.md +44 -24
- package/pipeline/skills/shared/external/swiftui-pro/references/design.md +45 -31
- package/pipeline/skills/shared/external/swiftui-pro/references/hygiene.md +17 -8
- package/pipeline/skills/shared/external/swiftui-pro/references/navigation.md +19 -9
- package/pipeline/skills/shared/external/swiftui-pro/references/performance.md +50 -34
- package/pipeline/skills/shared/external/swiftui-pro/references/swift.md +73 -45
- package/pipeline/skills/shared/external/swiftui-pro/references/views.md +48 -23
- package/pipeline/skills/shared/external/swiftui-ui-patterns/SKILL.md +89 -83
- package/pipeline/skills/shared/external/swiftui-ui-patterns/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/app-wiring.md +119 -114
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/async-state.md +76 -61
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/components-index.md +63 -46
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/controls.md +32 -31
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/deeplinks.md +49 -38
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/focus.md +77 -49
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/form.md +61 -44
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/grids.md +40 -42
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/input-toolbar.md +44 -31
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/lightweight-clients.md +90 -64
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/list.md +48 -49
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/loading-placeholders.md +36 -25
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/macos-settings.md +30 -30
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/matched-transitions.md +49 -32
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/media.md +49 -41
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/menu-bar.md +52 -48
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/navigationstack.md +119 -104
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/overlay.md +30 -27
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/performance.md +33 -31
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/previews.md +27 -27
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/scroll-reveal.md +79 -86
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/scrollview.md +47 -40
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/searchable.md +55 -40
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/sheets.md +113 -84
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/split-views.md +37 -34
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/tabview.md +75 -75
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/theming.md +37 -32
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/title-menus.md +41 -51
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/top-bar.md +46 -30
- package/pipeline/skills/shared/external/swiftui-uikit-interop/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/swiftui-view-refactor/SKILL.md +152 -121
- package/pipeline/skills/shared/external/swiftui-view-refactor/evals/evals.json +56 -0
- package/pipeline/skills/shared/external/swiftui-view-refactor/references/mv-patterns.md +107 -98
- package/pipeline/skills/shared/external/swiftui-webkit/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/tailwind-css/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/test-result-triage/SKILL.md +2 -2
- package/pipeline/skills/shared/external/test-result-triage/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/testing-backend/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/tipkit/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/typescript-patterns/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/valven-rules/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/vision-framework/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/vue-composition/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/weatherkit/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/web-accessibility/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/web-performance/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/web-testing/SKILL.md +2 -2
- package/pipeline/skills/shared/external/web-testing/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/web-testing/references/testing-examples.md +2 -2
- package/pipeline/skills/shared/external/widgetkit/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/xcode-build-benchmark/SKILL.md +61 -55
- package/pipeline/skills/shared/external/xcode-build-benchmark/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/xcode-build-benchmark/references/benchmark-artifacts.md +69 -67
- package/pipeline/skills/shared/external/xcode-build-benchmark/references/benchmarking-workflow.md +39 -47
- package/pipeline/skills/shared/external/xcode-build-benchmark/schemas/build-benchmark.schema.json +72 -154
- package/pipeline/skills/shared/external/xcode-build-benchmark/scripts/benchmark_builds.py +207 -245
- package/pipeline/skills/shared/external/xcode-build-fixer/SKILL.md +145 -139
- package/pipeline/skills/shared/external/xcode-build-fixer/evals/evals.json +54 -0
- package/pipeline/skills/shared/external/xcode-build-fixer/references/build-settings-best-practices.md +81 -175
- package/pipeline/skills/shared/external/xcode-build-fixer/references/fix-patterns.md +188 -143
- package/pipeline/skills/shared/external/xcode-build-fixer/references/recommendation-format.md +41 -40
- package/pipeline/skills/shared/external/xcode-build-fixer/scripts/benchmark_builds.py +207 -245
- package/pipeline/skills/shared/external/xcode-build-orchestrator/SKILL.md +107 -98
- package/pipeline/skills/shared/external/xcode-build-orchestrator/evals/evals.json +54 -0
- package/pipeline/skills/shared/external/xcode-build-orchestrator/references/benchmark-artifacts.md +69 -67
- package/pipeline/skills/shared/external/xcode-build-orchestrator/references/build-settings-best-practices.md +81 -175
- package/pipeline/skills/shared/external/xcode-build-orchestrator/references/orchestration-report-template.md +81 -69
- package/pipeline/skills/shared/external/xcode-build-orchestrator/references/recommendation-format.md +41 -40
- package/pipeline/skills/shared/external/xcode-build-orchestrator/scripts/benchmark_builds.py +207 -245
- package/pipeline/skills/shared/external/xcode-build-orchestrator/scripts/diagnose_compilation.py +155 -210
- package/pipeline/skills/shared/external/xcode-build-orchestrator/scripts/generate_optimization_report.py +355 -480
- package/pipeline/skills/shared/external/xcode-compilation-analyzer/SKILL.md +70 -69
- package/pipeline/skills/shared/external/xcode-compilation-analyzer/evals/evals.json +54 -0
- package/pipeline/skills/shared/external/xcode-compilation-analyzer/references/build-optimization-sources.md +83 -133
- package/pipeline/skills/shared/external/xcode-compilation-analyzer/references/code-compilation-checks.md +85 -73
- package/pipeline/skills/shared/external/xcode-compilation-analyzer/references/recommendation-format.md +41 -40
- package/pipeline/skills/shared/external/xcode-compilation-analyzer/scripts/diagnose_compilation.py +155 -210
- package/pipeline/skills/shared/external/xcode-project-analyzer/SKILL.md +54 -52
- package/pipeline/skills/shared/external/xcode-project-analyzer/evals/evals.json +54 -0
- package/pipeline/skills/shared/external/xcode-project-analyzer/references/build-optimization-sources.md +83 -133
- package/pipeline/skills/shared/external/xcode-project-analyzer/references/build-settings-best-practices.md +81 -175
- package/pipeline/skills/shared/external/xcode-project-analyzer/references/project-audit-checks.md +115 -83
- package/pipeline/skills/shared/external/xcode-project-analyzer/references/recommendation-format.md +41 -40
- package/pipeline/scripts/_notices.mjs +0 -171
- package/pipeline/skills/shared/external/NOTICE-avdlee-swiftui-agent-skill.md +0 -48
- package/pipeline/skills/shared/external/NOTICE-dimillian-skills.md +0 -63
- package/pipeline/skills/shared/external/NOTICE-paul-hudson-skills.md +0 -54
- package/pipeline/skills/shared/external/NOTICE-vibeship-spawner-skills.md +0 -203
- package/pipeline/skills/shared/external/NOTICE-xcode-build-skills.md +0 -60
- package/pipeline/skills/shared/external/ios-iphone-duo/NOTICE.md +0 -53
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/bootstrap/Sources/MyApp/main.swift +0 -11
- package/pipeline/skills/shared/external/swiftdata-pro/references/class-inheritance.md +0 -104
- package/pipeline/skills/shared/external/swiftdata-pro/references/core-rules.md +0 -20
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/code-smells.md +0 -158
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/demystify-swiftui-performance-wwdc23.md +0 -46
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/optimizing-swiftui-performance-instruments.md +0 -29
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/profiling-intake.md +0 -44
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/report-template.md +0 -47
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/understanding-hangs-in-your-app.md +0 -33
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/understanding-improving-swiftui-performance.md +0 -52
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Agentic systems - static review of agents with filesystem, shell and network tools
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
<!-- toc -->
|
|
6
|
+
- [Contents](#contents)
|
|
7
|
+
- [Scope and mapping](#scope-and-mapping)
|
|
8
|
+
- [Permission scope wider than the task](#permission-scope-wider-than-the-task)
|
|
9
|
+
- [Confused deputy](#confused-deputy)
|
|
10
|
+
- [Credential reach](#credential-reach)
|
|
11
|
+
- [Sandboxing and isolation](#sandboxing-and-isolation)
|
|
12
|
+
- [Approval gates for irreversible actions](#approval-gates-for-irreversible-actions)
|
|
13
|
+
- [Logging and auditability of tool calls](#logging-and-auditability-of-tool-calls)
|
|
14
|
+
- [Supply chain of tools and MCP servers](#supply-chain-of-tools-and-mcp-servers)
|
|
15
|
+
- [Cross-agent message trust](#cross-agent-message-trust)
|
|
16
|
+
- [Diff-mode triggers](#diff-mode-triggers)
|
|
17
|
+
<!-- /toc -->
|
|
18
|
+
|
|
19
|
+
## Scope and mapping
|
|
20
|
+
|
|
21
|
+
Covers code that runs an autonomous or semi-autonomous agent: the harness (loop, tool dispatch, permission checks), tool implementations, MCP server definitions and client registrations, sub-agent orchestration, hooks, and the configuration that decides what the agent may do (allowlists, settings files, container specs, CI workflows that launch agents). Read alongside llm-prompt-injection.md: that file covers how text steers a model; this one covers what the steered model can then reach.
|
|
22
|
+
|
|
23
|
+
Assume the model is compromised by injected content and ask what it can do. Every finding is about the gap between what the agent needs for its task and what the harness lets it do.
|
|
24
|
+
|
|
25
|
+
Schema mapping: OWASP LLM Top 10 (2025) ids go in prose, since `owaspCategory` only accepts web and mobile ids. Use `A01:2021` for over-broad permissions and confused deputy, `A08:2021` for tool and MCP supply chain, `A04:2021` for missing gates and sandboxing, `A09:2021` for missing tool-call logs, `A07:2021` for credential handling.
|
|
26
|
+
|
|
27
|
+
## Permission scope wider than the task
|
|
28
|
+
|
|
29
|
+
- **Look for:** shell tools with no command allowlist or an allowlist matched by prefix (`git` permits `git -c core.sshCommand=...`); filesystem tools rooted at `/` or `$HOME` instead of the workspace; path checks done on the raw string rather than the resolved real path (symlinks, `..`); network tools with no host allowlist; "allow all" or bypass modes enabled by default in settings or launch flags.
|
|
30
|
+
- **Why:** injected instructions run with whatever the harness permits. Prefix allowlists and unresolved paths are routinely escaped.
|
|
31
|
+
- **Map:** CWE-250, CWE-22 (path), CWE-78 (shell argument injection); LLM06:2025 Excessive Agency; `owaspCategory` `A01:2021`.
|
|
32
|
+
- **Rule out:** cite the permission check that resolves real paths and compares against the workspace root, the command matcher that parses argv (not prefixes) against an exact allowlist, and the network egress allowlist, each on the dispatch path every tool call passes through.
|
|
33
|
+
- **Fix check:** tests asking the dispatcher to read `../../.ssh/id_rsa`, follow a symlink out of the workspace, and run an allowed binary with a dangerous flag, each denied.
|
|
34
|
+
|
|
35
|
+
## Confused deputy
|
|
36
|
+
|
|
37
|
+
- **Look for:** an agent acting for user A while holding credentials or file access belonging to the operator or to user B; a shared agent service with one token for all tenants; tools that accept a target (repo, account, path) from model output without checking the requesting user's rights to that target; bots triggered by external events (issue comments, PR bodies, emails) that act with maintainer authority.
|
|
38
|
+
- **Why:** the agent's authority is used on behalf of whoever wrote the triggering text, who may be an outsider.
|
|
39
|
+
- **Map:** CWE-441 (unintended proxy) or CWE-863; LLM06:2025; `owaspCategory` `A01:2021`.
|
|
40
|
+
- **Rule out:** cite the authorisation check in each tool against the identity of the requesting principal (not the agent's own identity), and for event-triggered agents the check that the event author has the permission the action needs.
|
|
41
|
+
- **Fix check:** test where an event from a non-maintainer asks the bot to merge or push, asserting refusal.
|
|
42
|
+
|
|
43
|
+
## Credential reach
|
|
44
|
+
|
|
45
|
+
- **Look for:** long-lived tokens in the agent's environment (`GITHUB_TOKEN` with write scope, cloud admin keys, `~/.aws`, `~/.config/gh`, keychains) readable by its shell or file tools; secrets passed in argv or echoed into transcripts; `.env` files inside the workspace; CI jobs that run agents on untrusted input with `pull_request_target` or repository secrets available.
|
|
46
|
+
- **Why:** an agent that can run `env` or `cat` can exfiltrate every credential it can see, and transcripts are often stored or shared.
|
|
47
|
+
- **Map:** CWE-522 or CWE-532 (logs/transcripts); LLM02:2025; `owaspCategory` `A07:2021`.
|
|
48
|
+
- **Rule out:** cite that credentials are injected only into the specific tool handler process (not the agent's general environment), scoped to the minimum (read-only, single repo, short TTL), and that the filesystem tool denies the credential paths; for CI, that untrusted-input jobs run without secrets.
|
|
49
|
+
- **Fix check:** test that a shell tool call `env` and a read of the credential path return no secret values; the pipeline secret gate run over a sample transcript is clean.
|
|
50
|
+
|
|
51
|
+
## Sandboxing and isolation
|
|
52
|
+
|
|
53
|
+
- **Look for:** generated or downloaded code executed on the host; containers run `--privileged`, with the Docker socket mounted, host networking, or the home directory bind-mounted; no resource limits; sandbox escape hatches (`dangerouslyDisableSandbox`, `--no-sandbox`) reachable from model-chosen parameters.
|
|
54
|
+
- **Why:** without isolation, any code the agent runs has the host user's full reach; a mounted Docker socket is root on the host.
|
|
55
|
+
- **Map:** CWE-265 or CWE-653 (insufficient compartmentalization); `owaspCategory` `A04:2021`.
|
|
56
|
+
- **Rule out:** cite the sandbox spec: unprivileged container or VM, workspace-only mount, no socket, egress allowlist, CPU/memory/time limits; and that the escape parameter is not settable by the model.
|
|
57
|
+
- **Fix check:** test or config assertion that the run spec has no privileged flag, no socket mount, and that a sandboxed call to an off-allowlist host fails.
|
|
58
|
+
|
|
59
|
+
## Approval gates for irreversible actions
|
|
60
|
+
|
|
61
|
+
- **Look for:** destructive or outward-facing tools (delete, force-push, deploy, publish, send, pay, change permissions) executed without a human step; approvals that can be granted by the agent itself or by another agent; approval prompts that show a model-written summary instead of the real command and arguments; blanket "approve all for this session".
|
|
62
|
+
- **Why:** an approval gate is the backstop when every other control misses an injection, but only if a human sees the true action and the agent cannot satisfy the gate itself.
|
|
63
|
+
- **Map:** CWE-862; LLM06:2025; `owaspCategory` `A04:2021`.
|
|
64
|
+
- **Rule out:** cite the gate in the dispatcher that classifies the action and blocks until an out-of-band human approval, rendering the exact command or diff, with no code path where a model or agent message counts as approval.
|
|
65
|
+
- **Fix check:** test that the destructive tool returns pending without an approval record, and that an approval string inside a tool result or agent message is ignored.
|
|
66
|
+
|
|
67
|
+
## Logging and auditability of tool calls
|
|
68
|
+
|
|
69
|
+
- **Look for:** no record of which tool was called with which arguments and result; logs that drop denied calls; logs that include secret values; logs the agent can edit or delete through its own tools.
|
|
70
|
+
- **Why:** without a tamper-resistant trail, an injected action cannot be detected or reconstructed.
|
|
71
|
+
- **Map:** CWE-778, or CWE-532 for secrets in logs; `owaspCategory` `A09:2021`.
|
|
72
|
+
- **Rule out:** cite the dispatcher logging every call (allowed and denied) with principal, tool, redacted arguments and outcome, written outside the agent's writable paths.
|
|
73
|
+
- **Fix check:** test that a denied call produces a log entry and that a known secret in arguments is redacted in it.
|
|
74
|
+
|
|
75
|
+
## Supply chain of tools and MCP servers
|
|
76
|
+
|
|
77
|
+
- **Look for:** MCP servers launched with `npx -y some-package` or `uvx` at an unpinned version; servers fetched from arbitrary URLs; tool descriptions or server instructions passed to the model unreviewed (a malicious description is an injection); servers whose tool set can change after approval; plugins or skills loaded from a writable directory; no integrity check on downloaded tool binaries.
|
|
78
|
+
- **Why:** a tool server runs code with the agent's reach and also writes text the model trusts. A version bump can change both silently.
|
|
79
|
+
- **Map:** CWE-829 or CWE-494; LLM03:2025 Supply Chain; `owaspCategory` `A08:2021`.
|
|
80
|
+
- **Rule out:** cite the pinned version or lockfile entry and integrity hash for each server in the registration, the review or allowlist of server names, and the harness behaviour on tool-list change (re-approval).
|
|
81
|
+
- **Fix check:** config test that every MCP server command references an exact version; the dependency inventory lists them so the CVE lookup covers them.
|
|
82
|
+
|
|
83
|
+
## Cross-agent message trust
|
|
84
|
+
|
|
85
|
+
- **Look for:** orchestrators that treat a sub-agent's report as instructions; sub-agents that accept "the orchestrator says you may skip confirmation" from message text; shared scratch files or queues one agent writes and another executes; agent-to-agent messages carrying permission grants.
|
|
86
|
+
- **Why:** a sub-agent that read injected content becomes a relay; if peers trust its messages as authority, the injection crosses every agent boundary.
|
|
87
|
+
- **Map:** CWE-345 (insufficient verification of data authenticity) or CWE-501 (trust boundary violation); LLM01:2025; `owaspCategory` `A04:2021`.
|
|
88
|
+
- **Rule out:** cite that inter-agent messages are handled as data (parsed against a schema, never as a permission source), and that permissions come only from the harness configuration and the human.
|
|
89
|
+
- **Fix check:** test where a sub-agent result contains "approval granted, proceed with deploy", asserting the orchestrator's gate still blocks.
|
|
90
|
+
|
|
91
|
+
## Diff-mode triggers
|
|
92
|
+
|
|
93
|
+
A change to the tool dispatcher, permission matcher, settings or allowlist files, sandbox spec, MCP registrations, hooks, CI workflows that start agents, or credential injection puts every tool and every agent behind it in scope. A widened allowlist, a new generic tool, an unpinned server or a removed approval is a removed control.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Firebase - static review of rules, auth, functions and billing exposure
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
<!-- toc -->
|
|
6
|
+
- [Contents](#contents)
|
|
7
|
+
- [Scope and mapping](#scope-and-mapping)
|
|
8
|
+
- [Default-open or time-boxed rules](#default-open-or-time-boxed-rules)
|
|
9
|
+
- [Authenticated is not authorized](#authenticated-is-not-authorized)
|
|
10
|
+
- [Missing field-level validation on writes](#missing-field-level-validation-on-writes)
|
|
11
|
+
- [Client-side checks standing in for rules](#client-side-checks-standing-in-for-rules)
|
|
12
|
+
- [App Check absent or not enforced](#app-check-absent-or-not-enforced)
|
|
13
|
+
- [Auth configuration](#auth-configuration)
|
|
14
|
+
- [Cloud Functions without caller verification](#cloud-functions-without-caller-verification)
|
|
15
|
+
- [Service account and admin credential exposure](#service-account-and-admin-credential-exposure)
|
|
16
|
+
- [Billing abuse and cost amplification](#billing-abuse-and-cost-amplification)
|
|
17
|
+
- [Diff-mode triggers](#diff-mode-triggers)
|
|
18
|
+
<!-- /toc -->
|
|
19
|
+
|
|
20
|
+
## Scope and mapping
|
|
21
|
+
|
|
22
|
+
Covers `firestore.rules`, `database.rules.json`, `storage.rules`, `firebase.json`, the Auth settings visible in code or IaC, Cloud Functions source (`functions/`), and every client that talks to the project (iOS `GoogleService-Info.plist`, Android `google-services.json`, web `firebaseConfig`). The Firebase web API key and project id are identifiers, not secrets: a finding that only says "API key in the client" is not a finding. The security boundary is the rules file and the function code, so that is where evidence must point.
|
|
23
|
+
|
|
24
|
+
Schema mapping: the rules engine is server-side access control, so rule defects go in `owaspCategory` as `A01:2021` (or `M3:2024` when the finding is filed against the mobile client that relies on the missing rule). Pick one per finding; prefer the file that holds the defect.
|
|
25
|
+
|
|
26
|
+
## Default-open or time-boxed rules
|
|
27
|
+
|
|
28
|
+
- **Look for:** `allow read, write: if true;`, `allow read, write;` with no condition, the generated test-mode rule `if request.time < timestamp.date(...)`, a recursive wildcard `match /{document=**}` granting access at the root, RTDB `".read": true` / `".write": true` at `"rules"` level, Storage `allow read, write: if request.auth != null` on the whole bucket.
|
|
29
|
+
- **Why:** anyone holding the public project config can read or overwrite the database from a script. Test-mode rules expire into lockout, and the usual reaction is to extend the date.
|
|
30
|
+
- **Map:** CWE-284 (or CWE-862 when no condition exists at all); `A01:2021`, `A05:2021` if the open rule is the deployed default; mobile client `M8:2024`.
|
|
31
|
+
- **Rule out:** cite the rules file line where the root match is `allow read, write: if false;` and every collection has its own `match` with a condition. Confirm `firebase.json` points at that rules file (a rules file nobody deploys proves nothing).
|
|
32
|
+
- **Fix check:** a rules unit test (`@firebase/rules-unit-testing` against the emulator) that an unauthenticated context `assertFails` on read and write of a protected path, and fails today.
|
|
33
|
+
|
|
34
|
+
## Authenticated is not authorized
|
|
35
|
+
|
|
36
|
+
- **Look for:** conditions that stop at `request.auth != null` on per-user data; `match /users/{userId}` without `request.auth.uid == userId`; ownership read from `request.resource.data.ownerId` on create without also checking it equals `request.auth.uid`; RTDB `"$uid": {".read": "auth != null"}` instead of `"auth.uid === $uid"`.
|
|
37
|
+
- **Why:** sign-up is open by default, so "authenticated" means "anyone who created an account", including an anonymous one. Every user can then read or edit every other user's documents (IDOR at the database layer).
|
|
38
|
+
- **Map:** CWE-639; `A01:2021`; mobile `M3:2024`.
|
|
39
|
+
- **Rule out:** cite the rule line binding the path variable or `resource.data.ownerId` to `request.auth.uid` for read, update and delete, and binding `request.resource.data.ownerId` to `request.auth.uid` on create.
|
|
40
|
+
- **Fix check:** an emulator test where user A's context `assertFails` reading and updating user B's document.
|
|
41
|
+
|
|
42
|
+
## Missing field-level validation on writes
|
|
43
|
+
|
|
44
|
+
- **Look for:** `allow write` (covers create, update, delete together) with only an owner check; no `request.resource.data.keys().hasOnly([...])`; no type or size checks; privileged fields (`role`, `isAdmin`, `credits`, `plan`, `verified`) writable by the owner; `update` that does not use `request.resource.data.diff(resource.data).affectedKeys().hasOnly([...])`.
|
|
45
|
+
- **Why:** the owner can grant themselves admin, unlimited credits or a paid plan by writing one field, and can store arbitrarily large documents.
|
|
46
|
+
- **Map:** CWE-915 (mass assignment) or CWE-20; `A01:2021` for privilege fields, `A04:2021` for missing size limits.
|
|
47
|
+
- **Rule out:** cite the `hasOnly` key allowlist and the `affectedKeys()` constraint for update, plus the rule that privileged fields are only writable from the Admin SDK (no client rule grants them).
|
|
48
|
+
- **Fix check:** emulator test that the owner `assertFails` setting `role: "admin"` and that a 2 MB string field is rejected.
|
|
49
|
+
|
|
50
|
+
## Client-side checks standing in for rules
|
|
51
|
+
|
|
52
|
+
- **Look for:** UI or ViewModel code that hides an admin screen or filters a query by `uid` while the rule on that collection allows broader reads; `where("ownerId", "==", uid)` treated as the access control; feature flags in Remote Config deciding entitlement.
|
|
53
|
+
- **Why:** a query filter is a request, not a restriction. The attacker drops the filter. Rules are not filters either: a rule must make the unfiltered query fail.
|
|
54
|
+
- **Map:** CWE-602 (client-side enforcement of server-side security); `M3:2024` on the client file, or `A04:2021` when filed on the design.
|
|
55
|
+
- **Rule out:** cite the rule that rejects the unfiltered query (for example `allow list: if request.query.limit <= 50 && resource.data.ownerId == request.auth.uid`).
|
|
56
|
+
- **Fix check:** emulator test that the same collection query without the `where` clause `assertFails`.
|
|
57
|
+
|
|
58
|
+
## App Check absent or not enforced
|
|
59
|
+
|
|
60
|
+
- **Look for:** no App Check provider initialised in clients (`AppCheck.setAppCheckProviderFactory`, `FirebaseAppCheck.getInstance().installAppCheckProviderFactory`, `initializeAppCheck`); debug provider shipped in release builds; callable functions without `enforceAppCheck: true` (v2) or a `context.app` check (v1); no enforcement note in IaC.
|
|
61
|
+
- **Why:** App Check raises the cost of scripted abuse of rules-permitted operations and functions. It is not authorization; never accept it as the control for an authorization finding.
|
|
62
|
+
- **Map:** CWE-799 (improper control of interaction frequency) or CWE-290; `A04:2021`; mobile `M7:2024` when the debug provider ships.
|
|
63
|
+
- **Rule out:** cite the provider init in release config and `enforceAppCheck: true` on each callable in scope. Console enforcement is not visible in code: if that is the only control, the row is `needs_follow_up`, not `ruled_out`.
|
|
64
|
+
- **Fix check:** a release build check (or config test) asserting the debug provider factory is compiled out; a function test that a call without an App Check token is rejected.
|
|
65
|
+
|
|
66
|
+
## Auth configuration
|
|
67
|
+
|
|
68
|
+
- **Look for:** anonymous auth enabled while rules treat any `request.auth` as trusted; email enumeration via distinct error handling in client code; email/password sign-up enabled for an app that is meant to be invite-only; custom claims set from client-provided input in a function; `signInWithCustomToken` minted by a function that does not verify the caller; ID token verified without `checkRevoked` where revocation matters.
|
|
69
|
+
- **Why:** rules and functions inherit whatever identity Auth hands them. A permissive identity source makes every `request.auth != null` check weaker than it reads.
|
|
70
|
+
- **Map:** CWE-287 or CWE-269 (custom claims escalation); `A07:2021`; mobile `M3:2024`.
|
|
71
|
+
- **Rule out:** cite the function that sets custom claims and the server-side check that the caller is already an admin; cite rules that check `request.auth.token.firebase.sign_in_provider != 'anonymous'` where anonymous users must be excluded.
|
|
72
|
+
- **Fix check:** a function test where a non-admin caller asks for an admin claim and gets `permission-denied`.
|
|
73
|
+
|
|
74
|
+
## Cloud Functions without caller verification
|
|
75
|
+
|
|
76
|
+
- **Look for:** `onCall` handlers that never read `request.auth` (v2) / `context.auth` (v1); `onRequest` HTTP functions that do no `verifyIdToken` on the `Authorization` header; functions using the Admin SDK (which bypasses rules) on a document id taken from the request without an ownership check; `cors: true` or `cors({origin: true})` on a cookie- or token-bearing endpoint.
|
|
77
|
+
- **Why:** the Admin SDK ignores security rules, so a function is a rules bypass by construction. Any missing check in it is a full read or write primitive.
|
|
78
|
+
- **Map:** CWE-306 (missing auth) or CWE-639 (missing ownership); `A01:2021`.
|
|
79
|
+
- **Rule out:** cite the early `if (!request.auth) throw new HttpsError('unauthenticated', ...)` and the ownership comparison before the Admin SDK call, per function in scope.
|
|
80
|
+
- **Fix check:** function unit test (firebase-functions-test or emulator) invoking without auth and as a different user, both rejected.
|
|
81
|
+
|
|
82
|
+
## Service account and admin credential exposure
|
|
83
|
+
|
|
84
|
+
- **Look for:** a service account JSON (`"type": "service_account"`, `private_key`) in the repo, in a mobile bundle, in a web bundle, or in CI logs; `admin.initializeApp({ credential: admin.credential.cert(require('./key.json')) })` inside a client-shipped package; RTDB legacy database secrets; FCM server keys in clients.
|
|
85
|
+
- **Why:** a service account bypasses every rule and usually has project-wide IAM. This is total compromise.
|
|
86
|
+
- **Map:** CWE-798; `A07:2021` (or `A02:2021`); mobile `M1:2024`.
|
|
87
|
+
- **Rule out:** cite `.gitignore` covering the key path and the function runtime using default credentials (`admin.initializeApp()` with no argument). Use the pipeline secret gate for detection; do not hand-roll patterns.
|
|
88
|
+
- **Fix check:** the secret gate run over the tree returns clean; the key is rotated (record as a process step, not a code check).
|
|
89
|
+
|
|
90
|
+
## Billing abuse and cost amplification
|
|
91
|
+
|
|
92
|
+
- **Look for:** unbounded `list` rules (no `request.query.limit` ceiling); public Storage write with no size or content-type limit (`request.resource.size < N`, `request.resource.contentType.matches('image/.*')`); triggers (`onDocumentWritten`) that write back to the same collection (recursive fan-out); callable functions that call paid APIs (LLM, SMS, maps) with no per-user rate limit; phone auth with no abuse protection.
|
|
93
|
+
- **Why:** pay-as-you-go billing turns an access-control gap into a financial denial of service even where no data leaks.
|
|
94
|
+
- **Map:** CWE-770 (allocation without limits) or CWE-400; `A04:2021`.
|
|
95
|
+
- **Rule out:** cite the size and content-type conditions in `storage.rules`, the limit clause in list rules, the re-entrancy guard in the trigger, and the per-uid counter or rate limiter before the paid call.
|
|
96
|
+
- **Fix check:** emulator test that an oversized upload and an unbounded list both `assertFails`; trigger test showing one write produces one invocation.
|
|
97
|
+
|
|
98
|
+
## Diff-mode triggers
|
|
99
|
+
|
|
100
|
+
A diff that edits any `*.rules` file, `database.rules.json`, `firebase.json` rule paths, or a function that uses the Admin SDK puts every collection that rule or function touches in scope. A removed condition, a widened `match`, or a function moved from `onCall` to `onRequest` is a removed control even if the surrounding code is unchanged.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# GraphQL - static review of schema exposure, cost and authorization
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
<!-- toc -->
|
|
6
|
+
- [Contents](#contents)
|
|
7
|
+
- [Scope and mapping](#scope-and-mapping)
|
|
8
|
+
- [Introspection and tooling enabled in production](#introspection-and-tooling-enabled-in-production)
|
|
9
|
+
- [No depth, complexity or size limits](#no-depth-complexity-or-size-limits)
|
|
10
|
+
- [Missing per-field and per-object authorization](#missing-per-field-and-per-object-authorization)
|
|
11
|
+
- [Batching and alias abuse](#batching-and-alias-abuse)
|
|
12
|
+
- [IDOR through global node ids](#idor-through-global-node-ids)
|
|
13
|
+
- [Error and stack trace leakage](#error-and-stack-trace-leakage)
|
|
14
|
+
- [Persisted queries and CSRF](#persisted-queries-and-csrf)
|
|
15
|
+
- [Diff-mode triggers](#diff-mode-triggers)
|
|
16
|
+
<!-- /toc -->
|
|
17
|
+
|
|
18
|
+
## Scope and mapping
|
|
19
|
+
|
|
20
|
+
Covers the server (schema definition, resolvers, server construction and plugins in Apollo Server, GraphQL Yoga, graphql-java / DGS, Strawberry, Graphene, gqlgen, Hot Chocolate, Hasura or PostGraphile metadata) and the clients that send operations. A GraphQL API is one endpoint, so route-level auth middleware rarely proves anything about individual fields: the evidence for authorization lives in resolvers, directives or a permission layer.
|
|
21
|
+
|
|
22
|
+
Schema mapping: authorization defects use `A01:2021`; cost and depth abuse use `A04:2021`; introspection and verbose errors use `A05:2021`. Mobile clients rarely hold the defect; when they do (persisted query hashes, embedded admin operations), use `M8:2024`.
|
|
23
|
+
|
|
24
|
+
## Introspection and tooling enabled in production
|
|
25
|
+
|
|
26
|
+
- **Look for:** `introspection: true` unconditionally, or no setting on a server whose default is on; GraphiQL / Playground / Apollo Sandbox landing page served in production; field suggestions ("Did you mean ...") left enabled when introspection is off.
|
|
27
|
+
- **Why:** the full schema maps every admin mutation and internal field. It is not a vulnerability on its own, but it removes discovery cost for every other one. Field suggestions leak the schema even with introspection off.
|
|
28
|
+
- **Map:** CWE-200; `A05:2021`. Severity usually `suggestion` unless the schema exposes something the threat model treats as secret.
|
|
29
|
+
- **Rule out:** cite the config gating introspection and the IDE on `NODE_ENV !== 'production'` (or the equivalent), plus the suggestion-masking plugin or setting. A public API that intends its schema to be public is `not_applicable`.
|
|
30
|
+
- **Fix check:** a test that an introspection query against the production configuration returns an error.
|
|
31
|
+
|
|
32
|
+
## No depth, complexity or size limits
|
|
33
|
+
|
|
34
|
+
- **Look for:** no depth limit (graphql-depth-limit, `maxDepth`, `MaxQueryDepthInstrumentation`); no cost or complexity analysis; no limit on list arguments (`first: 100000`); recursive types (`user { friends { friends { ... } } }`) without a ceiling; no request body size limit; no timeout on resolver execution.
|
|
35
|
+
- **Why:** one request can trigger exponential resolver work or huge database reads. This is denial of service with a single HTTP call that rate limiters count as one.
|
|
36
|
+
- **Map:** CWE-400 or CWE-770; `A04:2021`.
|
|
37
|
+
- **Rule out:** cite the validation rule or plugin enforcing depth and cost in the server construction, and the maximum enforced on pagination arguments in the schema or resolver.
|
|
38
|
+
- **Fix check:** a test sending a query nested beyond the limit and one requesting `first: 100000`, both rejected before resolver execution.
|
|
39
|
+
|
|
40
|
+
## Missing per-field and per-object authorization
|
|
41
|
+
|
|
42
|
+
- **Look for:** authorization only at the HTTP layer or only on the root query; nested resolvers returning sensitive fields (`email`, `ssn`, `role`, `internalNotes`) without their own check; mutations taking an `id` and updating without an ownership check; type-level directives (`@auth`, `@hasRole`) applied to the type but not to fields reachable through another parent; Hasura permissions with `{}` row filter for the `user` role.
|
|
43
|
+
- **Why:** GraphQL lets a caller reach the same object through many paths. A check on `Query.me` does nothing for `Query.post.author.email`.
|
|
44
|
+
- **Map:** CWE-862 or CWE-639; `A01:2021`.
|
|
45
|
+
- **Rule out:** cite the authorization in the data or service layer the resolvers call (so every path passes through it), or the directive or permission rule on the specific field and object type, per sensitive field in scope.
|
|
46
|
+
- **Fix check:** a test querying the sensitive field through a second parent path as an unprivileged user, asserting null plus an authorization error.
|
|
47
|
+
|
|
48
|
+
## Batching and alias abuse
|
|
49
|
+
|
|
50
|
+
- **Look for:** array batching enabled (`allowBatchedHttpRequests: true`) with no batch size limit; no limit on aliases per operation; login, OTP verify or coupon mutations that a rate limiter counts per HTTP request rather than per operation or alias.
|
|
51
|
+
- **Why:** `a1: login(...) a2: login(...) ... a1000: login(...)` in one request defeats per-request rate limits and brute-forces credentials or codes.
|
|
52
|
+
- **Map:** CWE-307 (brute force) or CWE-799; `A07:2021` for auth mutations, `A04:2021` otherwise.
|
|
53
|
+
- **Rule out:** cite the alias or operation-count limit and a rate limit keyed on the sensitive mutation itself (per account or per target), not on the HTTP request.
|
|
54
|
+
- **Fix check:** a test sending one request with 50 aliased login attempts, asserting rejection or a rate-limit error after the threshold.
|
|
55
|
+
|
|
56
|
+
## IDOR through global node ids
|
|
57
|
+
|
|
58
|
+
- **Look for:** Relay `node(id:)` / `nodes(ids:)` resolvers that decode the base64 id and load the object by type and key with no ownership or visibility check; `id` arguments on mutations treated as authorization; ids that are guessable sequential integers under the base64.
|
|
59
|
+
- **Why:** base64 is encoding, not access control. The `node` field is a universal fetch-by-id for every type in the schema.
|
|
60
|
+
- **Map:** CWE-639; `A01:2021`.
|
|
61
|
+
- **Rule out:** cite the `node` resolver delegating to each type's loader that applies the same authorization as the type's own query field.
|
|
62
|
+
- **Fix check:** a test fetching another user's object through `node(id:)` with a crafted id, asserting null and an authorization error.
|
|
63
|
+
|
|
64
|
+
## Error and stack trace leakage
|
|
65
|
+
|
|
66
|
+
- **Look for:** `debug: true`, `includeStacktraceInErrorResponses: true`, `formatError` returning `originalError` or database messages; `extensions.exception.stacktrace` in responses; resolvers throwing raw ORM errors; distinct errors that reveal whether a user or object exists.
|
|
67
|
+
- **Why:** SQL fragments, file paths, internal hostnames and enumeration oracles help every other attack.
|
|
68
|
+
- **Map:** CWE-209; `A05:2021`.
|
|
69
|
+
- **Rule out:** cite the error masking in production (a `formatError` that maps unknown errors to a generic message with a correlation id, or the server's masked-errors option).
|
|
70
|
+
- **Fix check:** a test forcing a resolver exception in production config and asserting the response has no stack trace or database text.
|
|
71
|
+
|
|
72
|
+
## Persisted queries and CSRF
|
|
73
|
+
|
|
74
|
+
- **Look for:** server accepting arbitrary operations where the design assumed an allowlist of persisted queries; automatic persisted queries treated as a security control; cookie-authenticated GraphQL accepting `GET` or `application/x-www-form-urlencoded` / `text/plain` POSTs (simple requests, no preflight).
|
|
75
|
+
- **Why:** an allowlist that is not enforced is no allowlist. Cookie auth plus simple-request content types allows cross-site mutations.
|
|
76
|
+
- **Map:** CWE-352 for CSRF; `A01:2021`. Unenforced allowlist: CWE-284, `A04:2021`.
|
|
77
|
+
- **Rule out:** cite the setting that rejects non-persisted operations, and the CSRF prevention (required custom header or `Content-Type: application/json` enforcement, or SameSite cookies plus a token).
|
|
78
|
+
- **Fix check:** a test posting a mutation as `text/plain` with the session cookie, asserting rejection.
|
|
79
|
+
|
|
80
|
+
## Diff-mode triggers
|
|
81
|
+
|
|
82
|
+
A new field on a type with sensitive siblings, a new parent path to an existing type, a resolver moved out of the data layer, or a change to server plugins (depth, cost, masking, CSRF) puts every reachable field in scope. Removing a directive or a validation rule is a removed control.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# LLM features - static review for prompt injection and unsafe model output
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
<!-- toc -->
|
|
6
|
+
- [Contents](#contents)
|
|
7
|
+
- [Scope and mapping](#scope-and-mapping)
|
|
8
|
+
- [Untrusted content reaching a model that holds tools](#untrusted-content-reaching-a-model-that-holds-tools)
|
|
9
|
+
- [Indirect injection through fetched pages, files and tickets](#indirect-injection-through-fetched-pages-files-and-tickets)
|
|
10
|
+
- [Model output used as code, SQL, shell or markup](#model-output-used-as-code-sql-shell-or-markup)
|
|
11
|
+
- [Secrets and sensitive data in prompts](#secrets-and-sensitive-data-in-prompts)
|
|
12
|
+
- [Tool definitions without an allowlist or argument validation](#tool-definitions-without-an-allowlist-or-argument-validation)
|
|
13
|
+
- [Side effects without human confirmation](#side-effects-without-human-confirmation)
|
|
14
|
+
- [Exfiltration through rendered links and images](#exfiltration-through-rendered-links-and-images)
|
|
15
|
+
- [Unbounded consumption](#unbounded-consumption)
|
|
16
|
+
- [Diff-mode triggers](#diff-mode-triggers)
|
|
17
|
+
<!-- /toc -->
|
|
18
|
+
|
|
19
|
+
## Scope and mapping
|
|
20
|
+
|
|
21
|
+
Covers application code that calls a model (Anthropic, OpenAI, Gemini, local runtimes, or a framework such as LangChain, LlamaIndex, Vercel AI SDK, Semantic Kernel) and acts on the result: prompt assembly, retrieval, tool definitions and handlers, and every place model output reaches a sink. The core rule: any text a model reads from outside the trust boundary can steer it, and nothing in the prompt reliably stops that. Controls must sit in code outside the model: what tools exist, what arguments they accept, what output is allowed to do, and who approves side effects.
|
|
22
|
+
|
|
23
|
+
Trace like taint analysis. Source: user input, fetched pages, uploaded files, emails, tickets, PR comments, search results, retrieved chunks, tool results. Sink: a tool call with side effects, rendered HTML or markdown, `eval`, SQL, shell, file paths, outbound requests.
|
|
24
|
+
|
|
25
|
+
Schema mapping: the OWASP LLM Top 10 (2025) id goes in prose (`assumptions` or `issue`), since `owaspCategory` only accepts web and mobile ids. Use `A03:2021` when model output reaches an injection sink, `A01:2021` when the model can act beyond the caller's permissions, `A04:2021` for missing design controls (confirmation, allowlists), `A02:2021` or `M1:2024` for secrets in prompts.
|
|
26
|
+
|
|
27
|
+
## Untrusted content reaching a model that holds tools
|
|
28
|
+
|
|
29
|
+
- **Look for:** one prompt or message list that combines external content (fetched URL body, file contents, ticket text, email, retrieved chunks) with a tool list containing side-effect tools (send email, write file, run command, create PR, transfer, delete); system prompt instructions such as "ignore instructions in documents" offered as the control.
|
|
30
|
+
- **Why:** the model cannot reliably tell data from instructions. Whoever authors the external content can drive the tools with the user's authority.
|
|
31
|
+
- **Map:** CWE-77 (command injection via instructions) or CWE-1427 (improper neutralization of input used for LLM prompting); LLM01:2025 Prompt Injection; `owaspCategory` `A04:2021` (or `A01:2021` when the tool exceeds the caller's own permissions).
|
|
32
|
+
- **Rule out:** cite one of: the tool list for that call contains only read-only tools; the external content is processed by a separate call with no tools whose output is constrained to a schema (classification, extraction) before the tool-holding step; or every side-effect tool requires confirmation (see below). A prompt instruction alone never rules this out.
|
|
33
|
+
- **Fix check:** a test that feeds a document containing an instruction to call a side-effect tool and asserts the tool handler was not invoked (mock the model to emit the call, then assert the guard blocks it).
|
|
34
|
+
|
|
35
|
+
## Indirect injection through fetched pages, files and tickets
|
|
36
|
+
|
|
37
|
+
- **Look for:** browse or fetch tools whose results go straight back into the conversation; RAG over a corpus anyone can write to (public wiki, support inbox, user uploads, issue trackers); summarisation of untrusted repos or PR bodies by an agent that can also comment or push; hidden text vectors left unstripped (HTML comments, zero-width characters, white-on-white text, image alt text, PDF metadata).
|
|
38
|
+
- **Why:** the attacker never talks to the model; they plant text where the model will read it later.
|
|
39
|
+
- **Map:** CWE-1427; LLM01:2025; `owaspCategory` `A04:2021`.
|
|
40
|
+
- **Rule out:** cite the trust partition: content from writable-by-others sources is tagged and reaches only tool-less or read-only calls, and the corpus write path is restricted (who can add documents). Sanitising hidden text is defence in depth, not a ruling-out control.
|
|
41
|
+
- **Fix check:** fixture with an injected instruction in an HTML comment of a fetched page; assert the resulting run produces no side-effect call.
|
|
42
|
+
|
|
43
|
+
## Model output used as code, SQL, shell or markup
|
|
44
|
+
|
|
45
|
+
- **Look for:** model output into `eval`, `exec`, `Function()`, `subprocess(..., shell=True)`, `child_process.exec`, raw SQL strings, `dangerouslySetInnerHTML`, `v-html`, `innerHTML`, markdown renderers with HTML enabled, file paths for read or write, URLs for server-side fetch, deserialisers (`pickle`, `yaml.load`).
|
|
46
|
+
- **Why:** model output is attacker-influenced input. The classic injection sinks apply unchanged.
|
|
47
|
+
- **Map:** CWE-94, CWE-78, CWE-89, CWE-79, CWE-22 or CWE-918 per sink; LLM05:2025 Improper Output Handling; `owaspCategory` `A03:2021` (`A10:2021` for SSRF).
|
|
48
|
+
- **Rule out:** cite the sink-appropriate control on the model output: parameterised query with the model choosing only values, argv array without a shell, sanitiser on rendered HTML (DOMPurify or equivalent with an explicit config), path canonicalisation inside an allowed root, URL allowlist. Generated code must run only in a sandbox (see agentic-systems.md).
|
|
49
|
+
- **Fix check:** unit test feeding a model-output fixture containing `'; DROP TABLE` / `$(id)` / `<img onerror>` / `../../etc/passwd` and asserting the sink receives it inert.
|
|
50
|
+
|
|
51
|
+
## Secrets and sensitive data in prompts
|
|
52
|
+
|
|
53
|
+
- **Look for:** API keys, connection strings, internal URLs or credentials placed in system prompts "so the model can call the API"; full user records or other users' data in context when the task needs one field; prompts and completions logged verbatim to analytics or third-party observability; system prompt contents treated as confidential.
|
|
54
|
+
- **Why:** anything in context can be echoed back by a crafted request. A system prompt is not a secret store.
|
|
55
|
+
- **Map:** CWE-200 or CWE-532 (logging); secrets in prompt: CWE-798; LLM02:2025 Sensitive Information Disclosure, LLM07:2025 System Prompt Leakage; `owaspCategory` `A02:2021` (web) or `M1:2024` (mobile client building the prompt).
|
|
56
|
+
- **Rule out:** cite that credentials live in the tool handler (server side, never in model context), that context assembly selects only the fields needed, and that logging redacts prompts or is disabled.
|
|
57
|
+
- **Fix check:** test asserting the assembled prompt for a representative request contains no value from the secret store and no other user's identifiers.
|
|
58
|
+
|
|
59
|
+
## Tool definitions without an allowlist or argument validation
|
|
60
|
+
|
|
61
|
+
- **Look for:** generic tools (`run_sql(query)`, `http_request(url, method, body)`, `shell(cmd)`, `read_file(path)`) where a narrow tool would do; tool arguments passed to the backend without schema validation; tools executing with a service credential rather than the end user's; the tool set chosen dynamically from model output.
|
|
62
|
+
- **Why:** the tool surface is the blast radius of a successful injection. A generic tool turns any injection into arbitrary access.
|
|
63
|
+
- **Map:** CWE-250 (excessive privilege) or CWE-20; LLM06:2025 Excessive Agency; `owaspCategory` `A01:2021`.
|
|
64
|
+
- **Rule out:** cite the static tool list for the call, the argument schema validation in each handler (enum values, id ownership check against the calling user, URL host allowlist), and the credential the handler uses being scoped to the end user.
|
|
65
|
+
- **Fix check:** handler unit test passing an id the user does not own and a URL outside the allowlist, both rejected without model involvement.
|
|
66
|
+
|
|
67
|
+
## Side effects without human confirmation
|
|
68
|
+
|
|
69
|
+
- **Look for:** tools that send messages, spend money, change permissions, delete data, merge code or post publicly, executed as soon as the model emits the call; "auto-approve" flags defaulting to on; confirmation UIs that show the model's summary instead of the actual arguments.
|
|
70
|
+
- **Why:** confirmation is the one control injection cannot talk its way past, provided the human sees the real action.
|
|
71
|
+
- **Map:** CWE-862; LLM06:2025; `owaspCategory` `A04:2021`.
|
|
72
|
+
- **Rule out:** cite the gate between model output and handler execution that blocks until a user approves, and that renders the concrete arguments (recipient, amount, path, diff).
|
|
73
|
+
- **Fix check:** test that a side-effect tool call without an approval token is not executed and returns a pending state.
|
|
74
|
+
|
|
75
|
+
## Exfiltration through rendered links and images
|
|
76
|
+
|
|
77
|
+
- **Look for:** chat UIs rendering model markdown with images (``) or auto-fetching link previews; model-written links rendered clickable with no domain check; server-side unfurling of URLs in model output.
|
|
78
|
+
- **Why:** an injected instruction can make the model encode conversation data into an image URL; the browser fetches it with no click, sending the data to the attacker.
|
|
79
|
+
- **Map:** CWE-201 (insertion of sensitive information into sent data); LLM02:2025 and LLM05:2025; `owaspCategory` `A04:2021` (or `A03:2021` when filed as an output-encoding defect).
|
|
80
|
+
- **Rule out:** cite the renderer config that disables remote images or restricts image and link hosts to an allowlist, plus a CSP `img-src` that enforces it in the browser.
|
|
81
|
+
- **Fix check:** render test with model output containing an external image URL, asserting no `img` element with that host is produced.
|
|
82
|
+
|
|
83
|
+
## Unbounded consumption
|
|
84
|
+
|
|
85
|
+
- **Look for:** no per-user limit on model calls; user-controlled `max_tokens`; agent loops with no iteration cap; recursive tool calls that can re-invoke the model.
|
|
86
|
+
- **Why:** cost denial of service and runaway loops.
|
|
87
|
+
- **Map:** CWE-770; LLM10:2025 Unbounded Consumption; `owaspCategory` `A04:2021`.
|
|
88
|
+
- **Rule out:** cite the rate limiter keyed per user, the server-fixed token ceiling, and the loop iteration cap.
|
|
89
|
+
- **Fix check:** test that the agent loop stops at the cap and the endpoint returns a rate-limit error past the threshold.
|
|
90
|
+
|
|
91
|
+
## Diff-mode triggers
|
|
92
|
+
|
|
93
|
+
A new tool, a new content source added to context (a fetch, a retrieval index, a file reader), a new renderer path for model output, or a removed confirmation step puts the whole call path in scope: trace from every source the call reads to every sink its output or tools reach.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# OAuth 2 and OpenID Connect - static review of clients and resource servers
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
<!-- toc -->
|
|
6
|
+
- [Contents](#contents)
|
|
7
|
+
- [Scope and mapping](#scope-and-mapping)
|
|
8
|
+
- [Redirect URI validation](#redirect-uri-validation)
|
|
9
|
+
- [State and nonce](#state-and-nonce)
|
|
10
|
+
- [PKCE for public clients](#pkce-for-public-clients)
|
|
11
|
+
- [Client secret in a public client](#client-secret-in-a-public-client)
|
|
12
|
+
- [Implicit and password grants](#implicit-and-password-grants)
|
|
13
|
+
- [Token validation on the resource server](#token-validation-on-the-resource-server)
|
|
14
|
+
- [Token storage on mobile and web](#token-storage-on-mobile-and-web)
|
|
15
|
+
- [Refresh token rotation and revocation](#refresh-token-rotation-and-revocation)
|
|
16
|
+
- [Open redirects around the login flow](#open-redirects-around-the-login-flow)
|
|
17
|
+
- [Diff-mode triggers](#diff-mode-triggers)
|
|
18
|
+
<!-- /toc -->
|
|
19
|
+
|
|
20
|
+
## Scope and mapping
|
|
21
|
+
|
|
22
|
+
Covers three roles, and the first job is to decide which one the code plays: a **client** (mobile app, SPA, server-side web app starting a login), an **authorization server** the team operates (redirect registration, token issuance), and a **resource server** (API that accepts access tokens). Most findings depend on the role: PKCE is a client duty, audience checks are a resource-server duty. Library defaults matter; cite the configuration line that overrides or keeps them.
|
|
23
|
+
|
|
24
|
+
Schema mapping: authentication flow defects use `A07:2021`; redirect and authorization defects use `A01:2021`; token storage on mobile uses `M9:2024` (storage) or `M3:2024` (auth decision). Put the finding on the file that holds the defect.
|
|
25
|
+
|
|
26
|
+
## Redirect URI validation
|
|
27
|
+
|
|
28
|
+
- **Look for (authorization server):** redirect URI compared by prefix (`startsWith`), substring, or regex without anchors; wildcard subdomains; redirect accepted when it is not in the client's registered list; `localhost` redirects enabled for production clients. **(client):** custom URL schemes that another app can register (`myapp://callback`) used without PKCE; universal links / App Links missing the association file entry.
|
|
29
|
+
- **Why:** a loose match lets an attacker register `https://legit.example.com.evil.net` or a sibling path and receive authorization codes.
|
|
30
|
+
- **Map:** CWE-601 (open redirect) or CWE-939 (improper authorization in handler for custom URL scheme); `A01:2021`; mobile `M3:2024`.
|
|
31
|
+
- **Rule out:** cite the exact-string comparison against the registered list (normalised scheme, host, port, path) and, for mobile, PKCE on the same flow plus claimed HTTPS redirects.
|
|
32
|
+
- **Fix check:** test that an authorization request with `redirect_uri` equal to a registered URI plus a suffix or a different subdomain is rejected.
|
|
33
|
+
|
|
34
|
+
## State and nonce
|
|
35
|
+
|
|
36
|
+
- **Look for:** no `state` parameter on the authorization request; `state` generated but never compared on the callback; `state` stored in a place the attacker controls (a query parameter echoed back); OIDC `nonce` sent but not checked against the ID token's `nonce` claim; predictable values (`Date.now()`, `Math.random()`).
|
|
37
|
+
- **Why:** without state the callback accepts a code the attacker obtained for their own account (login CSRF, account linking to the attacker). Without nonce an ID token can be replayed into a new session.
|
|
38
|
+
- **Map:** CWE-352 (state) or CWE-294 (nonce replay); `A07:2021`.
|
|
39
|
+
- **Rule out:** cite the CSPRNG generation, the session-bound storage, and the strict comparison on callback that aborts on mismatch; cite the nonce comparison after ID token validation. A library that does this by default needs its config line showing it is not disabled.
|
|
40
|
+
- **Fix check:** test that the callback with a missing or different `state` returns an error and creates no session.
|
|
41
|
+
|
|
42
|
+
## PKCE for public clients
|
|
43
|
+
|
|
44
|
+
- **Look for:** mobile apps, SPAs, desktop apps or CLIs running authorization code flow without `code_challenge`; `code_challenge_method=plain`; verifier stored where it can leak (URL, logs); authorization server that does not require PKCE for public clients or accepts a token request without `code_verifier`.
|
|
45
|
+
- **Why:** public clients cannot keep a secret, so an intercepted code (from a malicious app on the same scheme, logs, or referrer) is redeemable without PKCE.
|
|
46
|
+
- **Map:** CWE-345 or CWE-287; `A07:2021`; mobile `M3:2024`.
|
|
47
|
+
- **Rule out:** cite S256 generation of the challenge and verifier in the client, and the server config that rejects token requests without a verifier for public clients. For a library (AppAuth, oidc-client-ts, platform session APIs) cite the call that enables PKCE or show it is the default and not disabled.
|
|
48
|
+
- **Fix check:** server test that a token exchange without `code_verifier` for a public client fails.
|
|
49
|
+
|
|
50
|
+
## Client secret in a public client
|
|
51
|
+
|
|
52
|
+
- **Look for:** `client_secret` in a mobile bundle, SPA env (`NEXT_PUBLIC_`, `VITE_`), or a desktop binary; a public client registered as confidential to make the flow work.
|
|
53
|
+
- **Why:** anything shipped is extractable; the secret then grants client-credential tokens or impersonation of the client.
|
|
54
|
+
- **Map:** CWE-798; `A07:2021`; mobile `M1:2024`.
|
|
55
|
+
- **Rule out:** cite that the client is registered as public and uses PKCE, and that no secret appears in client build config. Use the pipeline secret gate for detection.
|
|
56
|
+
- **Fix check:** the secret gate is clean over client targets; client registration lists auth method `none`.
|
|
57
|
+
|
|
58
|
+
## Implicit and password grants
|
|
59
|
+
|
|
60
|
+
- **Look for:** `response_type=token` or `id_token token`; tokens read from the URL fragment; Resource Owner Password Credentials grant (`grant_type=password`) in a first- or third-party client.
|
|
61
|
+
- **Why:** implicit returns tokens in the URL where history, referrers and extensions see them, and there is no sender binding; password grant trains users to type credentials into the client and blocks MFA.
|
|
62
|
+
- **Map:** CWE-598 (sensitive data in GET) or CWE-522; `A07:2021`.
|
|
63
|
+
- **Rule out:** cite the configuration using `response_type=code` with PKCE everywhere in scope.
|
|
64
|
+
- **Fix check:** a config test that the authorization server rejects `response_type=token` for the client.
|
|
65
|
+
|
|
66
|
+
## Token validation on the resource server
|
|
67
|
+
|
|
68
|
+
- **Look for:** JWT decoded without verification (`jwt.decode`, `jwt-decode` used for auth decisions, `verify=False`, `options: { verifySignature: false }`); algorithms not pinned (accepting `none` or HS256 with the public key as secret); missing `aud` check, so a token issued to another client of the same IdP is accepted; missing `iss` check with multi-tenant IdPs; `exp`/`nbf` not checked or a huge clock skew; ID tokens accepted as API access tokens; opaque tokens never introspected.
|
|
69
|
+
- **Why:** any of these lets a token minted for something else, or by someone else, act as a valid credential.
|
|
70
|
+
- **Map:** CWE-347 (signature), CWE-345 (audience/issuer), CWE-613 (expiry); `A07:2021`.
|
|
71
|
+
- **Rule out:** cite the verify call with pinned algorithms, JWKS from the expected issuer, and explicit `audience` and `issuer` options, in the middleware applied to every route in scope.
|
|
72
|
+
- **Fix check:** tests presenting a token with a different `aud`, a different `iss`, `alg: none`, and an expired `exp`, each rejected.
|
|
73
|
+
|
|
74
|
+
## Token storage on mobile and web
|
|
75
|
+
|
|
76
|
+
- **Look for:** mobile: tokens in `UserDefaults`, `SharedPreferences`, plain files, or logs instead of Keychain / Keystore-backed storage; Keychain items with an accessibility class that allows backup or access while locked when not needed. Web: refresh tokens in `localStorage` or `sessionStorage`; access tokens in cookies without `HttpOnly`, `Secure`, `SameSite`; tokens in URLs.
|
|
77
|
+
- **Why:** device backups, other apps on rooted devices, and any XSS read these stores. A refresh token is a long-lived credential.
|
|
78
|
+
- **Map:** CWE-922 or CWE-312; mobile `M9:2024`; web `A02:2021` (or `A07:2021` if filed as session management).
|
|
79
|
+
- **Rule out:** cite the Keychain/Keystore wrapper call with the access class, or the server setting the cookie with `HttpOnly; Secure; SameSite`, plus a backend-for-frontend that keeps refresh tokens off the browser.
|
|
80
|
+
- **Fix check:** unit test that the token store writes to the secure store type; for web, a response test asserting cookie flags.
|
|
81
|
+
|
|
82
|
+
## Refresh token rotation and revocation
|
|
83
|
+
|
|
84
|
+
- **Look for:** refresh tokens that never expire; rotation off so the same refresh token works forever; no reuse detection (a replayed old refresh token does not revoke the family); logout that clears the client but does not revoke server-side; refresh endpoint that does not bind the token to the client id.
|
|
85
|
+
- **Why:** a stolen refresh token becomes permanent access, and logout gives a false sense of termination.
|
|
86
|
+
- **Map:** CWE-613; `A07:2021`.
|
|
87
|
+
- **Rule out:** cite the server config enabling rotation with reuse detection and an absolute lifetime, and the logout handler calling the revocation endpoint.
|
|
88
|
+
- **Fix check:** test that redeeming a refresh token twice fails the second time and invalidates the newer token too.
|
|
89
|
+
|
|
90
|
+
## Open redirects around the login flow
|
|
91
|
+
|
|
92
|
+
- **Look for:** `returnTo`, `next`, `redirect`, `continue` parameters passed to a redirect after login or logout without an allowlist; `post_logout_redirect_uri` not checked against the registered list; relative-path checks that accept `//evil.net` or `/\evil.net`.
|
|
93
|
+
- **Why:** the trusted login domain becomes a phishing launcher, and in some flows a token leaks through the referrer or fragment.
|
|
94
|
+
- **Map:** CWE-601; `A01:2021`.
|
|
95
|
+
- **Rule out:** cite the allowlist check or the same-origin parse (URL parse, compare origin) on every redirect target in scope.
|
|
96
|
+
- **Fix check:** test that `next=//evil.net` and `next=https://evil.net` redirect to a safe default.
|
|
97
|
+
|
|
98
|
+
## Diff-mode triggers
|
|
99
|
+
|
|
100
|
+
A change to OIDC client config, JWT middleware options, cookie settings, redirect handling or the token storage wrapper puts every route or screen that depends on it in scope. A removed `audience` option, a relaxed redirect comparison, or a switch from code to implicit flow is a removed control.
|
package/pipeline/skills/shared/external/security-review/references/owasp-mobile-top10-2024.md
CHANGED
|
@@ -9,7 +9,7 @@ CWEs: CWE-798 (hardcoded credentials), CWE-259, CWE-522.
|
|
|
9
9
|
|
|
10
10
|
## M2:2024 - Inadequate Supply Chain Security
|
|
11
11
|
|
|
12
|
-
Check: a dependency at a version with a known advisory, an unpinned SDK, a build step pulling an unverified artifact. This is the `security_dep_inventory` -> CVE path (`A06:2021`'s mobile analog).
|
|
12
|
+
Check: a dependency at a version with a known advisory, an unpinned SDK, a build step pulling an unverified artifact. This is the `multi-agent-toolkit:security_dep_inventory` -> CVE path (`A06:2021`'s mobile analog).
|
|
13
13
|
CWEs: CWE-1104, plus the advisory's CWE.
|
|
14
14
|
|
|
15
15
|
## M3:2024 - Insecure Authentication/Authorization
|
package/pipeline/skills/shared/external/security-review/references/owasp-web-api-top10-2021.md
CHANGED
|
@@ -31,7 +31,7 @@ CWEs: CWE-16, CWE-611 (XXE), CWE-732 (incorrect permissions), CWE-1032, CWE-756.
|
|
|
31
31
|
|
|
32
32
|
## A06:2021 - Vulnerable and Outdated Components
|
|
33
33
|
|
|
34
|
-
Check: a dependency at a version with a known advisory. This is the `security_dep_inventory` -> CVE-lookup path. Carry the `cve` and the advisory's CWE; put the finding on the manifest at line 0.
|
|
34
|
+
Check: a dependency at a version with a known advisory. This is the `multi-agent-toolkit:security_dep_inventory` -> CVE-lookup path. Carry the `cve` and the advisory's CWE; put the finding on the manifest at line 0.
|
|
35
35
|
CWEs: CWE-1104, plus the advisory's own CWE.
|
|
36
36
|
|
|
37
37
|
## A07:2021 - Identification and Authentication Failures
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Supabase - static review of RLS, keys, storage and exposed database objects
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
<!-- toc -->
|
|
6
|
+
- [Contents](#contents)
|
|
7
|
+
- [Scope and mapping](#scope-and-mapping)
|
|
8
|
+
- [RLS not enabled on an exposed table](#rls-not-enabled-on-an-exposed-table)
|
|
9
|
+
- [Policies that do not bind to auth.uid()](#policies-that-do-not-bind-to-authuid)
|
|
10
|
+
- [service_role key in a client or a public bundle](#service_role-key-in-a-client-or-a-public-bundle)
|
|
11
|
+
- [Storage bucket policies](#storage-bucket-policies)
|
|
12
|
+
- [Edge functions without caller verification](#edge-functions-without-caller-verification)
|
|
13
|
+
- [Views and functions exposed through PostgREST](#views-and-functions-exposed-through-postgrest)
|
|
14
|
+
- [Diff-mode triggers](#diff-mode-triggers)
|
|
15
|
+
<!-- /toc -->
|
|
16
|
+
|
|
17
|
+
## Scope and mapping
|
|
18
|
+
|
|
19
|
+
Covers SQL migrations (`supabase/migrations/*.sql`), `supabase/config.toml`, edge functions (`supabase/functions/*`), storage policies, and every client that holds a Supabase URL and key. The anon (publishable) key is meant to be public; it is only safe because RLS restricts what it can do. Every finding here is therefore about whether the database enforces the restriction, and evidence points at a migration line or a function line.
|
|
20
|
+
|
|
21
|
+
Schema mapping: database-side policies are server access control, so use `A01:2021`; a leaked privileged key is `A07:2021` (web) or `M1:2024` (mobile client). Pick the one that matches the file holding the defect.
|
|
22
|
+
|
|
23
|
+
## RLS not enabled on an exposed table
|
|
24
|
+
|
|
25
|
+
- **Look for:** `create table public.x (...)` with no matching `alter table public.x enable row level security;` in any migration; tables created through the dashboard and captured only in a dump; RLS enabled but `force row level security` absent where the table owner role is used by app code; tables in any schema listed in `config.toml` `[api] schemas`.
|
|
26
|
+
- **Why:** PostgREST exposes every table in an exposed schema. Without RLS, the public anon key reads and writes the whole table.
|
|
27
|
+
- **Map:** CWE-862; `A01:2021`.
|
|
28
|
+
- **Rule out:** cite the `enable row level security` line per table in scope, and for each the policies that exist. RLS enabled with zero policies denies everything to anon and authenticated, which is a valid closed state.
|
|
29
|
+
- **Fix check:** a SQL test (pgTAP or a script using `set local role anon;`) that `select` and `insert` on the table return zero rows or a permission error, failing today.
|
|
30
|
+
|
|
31
|
+
## Policies that do not bind to auth.uid()
|
|
32
|
+
|
|
33
|
+
- **Look for:** `using (true)` or `with check (true)`; `using (auth.role() = 'authenticated')` on per-user data; policies for `select` only while `update`/`delete` fall to a broader policy; `with check` missing on insert or update, so a user can write rows owned by someone else; ownership derived from a column the user can set (`user_id` supplied by the client with no `with check (user_id = auth.uid())`); policies trusting `auth.jwt() -> 'user_metadata'`, which the user can edit.
|
|
34
|
+
- **Why:** permissive policies are OR-ed, so one loose policy opens the table regardless of how strict the others are. `user_metadata` is user-writable; only `app_metadata` is server-controlled.
|
|
35
|
+
- **Map:** CWE-639; `A01:2021`.
|
|
36
|
+
- **Rule out:** cite each policy for the table and show every one constrains by `auth.uid()` (or a join to a membership table keyed by `auth.uid()`), with `with check` on insert and update, and any role claims read from `app_metadata`.
|
|
37
|
+
- **Fix check:** SQL test with `set local request.jwt.claims` for user A, asserting user B's rows are invisible and an insert with `user_id = B` fails.
|
|
38
|
+
|
|
39
|
+
## service_role key in a client or a public bundle
|
|
40
|
+
|
|
41
|
+
- **Look for:** `SUPABASE_SERVICE_ROLE_KEY` or a JWT whose payload has `"role":"service_role"` referenced from browser code, a `NEXT_PUBLIC_`/`VITE_`/`EXPO_PUBLIC_` variable, a mobile plist/xcconfig/`BuildConfig`, or a client-side `createClient(url, serviceKey)`; server code that creates a service client and then passes request input straight into queries.
|
|
42
|
+
- **Why:** service_role bypasses RLS entirely. In a client it is full database compromise; on a server it makes that code path responsible for every authorization decision.
|
|
43
|
+
- **Map:** CWE-798 (client exposure) or CWE-639 (server path with no ownership check); `A07:2021` / `M1:2024`, or `A01:2021` for the server path.
|
|
44
|
+
- **Rule out:** cite that the service key is only read in server-only modules (no public prefix, not imported by client entry points), and that each service-client query in scope carries an explicit ownership predicate. Detection of the raw key uses the pipeline secret gate.
|
|
45
|
+
- **Fix check:** a build check that the client bundle does not contain the string `service_role`; for server paths, a test that user A cannot reach user B's row through the endpoint.
|
|
46
|
+
|
|
47
|
+
## Storage bucket policies
|
|
48
|
+
|
|
49
|
+
- **Look for:** `insert into storage.buckets (id, name, public) values (..., true)` for buckets holding user documents; policies on `storage.objects` without a `bucket_id = '...'` term; ownership not tied to path, for example missing `(storage.foldername(name))[1] = auth.uid()::text`; no size or MIME restriction in bucket config; signed URLs with very long expiry generated for sensitive files.
|
|
50
|
+
- **Why:** a public bucket serves any object to anyone with the path, and paths are often guessable. Object policies without a bucket term apply to every bucket.
|
|
51
|
+
- **Map:** CWE-284 or CWE-639; `A01:2021`.
|
|
52
|
+
- **Rule out:** cite `public = false` for sensitive buckets and the `storage.objects` policy constraining both `bucket_id` and the uid folder, for select, insert, update and delete.
|
|
53
|
+
- **Fix check:** test that user A's client gets a policy error downloading `B-uid/file.pdf` and that a public URL for the bucket returns an error.
|
|
54
|
+
|
|
55
|
+
## Edge functions without caller verification
|
|
56
|
+
|
|
57
|
+
- **Look for:** `supabase/functions/*/index.ts` that builds a service-role client and acts on ids from the body without reading the `Authorization` header; `verify_jwt = false` in `config.toml` for a function that touches user data; calling `supabase.auth.getUser()` but ignoring the error; CORS `*` with credentials; webhook functions with no signature verification.
|
|
58
|
+
- **Why:** an edge function with a service client is a rules bypass, the same shape as a Firebase Admin SDK function.
|
|
59
|
+
- **Map:** CWE-306 or CWE-639; `A01:2021`; webhook signature: CWE-345, `A08:2021`.
|
|
60
|
+
- **Rule out:** cite the line that creates the client with the caller's `Authorization` header (so RLS applies) or the `getUser()` check plus ownership comparison before a service-client call; cite `verify_jwt` left at default true; cite the webhook HMAC comparison.
|
|
61
|
+
- **Fix check:** function test invoking without a JWT and with another user's JWT, both rejected.
|
|
62
|
+
|
|
63
|
+
## Views and functions exposed through PostgREST
|
|
64
|
+
|
|
65
|
+
- **Look for:** `create view` in an exposed schema without `with (security_invoker = true)` (views run as their owner by default, bypassing RLS of the base tables); `create function ... security definer` in `public` callable via `/rpc/` with no internal `auth.uid()` check; security definer functions without `set search_path = ''` (search-path hijack); `grant execute ... to anon` on admin functions; materialized views (no RLS support) in an exposed schema.
|
|
66
|
+
- **Why:** these objects return data the caller's RLS would have hidden. Security definer functions are effectively service_role endpoints.
|
|
67
|
+
- **Map:** CWE-269 or CWE-863; `A01:2021`; search path: CWE-427.
|
|
68
|
+
- **Rule out:** cite `security_invoker = true` on each view, or the view living in a schema not listed in `[api] schemas`; for each security definer function cite the `auth.uid()` check inside and the `set search_path` clause, and the `revoke execute ... from public, anon` line.
|
|
69
|
+
- **Fix check:** SQL test as anon and as another user calling the view and the RPC, asserting no foreign rows.
|
|
70
|
+
|
|
71
|
+
## Diff-mode triggers
|
|
72
|
+
|
|
73
|
+
A migration that drops a policy, disables RLS, adds a table or view to an exposed schema, changes `[api] schemas`, or adds `security definer` puts every table it touches in scope. A new client file that imports a server env helper is a candidate service-key exposure even if the key name did not change.
|