@igorlau/dotagents 1.0.20 → 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 +66 -66
  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 +52 -15
  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 +5 -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-code-review/references/maintainability.md +1 -0
  22. package/{plugin/skills → skills}/dot-comments/UPSTREAM.json +1 -1
  23. package/{plugin/skills → skills}/dot-commit/SKILL.md +0 -2
  24. package/skills/dot-correct/UPSTREAM.json +8 -0
  25. package/{plugin/skills → skills}/dot-debug/UPSTREAM.json +1 -1
  26. package/{plugin/skills → skills}/dot-grilling/UPSTREAM.json +2 -2
  27. package/{plugin/skills → skills}/dot-handoff/UPSTREAM.json +1 -1
  28. package/{plugin/skills → skills}/dot-implement/SKILL.md +2 -2
  29. package/{plugin/skills → skills}/dot-implement/references/typescript.md +2 -1
  30. package/{plugin/skills → skills}/dot-plan/SKILL.md +3 -1
  31. package/{plugin/skills → skills}/dot-roadmap/SKILL.md +7 -4
  32. package/skills/dot-security-audit/SKILL.md +87 -0
  33. package/skills/dot-security-audit/UPSTREAM.json +8 -0
  34. package/skills/dot-security-audit/references/AI-AND-LLM.md +83 -0
  35. package/skills/dot-security-audit/references/ATTACK-CLASSES.md +130 -0
  36. package/skills/dot-security-audit/references/CLIENT-SIDE.md +83 -0
  37. package/skills/dot-security-audit/references/CLOUD-AND-DEPLOYMENT.md +86 -0
  38. package/skills/dot-security-audit/references/DATA-ISOLATION-AND-LIFECYCLE.md +84 -0
  39. package/skills/dot-security-audit/references/DESKTOP-MOBILE-AND-LOCAL-IPC.md +89 -0
  40. package/skills/dot-security-audit/references/MEMORY-SAFETY-AND-BINARY.md +101 -0
  41. package/skills/dot-security-audit/references/PROTOCOLS-RPC-AND-MESSAGING.md +81 -0
  42. package/skills/dot-security-audit/references/RESOURCE-EXHAUSTION-AND-AVAILABILITY.md +78 -0
  43. package/skills/dot-security-audit/references/SUPPLY-CHAIN-AND-RELEASE.md +73 -0
  44. package/skills/dot-security-audit/references/WEB-PROTOCOL-AND-AUTH.md +105 -0
  45. package/skills/dot-security-changes/SKILL.md +68 -0
  46. package/{plugin/skills → skills}/dot-testing/UPSTREAM.json +1 -1
  47. package/skills/dot-ui-review/SKILL.md +79 -0
  48. package/skills/dot-ui-review/UPSTREAM.json +8 -0
  49. package/skills/dot-ux-review/SKILL.md +50 -0
  50. package/skills/dot-ux-review/UPSTREAM.json +8 -0
  51. package/skills/dot-ux-review/references/web-interface-guidelines.md +191 -0
  52. package/{plugin/skills/dot-stack-review → skills/dot-walkthrough-branch}/SKILL.md +9 -30
  53. package/skills/dot-walkthrough-branch/references/layers.md +38 -0
  54. package/{plugin/skills/dot-stack-review → skills/dot-walkthrough-branch}/scripts/page.mjs +39 -10
  55. package/skills/dot-walkthrough-changes/SKILL.md +62 -0
  56. package/skills/dot-writing-for-agents/UPSTREAM.json +8 -0
  57. package/plugin/.claude-plugin/plugin.json +0 -10
  58. package/plugin/agents/dot-implementer.md +0 -27
  59. package/plugin/agents/dot-reviewer.md +0 -44
  60. package/plugin/agents/dot-tester.md +0 -25
  61. package/plugin/hooks/check.mjs +0 -118
  62. package/plugin/hooks/hooks.json +0 -54
  63. package/plugin/hooks/rules.mjs +0 -27
  64. package/plugin/skills/dot-correct/UPSTREAM.json +0 -8
  65. package/plugin/skills/dot-correct/agents/openai.yaml +0 -5
  66. package/plugin/skills/dot-debug/agents/openai.yaml +0 -3
  67. package/plugin/skills/dot-flow/SKILL.md +0 -105
  68. package/plugin/skills/dot-flow/agents/openai.yaml +0 -5
  69. package/plugin/skills/dot-flow/references/fix-round.md +0 -64
  70. package/plugin/skills/dot-flow/references/inline.md +0 -9
  71. package/plugin/skills/dot-grilling/agents/openai.yaml +0 -3
  72. package/plugin/skills/dot-handoff/agents/openai.yaml +0 -5
  73. package/plugin/skills/dot-roadmap/agents/openai.yaml +0 -5
  74. package/plugin/skills/dot-stack-review/agents/openai.yaml +0 -5
  75. package/plugin/skills/dot-writing-for-agents/UPSTREAM.json +0 -8
  76. package/plugin/skills/dot-writing-for-agents/agents/openai.yaml +0 -3
  77. /package/{plugin/rules → rules}/code-style.md +0 -0
  78. /package/{plugin/rules → rules}/comments.md +0 -0
  79. /package/{plugin/rules → rules}/core.md +0 -0
  80. /package/{plugin/scaffold → scaffold}/.claude/settings.json.tmpl +0 -0
  81. /package/{plugin/scaffold → scaffold}/.editorconfig.tmpl +0 -0
  82. /package/{plugin/scaffold → scaffold}/.gitattributes.tmpl +0 -0
  83. /package/{plugin/scaffold → scaffold}/CLAUDE.md.tmpl +0 -0
  84. /package/{plugin/skills → skills}/dot-comments/SKILL.md +0 -0
  85. /package/{plugin/skills → skills}/dot-correct/SKILL.md +0 -0
  86. /package/{plugin/skills → skills}/dot-debug/SKILL.md +0 -0
  87. /package/{plugin/skills → skills}/dot-debug/references/loops.md +0 -0
  88. /package/{plugin/skills → skills}/dot-debug/scripts/hitl-loop.template.sh +0 -0
  89. /package/{plugin/skills → skills}/dot-docs-writing/SKILL.md +0 -0
  90. /package/{plugin/skills → skills}/dot-docs-writing/references/formatting.md +0 -0
  91. /package/{plugin/skills → skills}/dot-docs-writing/references/global-and-accessible.md +0 -0
  92. /package/{plugin/skills → skills}/dot-docs-writing/references/word-list.md +0 -0
  93. /package/{plugin/skills → skills}/dot-grilling/SKILL.md +0 -0
  94. /package/{plugin/skills → skills}/dot-handoff/SKILL.md +0 -0
  95. /package/{plugin/skills → skills}/dot-implement/UPSTREAM.json +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,83 @@
1
+ # Client-Side and Browser Hunting
2
+
3
+ #### When to use this file
4
+
5
+ Reach for this file when meaningful trust decisions or untrusted rendering happen in a browser: single-page apps, browser extensions, embedded webviews, service workers, offline applications, and code that renders attacker-influenceable content into the DOM, receives cross-window messages, or uses browser storage. These paths include sources the server never sees, such as URL fragments, `window.name`, `postMessage`, and previously cached content.
6
+
7
+ Use alongside `ATTACK-CLASSES.md`. This file covers browser sources and sinks, origin boundaries, browser persistence, and cross-site state oracles. Use `DESKTOP-MOBILE-AND-LOCAL-IPC.md` for the native side of a webview bridge, and `WEB-PROTOCOL-AND-AUTH.md` for server-side CSRF, sessions, and auth callbacks.
8
+
9
+ ## Core discipline (include in every agent prompt for this domain)
10
+
11
+ ```
12
+ - A client-side candidate needs a controllable source and an executing or disclosing sink. Name both and show attacker-influenced data reaching the sink.
13
+ - The impact must reach a victim's session, another origin, or shared persistence. Self-injection and disclosure of the attacker's own data are not findings.
14
+ - Framework escaping, browser same-origin policy, CSP, COOP/CORP, service-worker scope, and modern noopener defaults are real controls. Verify them before assigning impact.
15
+ - Browser storage and caches are shared by origin and may outlive login state. Identify who writes, who reads, and which account, tenant, or worker lifecycle clears each record.
16
+ - Use `confirmed` only for complete source evidence plus bounded local browser tests. Use `needs_validation` when renderer, extension permission, deployed header, or browser-policy behavior is required but unavailable.
17
+ ```
18
+
19
+ ## DOM and object-state attack classes
20
+
21
+ **DOM-based XSS**
22
+ Trace `location` fields, `document.referrer`, `window.name`, message data, storage, and browser-controlled document state into `innerHTML`, `outerHTML`, `document.write`, string-evaluating APIs, executable URLs, jQuery HTML APIs, or framework escape hatches. Interpolation escaped by the framework is not a finding.
23
+
24
+ **DOM clobbering**
25
+ Attacker-injected `id` or `name` attributes shadow a global, form property, configuration object, or initialization flag later trusted by code. Require both a markup path that preserves the attribute and a security-relevant use of the clobbered value.
26
+
27
+ **Prototype pollution and gadget chain**
28
+ An attacker-controlled key reaches a recursive write such as deep merge or path assignment and modifies prototype state. Then a reachable gadget consumes the polluted property to change authorization, execution, navigation, or rendering. `JSON.parse`, a shallow copy, or pollution without a gadget is not enough.
29
+
30
+ ## Cross-origin messaging and network attack classes
31
+
32
+ **`postMessage` origin and source trust**
33
+ A handler performs a sensitive action with `event.data` without an exact origin allowlist and, where multiple frames share an origin, the expected `event.source`. On the send side, sensitive data sent to `*` reaches an unintended embedder. Weak substring, prefix, suffix, or unanchored-regex origin matching is not an origin check.
34
+
35
+ **Cross-site WebSocket request use**
36
+ A WebSocket upgrade accepts ambient cookies from an untrusted origin without an `Origin` check or channel-specific token, allowing the victim's session to read or mutate data. Confirm both the upgrade behavior and a security-relevant message handler.
37
+
38
+ **Credentialed CORS trust**
39
+ The server reflects or weakly matches `Origin` while allowing credentials and returns sensitive responses. A bare wildcard with credentials is rejected by browsers; report only the actual reflected/allowed origin path and cross-origin data or mutation.
40
+
41
+ ## Service-worker and browser-storage attack classes
42
+
43
+ **Service-worker registration and scope takeover**
44
+ Attacker-influenceable content can become the registered worker script, control a path that receives an over-broad `Service-Worker-Allowed` scope, or alter update imports without integrity control. Verify the final script URL, response MIME type, origin, scope, and who controls every imported script. A normal same-origin worker with intended scope is not a defect.
45
+
46
+ **Service-worker cache and identity confusion**
47
+ The worker caches personalized responses without including account, tenant, authorization state, or request mode in its policy, then serves them after account switch or logout. Review fetch-event routing, cache names and keys, navigation fallbacks, cache cleanup, and whether error/offline paths return another user's prior response.
48
+
49
+ **Browser-storage disclosure and stale authorization**
50
+ Tokens, private responses, draft data, or authorization decisions remain in `localStorage`, `sessionStorage`, IndexedDB, Cache Storage, extension storage, or client state and become readable by another account or less-trusted same-origin component. Storage of a token alone is not a finding; require a realistic reader with less authority, or continued use after revocation/logout.
51
+
52
+ **Cross-context storage and broadcast confusion**
53
+ `storage` events, `BroadcastChannel`, shared workers, or origin-wide caches carry identity or commands between tabs without binding them to the current session. Check account switching, private/public windows, tenant changes, and stale tabs that can overwrite newer auth state.
54
+
55
+ ## Cross-site information leak classes
56
+
57
+ **XS-Leaks and cross-origin state oracles**
58
+ An attacker page can distinguish protected cross-origin state through resource load/error events, frame or window state, redirect behavior, timing, cache state, or response size while the browser attaches victim credentials. Require one concrete secret-bearing predicate such as whether a private object, role, or account exists. Generic timing variance or public-resource availability is not a finding.
59
+
60
+ **Window and opener state disclosure**
61
+ A cross-origin window's permitted metadata or navigation result reveals protected state, or a retained opener/named-window relationship lets an attacker-controlled page influence a privileged navigation. Check COOP, frame protections, `noopener`, exact origin, and whether the observable state is confidential.
62
+
63
+ ## UI-redress and navigation attack classes
64
+
65
+ **Clickjacking**
66
+ A framed, state-changing action lacks effective `frame-ancestors`, `X-Frame-Options`, or equivalent UI isolation. Require the sensitive action and confirm it can complete in the framed state; missing headers on read-only content are hardening notes.
67
+
68
+ **Client-side navigation confusion**
69
+ A client source controls redirect or navigation without scheme and destination policy, including executable `javascript:` or `data:` destinations. Reverse tabnabbing applies only where code explicitly keeps `window.opener`, uses `window.open` without isolation, or supports a browser without implicit `noopener`.
70
+
71
+ ## Universal moves (apply across the above)
72
+
73
+ - Start from DOM, navigation, worker, message, and storage sinks, then trace backward to browser-only and server-controlled sources. Record the browser policy that should stop the path.
74
+ - Test account switch, logout, worker update, offline fallback, and stale-tab state with a local test origin and dummy accounts. Do not use production users, origins, or shared services.
75
+ - For XS-Leaks, list only predicates proved by source and local browser behavior. Then identify the response headers or rendering choice that would remove the oracle.
76
+
77
+ ## Validation rules (apply before reporting ANY finding here)
78
+
79
+ 1. Cite the source, sink, browser policy, affected origin/session, and observable mutation or disclosure.
80
+ 2. For prototype pollution, prove the recursive write and a security-relevant gadget. For DOM clobbering, prove the markup survives and the shadowed value is used.
81
+ 3. For service workers and storage, prove lifecycle reachability: an attacker-controlled write or cache entry must reach a different account, tenant, or later authorization state.
82
+ 4. For messaging, CORS, WebSocket, and XS-Leaks, show exact origin/source validation and the protected state or action exposed. Confirm that CSP, COOP/CORP, cookies, and SameSite policy do not already block it.
83
+ 5. Return `confirmed` findings only with a complete client path and bounded local evidence. Return `needs_validation` with the precise deployed header, extension permission, browser version, or renderer behavior an owner must verify.
@@ -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.