@igorlau/dotagents 1.0.21 → 1.0.22

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.
Files changed (108) hide show
  1. package/README.md +65 -65
  2. package/THIRD_PARTY_NOTICES.md +101 -6
  3. package/dist/build-info.json +1 -1
  4. package/dist/catalog.js +3 -3
  5. package/dist/cli.js +1 -1
  6. package/dist/commands.js +7 -5
  7. package/dist/manifest.js +8 -1
  8. package/dist/paths.js +0 -4
  9. package/dist/targets.js +3 -9
  10. package/dist/wizard.js +1 -1
  11. package/package.json +5 -3
  12. package/{plugin/rules → rules}/comments.upstream.json +1 -1
  13. package/{plugin/rules → rules}/ponytail.md +1 -1
  14. package/{plugin/rules → rules}/ponytail.upstream.json +1 -1
  15. package/{plugin/rules → rules}/writing.md +1 -2
  16. package/{plugin/rules → rules}/writing.upstream.json +1 -1
  17. package/{plugin/scaffold → scaffold}/AGENTS.md.tmpl +1 -1
  18. package/{plugin/skills → skills}/dot-code-review/SKILL.md +2 -0
  19. package/{plugin/skills → skills}/dot-code-review/UPSTREAM.json +1 -1
  20. package/skills/dot-code-review/references/finding-classes.md +33 -0
  21. package/{plugin/skills → skills}/dot-comments/UPSTREAM.json +1 -1
  22. package/{plugin/skills → skills}/dot-commit/SKILL.md +0 -2
  23. package/skills/dot-correct/UPSTREAM.json +8 -0
  24. package/{plugin/skills → skills}/dot-debug/UPSTREAM.json +1 -1
  25. package/{plugin/skills → skills}/dot-grilling/UPSTREAM.json +2 -2
  26. package/{plugin/skills → skills}/dot-handoff/UPSTREAM.json +1 -1
  27. package/{plugin/skills → skills}/dot-implement/SKILL.md +2 -2
  28. package/{plugin/skills → skills}/dot-plan/SKILL.md +3 -1
  29. package/{plugin/skills → skills}/dot-roadmap/SKILL.md +7 -4
  30. package/skills/dot-security-audit/SKILL.md +87 -0
  31. package/skills/dot-security-audit/UPSTREAM.json +8 -0
  32. package/skills/dot-security-audit/references/AI-AND-LLM.md +83 -0
  33. package/skills/dot-security-audit/references/ATTACK-CLASSES.md +130 -0
  34. package/skills/dot-security-audit/references/CLIENT-SIDE.md +83 -0
  35. package/skills/dot-security-audit/references/CLOUD-AND-DEPLOYMENT.md +86 -0
  36. package/skills/dot-security-audit/references/DATA-ISOLATION-AND-LIFECYCLE.md +84 -0
  37. package/skills/dot-security-audit/references/DESKTOP-MOBILE-AND-LOCAL-IPC.md +89 -0
  38. package/skills/dot-security-audit/references/MEMORY-SAFETY-AND-BINARY.md +101 -0
  39. package/skills/dot-security-audit/references/PROTOCOLS-RPC-AND-MESSAGING.md +81 -0
  40. package/skills/dot-security-audit/references/RESOURCE-EXHAUSTION-AND-AVAILABILITY.md +78 -0
  41. package/skills/dot-security-audit/references/SUPPLY-CHAIN-AND-RELEASE.md +73 -0
  42. package/skills/dot-security-audit/references/WEB-PROTOCOL-AND-AUTH.md +105 -0
  43. package/skills/dot-security-changes/SKILL.md +68 -0
  44. package/{plugin/skills → skills}/dot-testing/UPSTREAM.json +1 -1
  45. package/skills/dot-ui-review/SKILL.md +79 -0
  46. package/skills/dot-ui-review/UPSTREAM.json +8 -0
  47. package/skills/dot-ux-review/SKILL.md +50 -0
  48. package/skills/dot-ux-review/UPSTREAM.json +8 -0
  49. package/skills/dot-ux-review/references/web-interface-guidelines.md +191 -0
  50. package/{plugin/skills/dot-stack-review → skills/dot-walkthrough-branch}/SKILL.md +9 -30
  51. package/skills/dot-walkthrough-branch/references/layers.md +38 -0
  52. package/{plugin/skills/dot-stack-review → skills/dot-walkthrough-branch}/scripts/page.mjs +39 -10
  53. package/skills/dot-walkthrough-changes/SKILL.md +62 -0
  54. package/skills/dot-writing-for-agents/UPSTREAM.json +8 -0
  55. package/plugin/.claude-plugin/plugin.json +0 -10
  56. package/plugin/agents/dot-implementer.md +0 -27
  57. package/plugin/agents/dot-reviewer.md +0 -44
  58. package/plugin/agents/dot-tester.md +0 -25
  59. package/plugin/hooks/check.mjs +0 -118
  60. package/plugin/hooks/hooks.json +0 -54
  61. package/plugin/hooks/rules.mjs +0 -27
  62. package/plugin/skills/dot-correct/UPSTREAM.json +0 -8
  63. package/plugin/skills/dot-correct/agents/openai.yaml +0 -5
  64. package/plugin/skills/dot-debug/agents/openai.yaml +0 -3
  65. package/plugin/skills/dot-flow/SKILL.md +0 -105
  66. package/plugin/skills/dot-flow/agents/openai.yaml +0 -5
  67. package/plugin/skills/dot-flow/references/fix-round.md +0 -64
  68. package/plugin/skills/dot-flow/references/inline.md +0 -9
  69. package/plugin/skills/dot-grilling/agents/openai.yaml +0 -3
  70. package/plugin/skills/dot-handoff/agents/openai.yaml +0 -5
  71. package/plugin/skills/dot-roadmap/agents/openai.yaml +0 -5
  72. package/plugin/skills/dot-stack-review/agents/openai.yaml +0 -5
  73. package/plugin/skills/dot-writing-for-agents/UPSTREAM.json +0 -8
  74. package/plugin/skills/dot-writing-for-agents/agents/openai.yaml +0 -3
  75. /package/{plugin/rules → rules}/code-style.md +0 -0
  76. /package/{plugin/rules → rules}/comments.md +0 -0
  77. /package/{plugin/rules → rules}/core.md +0 -0
  78. /package/{plugin/scaffold → scaffold}/.claude/settings.json.tmpl +0 -0
  79. /package/{plugin/scaffold → scaffold}/.editorconfig.tmpl +0 -0
  80. /package/{plugin/scaffold → scaffold}/.gitattributes.tmpl +0 -0
  81. /package/{plugin/scaffold → scaffold}/CLAUDE.md.tmpl +0 -0
  82. /package/{plugin/skills → skills}/dot-code-review/references/maintainability.md +0 -0
  83. /package/{plugin/skills → skills}/dot-comments/SKILL.md +0 -0
  84. /package/{plugin/skills → skills}/dot-correct/SKILL.md +0 -0
  85. /package/{plugin/skills → skills}/dot-debug/SKILL.md +0 -0
  86. /package/{plugin/skills → skills}/dot-debug/references/loops.md +0 -0
  87. /package/{plugin/skills → skills}/dot-debug/scripts/hitl-loop.template.sh +0 -0
  88. /package/{plugin/skills → skills}/dot-docs-writing/SKILL.md +0 -0
  89. /package/{plugin/skills → skills}/dot-docs-writing/references/formatting.md +0 -0
  90. /package/{plugin/skills → skills}/dot-docs-writing/references/global-and-accessible.md +0 -0
  91. /package/{plugin/skills → skills}/dot-docs-writing/references/word-list.md +0 -0
  92. /package/{plugin/skills → skills}/dot-grilling/SKILL.md +0 -0
  93. /package/{plugin/skills → skills}/dot-handoff/SKILL.md +0 -0
  94. /package/{plugin/skills → skills}/dot-implement/UPSTREAM.json +0 -0
  95. /package/{plugin/skills → skills}/dot-implement/references/typescript.md +0 -0
  96. /package/{plugin/skills → skills}/dot-plan/UPSTREAM.json +0 -0
  97. /package/{plugin/skills → skills}/dot-plan/references/entity-schemas.md +0 -0
  98. /package/{plugin/skills → skills}/dot-roadmap/UPSTREAM.json +0 -0
  99. /package/{plugin/skills → skills}/dot-roadmap/references/wide-refactor.md +0 -0
  100. /package/{plugin/skills → skills}/dot-testing/SKILL.md +0 -0
  101. /package/{plugin/skills → skills}/dot-testing/references/after-implement.md +0 -0
  102. /package/{plugin/skills → skills}/dot-testing/references/http.md +0 -0
  103. /package/{plugin/skills → skills}/dot-testing/references/shared-state.md +0 -0
  104. /package/{plugin/skills → skills}/dot-testing/references/typescript.md +0 -0
  105. /package/{plugin/skills → skills}/dot-writing-for-agents/SKILL.md +0 -0
  106. /package/{plugin/skills → skills}/dot-writing-for-agents/references/pointers.md +0 -0
  107. /package/{plugin/skills → skills}/dot-writing-for-agents/references/skill-mechanics.md +0 -0
  108. /package/{plugin/skills → skills}/dot-writing-for-agents/references/steps.md +0 -0
@@ -0,0 +1,86 @@
1
+ # Cloud and Deployment Hunting
2
+
3
+ #### When to use this file
4
+
5
+ Reach for this file when the repository defines cloud identity, infrastructure, containers, Kubernetes, service mesh, serverless functions, edge workers, ingress, object storage, managed services, or environment-specific configuration. This domain asks whether deployed components receive the intended identity, isolation, network reachability, secrets, and policy. Source often expresses intent rather than live fact, so separate source-confirmed defects from deployment validation needs.
6
+
7
+ Use `SUPPLY-CHAIN-AND-RELEASE.md` for build and promotion trust, `WEB-PROTOCOL-AND-AUTH.md` for HTTP proxy semantics, and `DATA-ISOLATION-AND-LIFECYCLE.md` for data-store tenant scope.
8
+
9
+ ## Core discipline (include in every agent prompt for this domain)
10
+
11
+ ```
12
+ - Do not infer a live exposure from a manifest alone. Establish which environment consumes it, what defaults or overlays modify it, and whether the source path is active.
13
+ - Map each workload's identity to specific operations and resources. Broad policy is a finding only when lower-trust input can reach an unauthorized action.
14
+ - Ingress, proxies, service mesh, metadata services, and admission policy are real boundaries, but only count a control when its configuration and attachment are visible.
15
+ - Secret references are not secret disclosure. Require a lower-trust reader, output, artifact, log path, or unsafe fallback.
16
+ - Use `confirmed` for active in-repo configurations and local rendering/policy validation. Use `needs_validation` for account policy, network attachment, runtime admission, hosted metadata, or drift that needs owner observation.
17
+ ```
18
+
19
+ ## Workload identity and IAM attack classes
20
+
21
+ **Workload identity overreach**
22
+ A workload, pod, function, edge worker, or node identity can act on tenants, accounts, resources, or APIs beyond its role, and untrusted request or job input selects that target. Review cloud policy conditions, resource patterns, service-account attachment, namespace mapping, and fallback credentials.
23
+
24
+ **Cross-account or cross-tenant role confusion**
25
+ Role assumption, external IDs, token exchange, workload federation, or resource policies accept identity claims not bound to the intended source account, audience, repository, namespace, or workload. Establish both trust policy and caller-controlled claim.
26
+
27
+ **Application authorization delegated to cloud metadata**
28
+ An app trusts caller-supplied identity headers, tags, labels, account IDs, or resource metadata without verifying they came from the cloud control plane or a trusted proxy. Cloud IAM and application authorization are separate checks.
29
+
30
+ ## Ingress, network, and control-plane attack classes
31
+
32
+ **Unexpected service or management-plane reachability**
33
+ An ingress, service, listener, security group, load-balancer annotation, port mapping, or server bind exposes an admin, debug, metrics, node, control-plane, or internal API to a lower-trust network. Missing network controls alone are `needs_validation`; a repository-controlled public route to a sensitive handler can be `confirmed`.
34
+
35
+ **Trusted-proxy and mesh identity bypass**
36
+ A backend accepts forwarded identity, mTLS subject, or authorization metadata from peers outside the intended ingress/sidecar, or an alternate port and health/legacy path bypasses the mesh. Verify header stripping, peer reachability, and fail-open behavior when the proxy is absent.
37
+
38
+ **Metadata and internal-service reachability**
39
+ An untrusted URL, destination, or protocol selection reaches instance/container metadata, control-plane sockets, or internal APIs with workload credentials. Trace URL parsing and redirect handling under `ATTACK-CLASSES.md`; here establish deployed network, metadata-version, and identity boundaries.
40
+
41
+ ## Container and orchestration attack classes
42
+
43
+ **Host or control-plane capability exposure**
44
+ A lower-trust workload can select privileged mode, capabilities, host namespaces, host paths, device mounts, container runtime sockets, or service-account tokens that cross into node/control-plane authority. Bare absence of seccomp or read-only filesystem is hardening unless a reachable operation crosses that boundary.
45
+
46
+ **Admission and policy path inconsistency**
47
+ One deployment route enforces image identity, namespace, resource, secret, or privilege policy while another controller, job, upgrade, restore, or compatibility path does not. Confirm the alternate route and resulting deployed object.
48
+
49
+ **Namespace and label trust confusion**
50
+ Network, admission, secret, or workload-identity policy relies on labels, annotations, names, or namespaces that a less-trusted principal can set. Compare who controls selectors with what authority matching grants.
51
+
52
+ ## Configuration and secret lifecycle attack classes
53
+
54
+ **Security-control precedence drift**
55
+ Development values, chart defaults, environment variables, command-line flags, feature gates, sidecar injection, or per-region overlays disable authentication, transport security, tenant scoping, or audit policy in a deployed environment. Render the final configuration for each maintained deployment, not just the base file.
56
+
57
+ **Secret exposure across workload boundaries**
58
+ Secrets enter logs, crash reports, process arguments, shared environment, broad volumes, build outputs, service discovery, or read APIs accessible to another workload or tenant. Check secret type and authority; a public endpoint or key ID is not a credential.
59
+
60
+ **Credential renewal and outage fallback**
61
+ Failure to mount, refresh, rotate, or revoke a workload credential causes stale credentials to remain active or an app to accept a less trusted identity mode. Review startup, readiness, reconnect, and cached-client behavior.
62
+
63
+ ## Managed storage, events, and edge attack classes
64
+
65
+ **Object and signed-URL policy confusion**
66
+ Bucket/container policy, object keys, CDN origins, or signed URLs fail to bind principal, operation, object namespace, audience, or expiry. Review list/version operations and write paths as well as reads.
67
+
68
+ **Event-source identity confusion**
69
+ A function or worker trusts event body fields as source identity without validating provider-signed envelope, subscription/topic, account, region, and replay state. Compare push, pull, retry, and dead-letter paths.
70
+
71
+ **Edge/runtime boundary mismatch**
72
+ An edge or serverless runtime assumes a secret, API, filesystem, isolation, or tenant policy that differs from the origin runtime, and fallback to origin changes authority or cache behavior. Confirm which configuration selects each path.
73
+
74
+ ## Universal moves (apply across the above)
75
+
76
+ - Render every maintained environment and make a matrix of external port, workload identity, network peers, mounted secrets, and cloud resources. Differences require an owner or policy explanation.
77
+ - Follow a lower-trust request, object, label, or event into cloud policy. Show which workload credential performs the final operation and what condition should scope it.
78
+ - Diff normal deploy, migration, restore, node maintenance, failover, and local/emulator paths. Review behavior when mesh, admission, identity, secret, or policy service is unavailable.
79
+
80
+ ## Validation rules (apply before reporting ANY finding here)
81
+
82
+ 1. Establish the active source path and effective deployment object; otherwise use `needs_validation` and state which rendered manifest or owner-observed attachment is missing.
83
+ 2. Name the lower-trust caller/workload, cloud or application identity, controllable selector, affected resource, and unauthorized operation or disclosure.
84
+ 3. Verify provider and orchestrator defaults at the pinned version. Do not assume a public IP, reachable metadata service, permissive firewall, or absent admission attachment.
85
+ 4. Local validation may render templates, evaluate policy, inspect container/user namespaces in an isolated fixture, or run an emulator with dummy identities. Do not probe live endpoints or alter shared cloud resources.
86
+ 5. Return `confirmed` only with a complete active source trace and concrete boundary result. Return `needs_validation` with the exact deployed policy, identity attachment, overlay, network, or drift observation needed.
@@ -0,0 +1,84 @@
1
+ # Data Isolation and Lifecycle Hunting
2
+
3
+ #### When to use this file
4
+
5
+ Reach for this file when the target stores multi-tenant or access-controlled data, derives search/index/cache/analytics copies, issues object links, exports or restores records, migrates schemas, or promises deletion, revocation, and retention behavior. This domain follows one data item through every copy and state transition. Use `ATTACK-CLASSES.md` for endpoint-level access control and `CLOUD-AND-DEPLOYMENT.md` for provider-level storage policy.
6
+
7
+ Split large targets by primary storage, cache/search, object/blob storage, analytics/logging, export/backup, deletion/revocation, and migration.
8
+
9
+ ## Core discipline (include in every agent prompt for this domain)
10
+
11
+ ```
12
+ - A tenant or owner field on a record is not isolation. Find the query, key, path, policy, or row-level control that enforces it for each read and write path.
13
+ - Trace derived copies. Sanitized primary data can become unsafe in search, cache, analytics, export, previews, logs, replicas, and backups with different ACL and retention rules.
14
+ - Deletion and revocation are lifecycle contracts. Check current, historical, cached, indexed, exported, restored, and queued copies within the product's stated boundary.
15
+ - Privacy or retention preference is not automatically a security vulnerability. Require an explicit data-access boundary or deletion/revocation guarantee and an unauthorized reader or later operation.
16
+ - Use `confirmed` for complete source-visible lineage and bounded dummy-tenant tests. Use `needs_validation` when external storage policy, retention, CDN behavior, replica lag, or backup access is unavailable.
17
+ ```
18
+
19
+ ## Tenant and object-isolation attack classes
20
+
21
+ **Missing tenant or owner enforcement**
22
+ A read, update, delete, list, count, or bulk query identifies an object without binding it to the authenticated tenant/owner, or trusts body fields to supply that identity. Compare direct lookup, nested relationship, background, admin, import, and legacy paths.
23
+
24
+ **Composite-key and namespace collision**
25
+ Cache keys, object paths, database uniqueness, search document IDs, temporary files, or deduplication keys omit tenant or environment. Two principals can overwrite or retrieve the same logical key even though application records carry separate owners.
26
+
27
+ **Policy and query disagreement**
28
+ Row-level policy, ORM default scopes, authorization filters, and raw/bypass clients apply different predicates. Check joins, aggregates, aliases, views, transactions, `unscoped` or service clients, and error paths where context is missing.
29
+
30
+ **Blob and signed-reference overreach**
31
+ Object keys, attachment IDs, version IDs, shared links, or signed URLs permit operations or namespaces beyond the issuing principal's access, or remain valid after the underlying ACL changes. Bind operation, exact object/version, audience, expiry, and tenant.
32
+
33
+ ## Derived-data and disclosure attack classes
34
+
35
+ **Search, cache, and index ACL drift**
36
+ A primary record's ACL or lifecycle changes without invalidating a searchable, cached, embedded, thumbnail, RSS, preview, or index copy. Validate filtering at retrieval time as well as document ingestion and invalidation.
37
+
38
+ **Analytics, logs, traces, and diagnostics as alternate readers**
39
+ Private content or credentials are emitted into systems with broader access, longer retention, or tenant mixing. Confirm the data class and realistic reader; field names, public identifiers, and operator-only content under intended policy are not enough.
40
+
41
+ **Enumeration and aggregate oracles**
42
+ Counts, filters, ordering, errors, unique constraints, timings, notification behavior, or existence checks disclose protected object or account state. Require a concrete confidential predicate and observable distinction, not general response variance.
43
+
44
+ ## Export, backup, restore, and migration attack classes
45
+
46
+ **Export and backup scope expansion**
47
+ An export, snapshot, portability package, report, or backup includes other tenants, inaccessible object fields, soft-deleted data, secret values, or history above the requester's access. Check per-item authorization after selection and authorization to download the final artifact.
48
+
49
+ **Import and restore authority expansion**
50
+ Restore/import bypasses owner, schema, ACL, uniqueness, or validation rules, overwrites existing resources, or recreates records in a tenant the requester cannot write. Validate archive contents as untrusted and authorize the resulting operation rather than trusting prior provenance.
51
+
52
+ **Migration default and ownership confusion**
53
+ Old records lack tenant/ACL/lifecycle fields, incompatible IDs collide, or partial rollout makes new and old readers apply different defaults. Review backfill, dual-read/write, compatibility, rollback, and resumed-migration paths.
54
+
55
+ **Backup and replication boundary drift**
56
+ Encryption keys, storage accounts, cross-region replicas, restoration environments, or support snapshots have broader identity or tenant scope than primary data. Source can confirm only in-repo policy; hosted access and retention require `needs_validation`.
57
+
58
+ ## Deletion, revocation, and lifecycle attack classes
59
+
60
+ **Soft-delete and tombstone bypass**
61
+ Direct lookup, search, relation traversal, object link, background processor, or restore ignores the lifecycle predicate and returns or acts on a deleted/revoked record. Check whether soft-deleted identifiers can be re-registered before all references are gone.
62
+
63
+ **Stale authorization and derived copy use**
64
+ Membership removal, ACL update, consent withdrawal, secret revocation, or role downgrade does not invalidate sessions, caches, subscriptions, jobs, or materialized data that continue to authorize future operations.
65
+
66
+ **Retention and queued-work overrun**
67
+ Deletion completes in primary storage while queued processors, retries, exports, analytics, or generated artifacts recreate or retain the data beyond the promised boundary. Find idempotent deletion and tombstone propagation.
68
+
69
+ **Restore reintroduces invalid state**
70
+ Backup, undo, undelete, or replica recovery restores data, credentials, memberships, or permissions that current policy no longer allows. Re-authorize restored state and reapply lifecycle changes made after the snapshot.
71
+
72
+ ## Universal moves (apply across the above)
73
+
74
+ - Pick one protected record and draw primary write, query, cache, index, event, export, backup, deletion, and restore paths. Mark principal and tenant at every edge.
75
+ - Compare two dummy tenants through the same local service methods, then repeat after ACL change, deletion, account switch, and restore. Do not use real user data.
76
+ - Start at bypass clients, background jobs, migrations, global uniqueness, and cache keys. These paths commonly omit request-scoped identity that interactive endpoints carry.
77
+
78
+ ## Validation rules (apply before reporting ANY finding here)
79
+
80
+ 1. Name attacker or lower-trust principal, protected data/state, affected owner/tenant, alternate copy or operation, and unauthorized disclosure or mutation.
81
+ 2. Cite both intended source-of-truth policy and the path that omits or disagrees with it. Confirm another layer does not enforce the same tenant/lifecycle condition.
82
+ 3. Use local dummy tenants and non-sensitive fixtures to prove cross-scope access or stale lifecycle behavior. Stop at the minimum observable record or operation.
83
+ 4. If external cache, object storage, replicas, analytics, backup, or retention policy is required, classify `needs_validation` and state the owner-observed check.
84
+ 5. Return `confirmed` only with complete lineage and concrete boundary impact. Return `needs_validation` with the exact unresolved storage, ACL, invalidation, retention, or restore fact.
@@ -0,0 +1,89 @@
1
+ # Desktop, Mobile, and Local IPC Hunting
2
+
3
+ #### When to use this file
4
+
5
+ Reach for this file when the target is a desktop or mobile app, privileged helper, updater, local daemon, webview host, deep-link handler, browser native-messaging host, or local IPC client/server. Relevant untrusted actors may be a downloaded document, remote web content, another local app, another OS user, a sandboxed process, or a lower-privilege account. State that starting capability instead of treating all local users as equivalent.
6
+
7
+ Use `CLIENT-SIDE.md` for browser-side webview behavior, `MEMORY-SAFETY-AND-BINARY.md` for native memory and loader safety, and `SUPPLY-CHAIN-AND-RELEASE.md` for update authenticity.
8
+
9
+ ## Core discipline (include in every agent prompt for this domain)
10
+
11
+ ```
12
+ - Establish the realistic local or remote-content attacker: another app, another OS user, a sandboxed child, an untrusted document, or a remote origin. Self-harm within the same account and authority is not a boundary violation.
13
+ - Paths, process names, bundle/package IDs, and claimed sender fields are not peer authentication. Use OS peer credentials, code identity, capability handles, or protected channel state.
14
+ - The native bridge or helper must authorize each operation and final resource after parsing. A trusted UI or broker does not make attacker-influenceable arguments trusted.
15
+ - OS sandbox, signing, entitlements, permissions, keychain ACLs, exported-component policy, and prompt behavior are real controls when pinned and visible.
16
+ - Use `confirmed` for source evidence plus bounded local/emulator tests. Use `needs_validation` when signing, manifest merge, OS version, device policy, installer ACL, or packaging is required but not observable.
17
+ ```
18
+
19
+ ## Deep-link, callback, and navigation attack classes
20
+
21
+ **Custom-scheme and deep-link ambiguity**
22
+ Another app or page can invoke a route that mutates state, imports data, completes authentication, or selects an account without a current-session and one-time callback binding. Review URI normalization, duplicate query fields, scheme/host/path matching, exported activity/handler policy, and stale/replayed links.
23
+
24
+ **App and account handoff confusion**
25
+ OAuth, SSO, magic-link, invite, device pairing, passwordless, or payment callbacks return to the wrong installed app, profile, tenant, or pending transaction. Bind state to the initiating app identity, current session, account, provider, operation, and expiry.
26
+
27
+ **File-open and intent authority confusion**
28
+ An associated file, share intent, drag/drop item, pasteboard/clipboard record, notification action, or open-file event triggers a privileged operation without confirming content type, sender trust where applicable, current user intent, and final target.
29
+
30
+ ## Webview and native-bridge attack classes
31
+
32
+ **Navigation-origin to bridge confusion**
33
+ Remote or attacker-controlled frames can reach a JavaScript/native bridge intended only for packaged content. Validate origin at call time and after every navigation, redirect, subframe creation, popup, and error/fallback page. URL-prefix checks and initial-load checks are insufficient.
34
+
35
+ **Over-broad native bridge capabilities**
36
+ Web content can select arbitrary files, commands, IPC methods, credentials, or system actions through a generic bridge. Check method allowlists, normalized arguments, user/tenant authority, gesture/confirmation requirements, and return-value disclosure.
37
+
38
+ **Webview file and universal access**
39
+ Remote content can read app-local files, privileged custom schemes, or internal origins because file access, universal access, mixed content, debug interfaces, or custom protocol handlers join origins unexpectedly. Missing a restrictive setting without reachable protected content is hardening.
40
+
41
+ ## Local IPC and exported-component attack classes
42
+
43
+ **IPC peer-authentication gaps**
44
+ Unix sockets, named pipes, XPC, Binder, D-Bus, native messaging, RPC, shared memory, or loopback listeners accept a lower-trust peer without checking OS credentials, code identity, sandbox token, or channel ownership. Require a meaningful method or disclosure behind the channel.
45
+
46
+ **Claimed principal versus channel identity**
47
+ The authenticated process/channel belongs to one app or user, but request fields select another user, tenant, profile, or capability. Bind each method and resource to the peer credential rather than a caller-declared identifier.
48
+
49
+ **Exported service, activity, receiver, or provider overreach**
50
+ A mobile component or local automation endpoint is externally invokable and performs an operation intended for the app itself. Review final merged manifests, intent filters, permission/signature level, path grants, and alternate aliases. Manifest status unknown after packaging requires `needs_validation`.
51
+
52
+ **IPC lifecycle and correlation confusion**
53
+ Predictable request IDs, reused handles, stale channels, inherited descriptors, world-writable socket paths, or restart behavior lets one peer answer, cancel, or reuse another peer's operation. Review creation permissions and cleanup of socket files, locks, ports, and shared mappings.
54
+
55
+ ## Privileged-helper and local-file attack classes
56
+
57
+ **Privileged helper as confused deputy**
58
+ A low-privilege caller can select a privileged command, file, service, user, or system setting without per-operation authorization. Review sudo/polkit/UAC/XPC helper rules and ensure the helper independently validates normalized arguments.
59
+
60
+ **Install, update, and repair path trust**
61
+ A privileged installer/helper reads manifests, scripts, packages, symlinks, working directories, or repair state writable by a lower-trust actor after authorization. Bind authorization to immutable content and safe destination paths.
62
+
63
+ **Local file ownership and TOCTOU**
64
+ The app checks a file/path then follows replacement, symlink, mount, or case/normalization changes during a privileged read/write. Use descriptor-relative operations and verify final ownership. Focus `MEMORY-SAFETY-AND-BINARY.md` on parsing after the file is opened.
65
+
66
+ **Credential-store and local-secret boundary mismatch**
67
+ A keychain/keystore item, token file, backup, log, clipboard, notification preview, or local config is readable by another app/profile/user with less authority. Plaintext readable only by the same intended OS account is not automatically a vulnerability; state the lower-trust reader and credential power.
68
+
69
+ ## Application-state and device-lifecycle attack classes
70
+
71
+ **Account switch, logout, and device restore leakage**
72
+ Cached data, background tasks, widgets, notifications, local databases, webview storage, or biometric approvals survive logout/account change and appear under a later account. Review backup/restore and multi-profile behavior.
73
+
74
+ **Pending-action and user-presence confusion**
75
+ Notification, widget, shortcut, share sheet, biometric prompt, or deferred operation authorizes a different action than displayed, executes after expiry, or uses another profile's pending state. Bind confirmation to normalized action, resource, account, and current foreground state.
76
+
77
+ ## Universal moves (apply across the above)
78
+
79
+ - Enumerate every process, app component, local endpoint, URI scheme, file association, webview origin, and helper. Record OS identity, runtime privilege, caller, and callable operation.
80
+ - Read final packaging inputs: merged manifest, entitlements, installer rules, native-messaging registration, protocol handlers, and ACL creation. Source declarations can be overwritten downstream.
81
+ - Validate with dummy profiles and non-sensitive local fixtures on an isolated machine/emulator. Do not interact with other users' apps, credentials, or production services.
82
+
83
+ ## Validation rules (apply before reporting ANY finding here)
84
+
85
+ 1. Name the attacker starting capability, OS/app principal crossed, entry channel, accepted argument or state, and unauthorized operation or disclosure.
86
+ 2. Confirm OS sandbox, peer credential, signing, entitlement, permission, user-consent, and installer controls that apply. Unknown packaging/runtime facts require `needs_validation`.
87
+ 3. For webview bridges, cite both navigation/origin control and privileged native sink. For IPC, cite peer authentication and per-resource authorization. For helpers, verify final normalized destination.
88
+ 4. Keep local tests bounded and use dummy content/accounts. Stop after proving the boundary result; do not extend proof into persistence or broader system modification.
89
+ 5. Return `confirmed` only with a complete source and local evidence chain. Return `needs_validation` with the exact OS, manifest, signing, ACL, or device-lifecycle fact required.
@@ -0,0 +1,101 @@
1
+ # Memory Safety, Binary, and Kernel Hunting
2
+
3
+ #### When to use this file
4
+
5
+ Reach for this file when the target processes untrusted bytes in a memory-unsafe or privileged context: C/C++/Objective-C, Rust `unsafe`, FFI, kernel modules and drivers, parsers and decoders, network daemons, firmware, binary loaders, language runtimes, and JITs. Use `PROTOCOLS-RPC-AND-MESSAGING.md` for protocol authorization and state-machine logic, and this file for process integrity, memory safety, ABI boundaries, and loader behavior.
6
+
7
+ Pick relevant classes from the map step and split large targets by parser, allocator/lifetime, FFI, concurrency, loader, runtime, or privileged interface.
8
+
9
+ ## Core discipline (include in every agent prompt for this domain)
10
+
11
+ ```
12
+ - Re-derive every bound and lifetime from attacker-controlled inputs and all callers. Validate against the worst accepted case, not a typical test vector.
13
+ - A panic, sanitizer finding, or crash proves a defect only when a realistic untrusted input reaches it. Do not infer memory corruption, code execution, or shared availability impact from a label alone.
14
+ - Validate in a local harness with sanitizers, deterministic concurrency tests, existing fuzz targets, and debugger-assisted fault classification. Stop after proving the violated invariant and observable impact; do not develop post-corruption techniques.
15
+ - Assembly, JIT code, custom allocators, intra-object accesses, and foreign libraries can escape sanitizer coverage. Identify which relevant instructions are instrumented.
16
+ - Classify as `confirmed` only after source evidence and bounded local validation establish the defect and effect. Use `needs_validation` when ABI, allocator, architecture, feature, deployment, or reachability facts remain unknown.
17
+ ```
18
+
19
+ ## Bounds, integer, and representation attack classes
20
+
21
+ **Out-of-bounds read or write**
22
+ A length, offset, index, or terminator reaches a fixed or allocated buffer without a correct bound. Recalculate available headroom after prefixes, alignment, padding, and terminators. Check both source and destination capacity, and whether a short input is read before its declared length is trusted.
23
+
24
+ **Integer overflow, underflow, truncation, and signedness**
25
+ Review attacker-controlled arithmetic before allocation, copy, loop, indexing, and pointer operations. High-hit patterns include `a - b` with `b > a`, `count * element_size`, additions near the type maximum, negative values converted to unsigned, 64-bit lengths narrowed to 32-bit fields, and sentinel values such as `-1` becoming a large size. Confirm which checked representation is later used.
26
+
27
+ **Unit and pointer-depth confusion**
28
+ Code mixes bytes, elements, code units, pages, words, wire units, or nested pointer element sizes. Compare the unit at parse, validation, allocation, API boundary, and copy. A bounds check using the same wrong unit as the allocation is still wrong.
29
+
30
+ **Uninitialized or partially initialized data**
31
+ A buffer, padding, struct field, or vector capacity is returned, compared, hashed, serialized, or passed across a trust boundary before initialization. Require an observable consumer and realistic output length; stack allocation by itself is not disclosure.
32
+
33
+ ## Lifetime, type, and concurrency attack classes
34
+
35
+ **Use-after-free, stale view, and double free**
36
+ Owners are released while callbacks, wait queues, timers, iterators, borrowed slices, or cached raw pointers can still use them. Review every error, cancellation, close, and realloc path. For embedded notification anchors, each free path must drain or detach all observers.
37
+
38
+ **Type confusion and invalid downcast**
39
+ A tag, vtable, union discriminator, object kind, or foreign handle is checked differently from the representation later read. Look for unchecked dynamic casts, stale tags after reuse, and serialized types whose validated element differs from the element consumed. Confirm a wrong-type read or write locally without extending the test beyond the violated invariant.
40
+
41
+ **Reference-count and ownership races**
42
+ Non-atomic retain/release, a check followed by an unlocked use, or inconsistent ownership across threads can free or mutate an object during access. Compare fast, error, shutdown, and compatibility paths for the same lock and ownership rules.
43
+
44
+ **Shared-state races and TOCTOU**
45
+ Concurrent parser streams, global caches, lazy initialization, signal handlers, and resource teardown can invalidate bounds, policy, or pointers established earlier. Verify the race with a repeatable local schedule, barrier, or thread sanitizer; a hypothetical interleaving without a security-relevant state transition remains `needs_validation`.
46
+
47
+ **Lock-order, deadlock, and starvation**
48
+ Externally reachable operations acquire locks in inconsistent order or hold them across callbacks and blocking I/O. Report under availability only when bounded input can stop shared progress; otherwise record it for fixing as a concurrency defect.
49
+
50
+ ## FFI and ABI attack classes
51
+
52
+ **Pointer-length and ownership contract mismatch**
53
+ Caller and callee disagree on who allocates, frees, pins, or mutates a buffer, how long a pointer remains valid, or whether a length is bytes or elements. Trace both sides of every `extern`, CGo/JNI/Python/native binding, and generated wrapper. Check null, zero length, aliasing, and callback retention.
54
+
55
+ **Layout, alignment, and enum disagreement**
56
+ Foreign code receives a struct, bitfield, packed record, callback signature, integer width, enum, or calling convention that differs by architecture or build flag. Verify `repr`, packing, alignment, endianness, and ABI-specific types. An in-repo declaration mismatch can be confirmed locally; an opaque foreign implementation requires `needs_validation`.
57
+
58
+ **Unwind, exception, and thread-affinity violations**
59
+ Exceptions or panics cross an ABI that forbids unwinding, callbacks run after teardown, or APIs requiring one runtime thread are invoked elsewhere. Review error conversion and cancellation. Confirm whether the process aborts or state is corrupted before assigning impact.
60
+
61
+ ## Binary loading and runtime attack classes
62
+
63
+ **Library, plugin, and executable search-order trust**
64
+ A privileged process loads a library, plugin, runtime image, or helper from a path writable by a less-trusted principal, or resolves a bare name through an attacker-influenceable working directory or environment. Compare intended installation ownership with each fallback and compatibility search path. A user loading their own plugin into their own process is not a boundary violation.
65
+
66
+ **Missing artifact identity or signature binding**
67
+ A loader verifies one file or metadata record but maps a different image because path resolution, file replacement, architecture slices, or embedded resources are not bound to the check. Supply-channel authenticity belongs in `SUPPLY-CHAIN-AND-RELEASE.md`; this class covers the local verification-to-map gap.
68
+
69
+ **Malformed binary metadata and relocation handling**
70
+ Offsets, counts, sections, relocations, symbols, bytecode, or debug metadata are trusted before range, overlap, and representation checks. Test parsers with bounded local fixtures and sanitizers. Separate memory corruption from a safely rejected malformed file.
71
+
72
+ **JIT and generated-code consistency**
73
+ Validator, interpreter, optimizer, and generated code disagree about types, bounds, side effects, or lifetime. Diff optimized and unoptimized paths using the same local input. Confirm a process-integrity effect; output variance that stays within language semantics is not a finding.
74
+
75
+ **Unload, reload, and teardown safety**
76
+ Live function pointers, callbacks, worker threads, or data views survive module unload or runtime reset. Review shutdown and failed-load cleanup as closely as startup.
77
+
78
+ ## Kernel and privileged-interface attack classes
79
+
80
+ **User-copy bounds and repeated reads**
81
+ A syscall, ioctl, driver, or kernel parser derives a trusted fact from user memory then reads the same mutable address again. Copy the full request once or revalidate the later copy. Also audit size, direction, and access checks at each user-copy primitive.
82
+
83
+ **Privileged object lifecycle and dispatch consistency**
84
+ Externally reachable objects have unbalanced retain/release, teardown without observer drain, unchecked selector/table indices, or duplicated compatibility paths that omit a guard. Diff each dispatch and free path side by side.
85
+
86
+ **Under-authorized powerful interfaces**
87
+ A device node, admin socket, helper, or management API validates shape but not the caller's authority over the resource. Establish actual interface ownership and reachability; permissions or sandbox policy outside the repository make this `needs_validation`.
88
+
89
+ ## Universal moves (apply across the above)
90
+
91
+ - Audit fixes and duplicated paths for the same source-to-sink shape. A check in one caller, architecture, protocol role, feature flag, or compatibility path does not protect its siblings.
92
+ - Build a table for every parser or FFI boundary: accepted length/type, checked representation, allocation owner, consumer, thread, and teardown. Most native findings are one disagreement in that table.
93
+ - Use existing corpora and small locally generated boundary fixtures. Save exact sanitizer/runtime output and the input property that triggers it; avoid large resource consumption and any live target.
94
+
95
+ ## Validation rules (apply before reporting ANY finding here)
96
+
97
+ 1. Establish a realistic untrusted entry and exact operation that violates a bounds, type, lifetime, ABI, concurrency, loader, or authority invariant.
98
+ 2. Classify the observable effect: invalid read, invalid write, stale alias, wrong object, uninitialized output, unauthorized image load, deadlock, or safe process termination. Do not claim a stronger effect than observed.
99
+ 3. Run the narrowest local harness, existing test, sanitizer, or fuzzer needed to reproduce the effect. Verify sanitizer coverage of the faulting operation and record architecture/build conditions.
100
+ 4. For concurrency, use a deterministic schedule or sanitizer trace. For binary loading, prove the checked identity differs from the mapped identity and name the lower-trust writer.
101
+ 5. Return `confirmed` findings only with exact input, source trace, and observed result. Return `needs_validation` for a specific unresolved reachability, ABI, build, deployment, or runtime fact and state the bounded check needed.
@@ -0,0 +1,81 @@
1
+ # Protocols, RPC, and Messaging Hunting
2
+
3
+ #### When to use this file
4
+
5
+ Reach for this file when the target uses gRPC, GraphQL transports, Cap'n Proto, Thrift, Protobuf, custom binary protocols, streaming RPC, webhooks, brokers, queues, pub/sub, or event buses. It covers peer identity, logical message interpretation, routing, replay, ordering, and delivery semantics. Use `MEMORY-SAFETY-AND-BINARY.md` for parser memory safety, `WEB-PROTOCOL-AND-AUTH.md` for HTTP framing, and `RESOURCE-EXHAUSTION-AND-AVAILABILITY.md` for availability impact.
6
+
7
+ Split large systems by producer/consumer pair, external/internal peer role, synchronous RPC, streaming, and asynchronous message path.
8
+
9
+ ## Core discipline (include in every agent prompt for this domain)
10
+
11
+ ```
12
+ - "Internal" is not authentication. Name the peer identity at every hop and show how it becomes the application principal used for authorization.
13
+ - Schema validation proves message shape, not provenance, resource authority, ordering, or safe values. Follow decoded fields to policy and side effects.
14
+ - Broker guarantees and application guarantees differ. Write down retry, ordering, acknowledgement, deduplication, and transaction behavior before evaluating state changes.
15
+ - Parser disagreement requires two concrete consumers, schema versions, or wire representations and one security-relevant divergent value.
16
+ - Use `confirmed` for source-complete paths plus bounded local producer/consumer tests. Use `needs_validation` for broker ACL, service-mesh identity, topic attachment, or compatibility behavior outside the repository.
17
+ ```
18
+
19
+ ## Framing, schema, and interpretation attack classes
20
+
21
+ **Message boundary and canonicalization disagreement**
22
+ Components disagree on length, compression, duplicate fields, unknown fields, encoding, numeric width, normalization, or envelope/body precedence. Compare generated and custom parsers, gateways, language bindings, and version converters. Confirm which principal, resource, or operation differs after decoding.
23
+
24
+ **Union, enum, and default confusion**
25
+ Unknown variants, missing discriminators, zero values, default privileges, or compatibility mappings reach code that assumes a validated case. Review exhaustive dispatch, default branches, and how old consumers interpret newly added fields.
26
+
27
+ **Envelope and payload identity mismatch**
28
+ Authorization uses trusted-looking routing or envelope metadata while the handler acts on a conflicting tenant, account, subject, object, or sender in the body. Identify which source is authoritative and ensure clients cannot override it.
29
+
30
+ ## RPC identity and authorization attack classes
31
+
32
+ **Interceptor and method-path inconsistency**
33
+ An authn/authz interceptor applies to unary methods but not streams, reflection, health, gateway-transcoded paths, compatibility services, or individual stream messages. Compare every registration and route to the same operation.
34
+
35
+ **Peer identity to application-principal confusion**
36
+ mTLS, workload identity, bearer metadata, forwarded identity, or broker credentials authenticate a channel, but a caller-controlled field selects the user or tenant. The channel identity and claimed principal must be bound by deterministic policy.
37
+
38
+ **Per-item and streaming authorization gaps**
39
+ A stream, subscription, batch, or bulk message is authorized once, then later items name different resources or continue after role, membership, or token revocation. Re-check where scope can change and bind subscriptions to their original principal.
40
+
41
+ **Callback and reply-correlation confusion**
42
+ Predictable, reused, or cross-tenant correlation IDs let a response, webhook, cancellation, or acknowledgment satisfy another caller's pending operation. Bind each outstanding request to authenticated peer, tenant, operation, and lifecycle.
43
+
44
+ ## Broker and queue isolation attack classes
45
+
46
+ **Topic, routing-key, and subscription scope gaps**
47
+ A publisher or subscriber can select another tenant's topic, wildcard, consumer group, partition, reply queue, or dead-letter route. Check broker-enforced ACLs where visible and application-side namespace construction. Tenant text inside a payload is not isolation.
48
+
49
+ **Dead-letter, retry, and diagnostic disclosure**
50
+ Messages routed to dead-letter queues, error topics, tracing, or operator views contain secrets or cross-tenant payloads accessible to a lower-trust consumer. Review policy and redaction at the failure path, not just normal delivery.
51
+
52
+ **Untrusted producer treated as control plane**
53
+ A message body can declare itself an admin event, provider callback, replication record, or migration instruction without an independently authenticated producer and event type. Verify signatures and source/account/audience binding before privileged handling.
54
+
55
+ ## Replay, ordering, and transaction attack classes
56
+
57
+ **Duplicate delivery and idempotency gaps**
58
+ Retries or redelivery repeat a side effect because deduplication is absent, occurs after mutation, or uses a key that collides across tenants or operations. Confirm the broker's delivery model and the side effect that is not naturally idempotent.
59
+
60
+ **Out-of-order and stale message acceptance**
61
+ Older state, revoked membership, canceled work, or pre-step-up authorization arrives after newer state and overwrites it. Review sequence/version checks, tombstones, partition changes, and restore/replay workflows.
62
+
63
+ **Acknowledgment/commit ordering defects**
64
+ Acknowledgment occurs before durable commit and loses security-relevant work, or commit happens before an unreliable acknowledgment and duplicates a mutation. Evaluate transactional outbox/inbox behavior and failure recovery.
65
+
66
+ **Partial multi-consumer transitions**
67
+ Several consumers jointly implement one authorization or business transition, but retries and partial failure leave only a subset committed. Identify invariants that must become durable atomically or compensate with current authorization.
68
+
69
+ ## Universal moves (apply across the above)
70
+
71
+ - Draw the chain of producer, broker or transport, gateway, consumer, and storage for each message family. At each hop record authenticated peer, authoritative tenant/resource fields, validation, and side effect.
72
+ - Feed the same small fixture to every in-repo schema version or language binding. Test duplicate, missing, unknown, boundary, replayed, and reordered messages without producing load.
73
+ - Compare normal, retry, dead-letter, replay, migration, reflection, stream, and gateway-transcoded routes. Security policy must survive transport changes.
74
+
75
+ ## Validation rules (apply before reporting ANY finding here)
76
+
77
+ 1. Name the realistic producer or peer, accepted message, authenticated channel identity, affected principal/resource, and unauthorized mutation or disclosure.
78
+ 2. For disagreement claims, cite both parsers/consumers and the divergent decoded value. Safe rejection by either side prevents confirmation.
79
+ 3. For replay/order claims, establish actual delivery guarantees and reproduce the invariant failure with a bounded local/in-memory transport.
80
+ 4. For authorization and isolation, verify all interceptor, broker ACL, gateway, and consumer layers visible in source. External attachments make the candidate `needs_validation`.
81
+ 5. Return `confirmed` only with the complete message lifecycle and observed meaningful result. Return `needs_validation` with the exact broker, service identity, route, or delivery fact required.
@@ -0,0 +1,78 @@
1
+ # Resource Exhaustion and Availability Hunting
2
+
3
+ #### When to use this file
4
+
5
+ Reach for this file when untrusted requests, messages, files, tenant state, or agent work can consume CPU, memory, disk, connections, worker slots, paid APIs, or queue capacity, or can deadlock/crash a shared service. This domain distinguishes a source-reviewable availability vulnerability from a general performance issue. Never validate by stressing a shared or live service.
6
+
7
+ Use `MEMORY-SAFETY-AND-BINARY.md` for memory-integrity defects and `PROTOCOLS-RPC-AND-MESSAGING.md` for broker delivery logic. A reachable fatal error belongs here for shared impact even when the underlying parser is covered elsewhere.
8
+
9
+ ## Core discipline (include in every agent prompt for this domain)
10
+
11
+ ```
12
+ - Require an input-to-cost path, a missing effective bound, and impact on another user, shared service, safety function, or operator-owned spend. Self-limiting work in the requester's own process is not a service vulnerability.
13
+ - A missing rate limit is not enough. Check body/message/file caps, concurrency, queues, deadlines, database constraints, upstream gateways, and per-tenant quotas before calling a path unbounded.
14
+ - Do not run stress, saturation, or production tests. Use asymptotic analysis, small boundary fixtures, mocked paid calls, strict local resource limits, and deterministic cancellation tests.
15
+ - State attacker cost, service work, persistence, scope, and recovery. One bounded input with superlinear or persistent shared effect is materially different from sustained volume.
16
+ - Use `confirmed` for source-visible bounds failures demonstrated safely. Use `needs_validation` when upstream caps, deployed topology, autoscaling, paid quota, or recovery behavior is outside the repository.
17
+ ```
18
+
19
+ ## Computational amplification attack classes
20
+
21
+ **Superlinear parsing, matching, or evaluation**
22
+ Small accepted input drives catastrophic regex backtracking, nested parsing, recursive validation, symbolic evaluation, graph traversal, template expansion, or adversarial sort/hash behavior. Derive accepted depth/cardinality and complexity, then demonstrate a bounded growth curve locally.
23
+
24
+ **Decompression and representation amplification**
25
+ Compressed, sparse, nested, aliased, or encoded input expands far beyond the checked transfer or file size. Verify limits after every expansion and across parser stages, including archives, images, fonts, structured documents, and protocol compression tables.
26
+
27
+ **Database and downstream query amplification**
28
+ A small request creates broad scans, pathological joins, fan-out, unbounded sort/aggregation, or many downstream calls because query depth, filter cardinality, pagination, or expansion fields are not bounded. Confirm authorization does not intentionally permit the same resource scope.
29
+
30
+ ## Resource accumulation attack classes
31
+
32
+ **Unbounded buffering and cardinality**
33
+ Bodies, out-of-order streams, uploads, sessions, unique cache keys, metrics labels, log fields, subscriptions, or pending jobs accumulate without per-item and aggregate limits. Find cleanup and expiration on disconnect, timeout, cancellation, and partial parse.
34
+
35
+ **File descriptor, handle, and temporary-resource leaks**
36
+ Malformed or canceled work misses cleanup and retains sockets, files, database cursors, timers, subprocesses, temporary files, or object references. Confirm the leak repeats through bounded local iterations and affects a shared pool.
37
+
38
+ **Detached work after cancellation**
39
+ Client timeout, disconnect, canceled job, or failed authorization returns control but leaves database, model, network, or worker work running. Trace cancellation and deadline propagation through every layer.
40
+
41
+ ## Quota and scheduling attack classes
42
+
43
+ **Pre-authentication work imbalance**
44
+ Expensive parsing, key lookup, cryptography, decompression, or external requests happen before authentication and the earliest size/rate gate. Compare minimal requester effort to shared service cost and check upstream limits.
45
+
46
+ **Quota-accounting scope and reset gaps**
47
+ Accounting uses attacker-influenceable IP, route, tenant, key prefix, task ID, or other dimension, allowing one principal's work to escape its intended budget or consume another principal's allocation. Review integer overflow, distributed races, retries, reconnects, and account switching.
48
+
49
+ **Worker, pool, and priority starvation**
50
+ Low-priority or attacker-controlled jobs hold shared locks, workers, database pools, event-loop turns, or scheduler priority needed by unrelated users. Require a path that bypasses queue/concurrency fairness or retains a slot beyond its deadline.
51
+
52
+ ## Failure and recovery attack classes
53
+
54
+ **Reachable fatal error or deadlock**
55
+ An untrusted input reaches `panic`, abort, fatal assertion, unhandled exception, process exit, lock cycle, or infinite loop in a shared process. Confirm supervisor scope and whether one worker or the whole service becomes unavailable. A restarted isolated worker may reduce impact but does not erase the defect.
56
+
57
+ **Retry storm and fail-open amplification**
58
+ Timeouts, dependency errors, partially processed messages, or health-check failures trigger synchronized or unbounded retries without jitter, ceilings, circuit breaking, or deduplication. Verify one bounded failure source can create persistent aggregate work.
59
+
60
+ **Poison-record and head-of-line blocking**
61
+ One malformed record or message repeatedly fails at the front of a shared queue, partition, startup scan, migration, or recovery loop. Review skip/quarantine policy, offsets, and whether other tenants share the blocked unit.
62
+
63
+ **Unsafe recovery and capacity rollback**
64
+ A restart, restore, fallback, or cleanup path rebuilds unbounded state, ignores current quotas, or restores the input that immediately repeats failure. Recovery correctness is part of availability.
65
+
66
+ ## Universal moves (apply across the above)
67
+
68
+ - Build an input-to-resource table: earliest accepted size/cardinality, work before auth, downstream fan-out, persistence, shared pool, limit and cleanup owner, recovery.
69
+ - Compare aggregate limits with per-object limits. Ten thousand valid one-byte items may evade a per-message cap while exhausting tenant-wide or process-wide state.
70
+ - Validate only in an isolated fixture with strict CPU/memory/time limits and small growth points. Mock external and paid calls and stop once the missing bound or cancellation is observable.
71
+
72
+ ## Validation rules (apply before reporting ANY finding here)
73
+
74
+ 1. Name untrusted input, requester work, service amplification or retained resource, shared blast radius, and recovery. Missing limits without concrete shared impact are hardening.
75
+ 2. Confirm no source-visible upstream, parser, queue, tenant, or framework bound prevents the path. Unknown deployed controls require `needs_validation`.
76
+ 3. For superlinear behavior, establish the accepted complexity and bounded local growth. For leaks, show repeatable retention after cleanup should occur. For fatal paths, identify process/supervisor isolation.
77
+ 4. Prioritize by low requester work, unauthenticated reachability, cross-tenant scope, persistence, and poor recovery; do not validate with availability impact.
78
+ 5. Return `confirmed` only with safe local proof and meaningful shared effect. Return `needs_validation` with the exact upstream limit, topology, quota, or recovery observation an owner must check.
@@ -0,0 +1,73 @@
1
+ # Supply Chain and Release Hunting
2
+
3
+ #### When to use this file
4
+
5
+ Reach for this file when the target resolves dependencies, builds from untrusted contributions, runs CI, creates release artifacts, signs or promotes builds, loads plugins, or updates deployed software. This domain covers trust handoffs from source and dependency to the artifact a user runs. Use `MEMORY-SAFETY-AND-BINARY.md` for flaws inside a local binary loader and `CLOUD-AND-DEPLOYMENT.md` for runtime workload authority.
6
+
7
+ Split large targets into dependency resolution, CI isolation, artifact provenance, release authorization, and updater/plugin trust.
8
+
9
+ ## Core discipline (include in every agent prompt for this domain)
10
+
11
+ ```
12
+ - A mutable or known-vulnerable dependency is not a finding by itself. Show who can influence resolution, which build consumes it, and what execution or release boundary follows.
13
+ - Follow integrity across every handoff: source identity, resolved inputs, build worker, artifact identity, test result, signature/attestation, promotion, and update consumer.
14
+ - CI configuration is authorization code. Establish which event triggered a workflow, whose code runs, which secrets and tokens exist, and what it may publish or mutate.
15
+ - A checksum fetched from the same untrusted location as the artifact does not establish independent integrity. Identify the trusted root and failure behavior.
16
+ - Use `confirmed` for in-repo control-flow failures with bounded local validation. Use `needs_validation` for branch protection, hosted-runner, registry, signing-service, or production promotion facts that are not observable.
17
+ ```
18
+
19
+ ## Dependency and build-input attack classes
20
+
21
+ **Dependency source and namespace confusion**
22
+ Resolver configuration can select an unintended public/private namespace, fallback registry, mirror, repository, or source URL. Review package names, source priority, lockfile and checksum use, alternate build files, platform-specific resolution, and first-install versus update behavior.
23
+
24
+ **Mutable and unbound build inputs**
25
+ Builds consume branches, tags, unverified submodules, downloaded tools, generated assets, remote includes, floating CI actions, or container tags whose content can change without source review. Require a lower-trust writer and a path into trusted build output; reproducibility by itself does not prove authenticity.
26
+
27
+ **Generated-source and codegen provenance gaps**
28
+ Schemas, vendored archives, generated clients, localization, documentation examples, or binary blobs produce executable or shipped content without the same review and integrity gate as source. Compare local regeneration with committed output and verify who controls input and generator.
29
+
30
+ **Build-context inclusion**
31
+ Secrets, local configuration, repository metadata, test fixtures, or developer artifacts enter a package or image because the build context and ignore rules exceed intended release inputs. Confirm that the resulting artifact exposes a real credential, private data, or privileged configuration.
32
+
33
+ ## CI and automation attack classes
34
+
35
+ **Untrusted code in a privileged workflow**
36
+ A pull request, issue comment, fork, dependency update, or external event runs contributor-controlled code with protected secrets, write tokens, deployment authority, or a trusted runner. Compare trigger type, checkout ref, approval gate, environment protection, and permission narrowing. Do not assume repository-host defaults that are not in source.
37
+
38
+ **Workflow command and expression confusion**
39
+ Attacker-controlled branch names, commit messages, issue fields, artifact names, matrix values, or generated output enter shell commands, template expressions, paths, or privileged workflow inputs without canonical validation.
40
+
41
+ **Cache, artifact, and workspace trust mixing**
42
+ A lower-trust job can populate a cache, artifact, shared workspace, or output that a higher-trust job later restores and executes or releases. Review cache keys and namespaces, artifact producer identity, digest binding, retention, and whether promotion re-resolves by mutable name.
43
+
44
+ **Automation identity overreach**
45
+ CI jobs receive permissions beyond the operation, repository, environment, or duration needed, and untrusted job inputs can select the affected resource. Missing least privilege alone is hardening; require a reachable privileged action.
46
+
47
+ ## Release and update attack classes
48
+
49
+ **Build-to-promotion substitution**
50
+ Tests, review, signature, and publication refer to mutable tags, filenames, channels, or artifact IDs rather than the same immutable digest. Check every copy, repack, architecture merge, and provenance step between build and release.
51
+
52
+ **Release authorization and signing-policy gaps**
53
+ A release or signature is accepted from the wrong workflow, repository, branch, environment, key role, or threshold. Review identity claims inside attestations and verify the consumer validates them, not just a valid signature. Rotation, expiry, and revocation must fail closed where policy requires.
54
+
55
+ **Update metadata and rollback confusion**
56
+ An updater authenticates payload bytes but not version, product, platform, channel, target path, expiry, or rollback state, or it accepts metadata and payload from different authorized transactions. Verify atomic installation and recovery behavior. A signature API call without policy binding is incomplete.
57
+
58
+ **Plugin and extension trust expansion**
59
+ An extension package gains host authority beyond its declared scope, a lower-trust publisher can replace another publisher's identity, or install/update hooks run before authenticity and capability checks. Intended installation of arbitrary same-user plugins is not a privilege boundary.
60
+
61
+ ## Universal moves (apply across the above)
62
+
63
+ - Walk backward from a released digest or installed update to every source, generated input, credential, worker, cache, test result, and authorization decision.
64
+ - Compare untrusted and protected workflow events side by side. Mark each persisted channel crossing between them and require an immutable identity plus producer trust.
65
+ - Review revoked key, failed download, missing attestation, partial platform release, rollback, and registry outage paths. The failure policy is part of release integrity.
66
+
67
+ ## Validation rules (apply before reporting ANY finding here)
68
+
69
+ 1. Name the lower-trust actor, controllable source/cache/artifact/metadata, consuming trusted job or updater, and resulting unauthorized publication, code inclusion, secret disclosure, or privileged execution.
70
+ 2. Prove artifact identity across the broken handoff. A different mutable name or unbound digest must reach a real consumer.
71
+ 3. Verify built-in package-manager, repository-host, registry, and signing defaults for the pinned version. Unknown hosted controls require `needs_validation`.
72
+ 4. Keep local validation bounded: use a harmless fixture repository, dummy credential marker, local registry/config, and non-production artifact namespace. Do not publish or alter a real release.
73
+ 5. Return `confirmed` only with a complete source-visible handoff and meaningful result. Return `needs_validation` with the precise branch, runner, registry, signing, or deployment fact an owner must observe.