@ericrisco/rsc 4.0.4 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/manifest.json +78 -84
- package/package.json +1 -1
- package/scripts/lib/default-skill-floor.js +5 -1
- package/scripts/lib/domains.js +1 -1
- package/scripts/lib/recommend.js +1 -1
- package/scripts/lib/retired-skills.js +4 -0
- package/scripts/skill-migration-brief.md +1 -1
- package/skills/accessibility/evals/README.md +1 -1
- package/skills/accessibility/evals/cases.yaml +1 -1
- package/skills/agent-safety/SKILL.md +2 -2
- package/skills/agent-safety/evals/README.md +1 -1
- package/skills/agent-safety/evals/cases.yaml +1 -1
- package/skills/analyze/evals/README.md +1 -1
- package/skills/analyze/evals/cases.yaml +2 -2
- package/skills/angular/SKILL.md +1 -1
- package/skills/api-connector-builder/SKILL.md +1 -1
- package/skills/api-design/SKILL.md +3 -3
- package/skills/api-design/evals/cases.yaml +1 -1
- package/skills/asdd/SKILL.md +3 -1
- package/skills/automation-strategy/SKILL.md +1 -1
- package/skills/automation-strategy/evals/README.md +1 -1
- package/skills/automation-strategy/evals/cases.yaml +2 -2
- package/skills/automation-strategy/references/orchestration-and-antipatterns.md +1 -1
- package/skills/aws-essentials/SKILL.md +3 -3
- package/skills/aws-essentials/evals/cases.yaml +2 -2
- package/skills/backups/SKILL.md +2 -2
- package/skills/backups/evals/cases.yaml +2 -2
- package/skills/bash-scripting/SKILL.md +1 -1
- package/skills/building-agents/SKILL.md +2 -2
- package/skills/building-agents/evals/cases.yaml +2 -2
- package/skills/chrome-extension/SKILL.md +1 -1
- package/skills/cloudflare/SKILL.md +1 -1
- package/skills/code-review/SKILL.md +2 -2
- package/skills/code-review/evals/cases.yaml +2 -2
- package/skills/compliance/SKILL.md +3 -3
- package/skills/compliance/evals/cases.yaml +1 -1
- package/skills/constitution/SKILL.md +2 -2
- package/skills/constitution/evals/README.md +2 -2
- package/skills/constitution/evals/cases.yaml +2 -2
- package/skills/constitution/references/constitution-template.md +1 -1
- package/skills/cpp/SKILL.md +2 -2
- package/skills/cpp/evals/README.md +1 -1
- package/skills/cpp/evals/cases.yaml +2 -2
- package/skills/csharp-dotnet/SKILL.md +3 -3
- package/skills/csharp-dotnet/evals/cases.yaml +1 -1
- package/skills/csharp-dotnet/references/aspnetcore.md +1 -1
- package/skills/data-policy/SKILL.md +2 -2
- package/skills/data-policy/evals/README.md +1 -1
- package/skills/data-policy/evals/cases.yaml +1 -1
- package/skills/debug/SKILL.md +1 -1
- package/skills/debug/evals/README.md +1 -1
- package/skills/decision-challenge/SKILL.md +2 -2
- package/skills/decision-challenge/evals/cases.yaml +1 -1
- package/skills/deployment/SKILL.md +2 -2
- package/skills/deployment/evals/README.md +1 -1
- package/skills/deployment/evals/cases.yaml +2 -2
- package/skills/django/SKILL.md +2 -2
- package/skills/django/evals/README.md +1 -1
- package/skills/django/evals/cases.yaml +1 -1
- package/skills/django/references/security.md +1 -1
- package/skills/docker/SKILL.md +3 -3
- package/skills/docker/evals/cases.yaml +1 -1
- package/skills/dynamodb/SKILL.md +2 -2
- package/skills/electron/SKILL.md +1 -1
- package/skills/electron/references/packaging-and-updates.md +1 -1
- package/skills/email-connector/SKILL.md +2 -2
- package/skills/email-deliverability/SKILL.md +1 -1
- package/skills/error-handling/SKILL.md +1 -1
- package/skills/expo/SKILL.md +2 -2
- package/skills/fastapi/SKILL.md +4 -4
- package/skills/fastapi/evals/README.md +2 -2
- package/skills/fastapi/evals/cases.yaml +2 -2
- package/skills/fastapi/references/security.md +2 -2
- package/skills/firebase/SKILL.md +1 -1
- package/skills/flutter/SKILL.md +1 -1
- package/skills/flutter/evals/cases.yaml +2 -2
- package/skills/fly-io/SKILL.md +1 -1
- package/skills/gamedev-multiplayer/SKILL.md +1 -1
- package/skills/gamedev-multiplayer/evals/README.md +1 -1
- package/skills/gamedev-multiplayer/evals/cases.yaml +2 -2
- package/skills/gamedev-shipping/SKILL.md +1 -1
- package/skills/gcp-essentials/SKILL.md +2 -2
- package/skills/gcp-essentials/evals/README.md +1 -1
- package/skills/gcp-essentials/evals/cases.yaml +2 -2
- package/skills/gdpr-privacy/SKILL.md +2 -2
- package/skills/gdpr-privacy/evals/cases.yaml +1 -1
- package/skills/github-actions/SKILL.md +2 -2
- package/skills/go/SKILL.md +4 -4
- package/skills/go/evals/README.md +1 -1
- package/skills/go/evals/cases.yaml +2 -2
- package/skills/google-workspace/SKILL.md +2 -2
- package/skills/hetzner/SKILL.md +1 -1
- package/skills/htmx/SKILL.md +4 -4
- package/skills/htmx/evals/cases.yaml +2 -2
- package/skills/implement/SKILL.md +2 -2
- package/skills/init/SKILL.md +2 -2
- package/skills/init/evals/cases.yaml +2 -2
- package/skills/init/references/discovery.md +1 -1
- package/skills/init/references/recommend-skills.md +5 -5
- package/skills/java/SKILL.md +3 -3
- package/skills/java/evals/README.md +1 -1
- package/skills/java/evals/cases.yaml +2 -2
- package/skills/laravel/SKILL.md +3 -3
- package/skills/laravel/evals/README.md +1 -1
- package/skills/laravel/evals/cases.yaml +1 -1
- package/skills/marketing/evals/README.md +1 -1
- package/skills/marketing/evals/cases.yaml +1 -1
- package/skills/mongodb/SKILL.md +2 -2
- package/skills/mongodb/evals/README.md +1 -1
- package/skills/mongodb/evals/cases.yaml +2 -2
- package/skills/nextjs/SKILL.md +3 -3
- package/skills/nextjs/evals/cases.yaml +2 -2
- package/skills/nextjs/references/security.md +2 -2
- package/skills/notion-connector/SKILL.md +3 -3
- package/skills/notion-connector/evals/README.md +1 -1
- package/skills/notion-connector/evals/cases.yaml +2 -2
- package/skills/php/SKILL.md +4 -4
- package/skills/php/evals/README.md +1 -1
- package/skills/php/evals/cases.yaml +1 -1
- package/skills/plan/evals/README.md +1 -1
- package/skills/postgresdb/SKILL.md +1 -1
- package/skills/postgresdb/evals/README.md +1 -1
- package/skills/postgresdb/evals/cases.yaml +2 -2
- package/skills/presentations/evals/README.md +1 -1
- package/skills/python/SKILL.md +3 -3
- package/skills/python/evals/README.md +1 -1
- package/skills/python/evals/cases.yaml +2 -2
- package/skills/rag/scripts/verify.sh +1 -1
- package/skills/review/SKILL.md +2 -2
- package/skills/review/evals/cases.yaml +3 -3
- package/skills/ruby/SKILL.md +1 -1
- package/skills/rust/SKILL.md +2 -2
- package/skills/rust/evals/README.md +1 -1
- package/skills/rust/evals/cases.yaml +2 -2
- package/skills/security-audit/SKILL.md +186 -0
- package/skills/security-audit/evals/cases.yaml +95 -0
- package/skills/security-audit/references/auditor-safety.md +69 -0
- package/skills/security-audit/references/classes/README.md +225 -0
- package/skills/security-audit/references/classes/ai-and-llm.md +247 -0
- package/skills/security-audit/references/classes/client-side.md +181 -0
- package/skills/security-audit/references/classes/cloud-and-deployment.md +167 -0
- package/skills/security-audit/references/classes/data-isolation.md +161 -0
- package/skills/security-audit/references/classes/desktop-mobile-ipc.md +167 -0
- package/skills/security-audit/references/classes/memory-and-binary.md +230 -0
- package/skills/security-audit/references/classes/protocols-and-messaging.md +151 -0
- package/skills/security-audit/references/classes/resource-exhaustion.md +141 -0
- package/skills/security-audit/references/classes/supply-chain.md +147 -0
- package/skills/security-audit/references/classes/web-and-auth.md +238 -0
- package/skills/security-audit/references/coverage-ledger.md +172 -0
- package/skills/security-audit/references/fixes-by-stack.md +972 -0
- package/skills/security-audit/references/fixing.md +200 -0
- package/skills/security-audit/references/hunting.md +146 -0
- package/skills/security-audit/references/isolated-execution.md +85 -0
- package/skills/security-audit/references/platforms.md +650 -0
- package/skills/security-audit/references/reconnaissance.md +73 -0
- package/skills/security-audit/references/resuming.md +55 -0
- package/skills/security-audit/references/scanners.md +347 -0
- package/skills/{secure-coding → security-audit}/references/secrets-and-supply-chain.md +78 -34
- package/skills/security-audit/references/secrets-discipline.md +173 -0
- package/skills/{secure-coding → security-audit}/references/threat-modeling.md +80 -32
- package/skills/security-audit/references/verification.md +118 -0
- package/skills/security-audit/schema/findings.schema.json +178 -0
- package/skills/security-audit/scripts/render-report.mjs +311 -0
- package/skills/security-audit/scripts/validate-findings.mjs +508 -0
- package/skills/skill-scout/scripts/verify.sh +1 -1
- package/skills/source-grounded-development/evals/cases.yaml +1 -1
- package/skills/specify/evals/README.md +1 -1
- package/skills/spring-boot/SKILL.md +3 -3
- package/skills/spring-boot/evals/README.md +1 -1
- package/skills/spring-boot/evals/cases.yaml +1 -1
- package/skills/spring-boot/references/security.md +1 -1
- package/skills/stripe/SKILL.md +2 -2
- package/skills/suggest/evals/cases.yaml +2 -2
- package/skills/supabase/SKILL.md +1 -1
- package/skills/tauri/SKILL.md +2 -2
- package/skills/testing-go/SKILL.md +1 -1
- package/skills/typescript/SKILL.md +2 -2
- package/skills/verify/SKILL.md +3 -3
- package/skills/verify/evals/README.md +2 -2
- package/skills/verify/evals/cases.yaml +2 -2
- package/skills/vue-nuxt/SKILL.md +2 -2
- package/skills/webhooks/SKILL.md +2 -2
- package/skills/wordpress/SKILL.md +2 -2
- package/skills/wordpress/evals/README.md +1 -1
- package/skills/wordpress/evals/cases.yaml +1 -1
- package/skills/worktrees/evals/README.md +1 -1
- package/targets/claude.js +23 -1
- package/targets/clone-bootstrap.mjs +1 -1
- package/targets/commands.js +1 -1
- package/skills/secure-coding/SKILL.md +0 -336
- package/skills/secure-coding/evals/README.md +0 -68
- package/skills/secure-coding/evals/cases.yaml +0 -55
- package/skills/secure-coding/references/authn-authz.md +0 -249
- package/skills/secure-coding/references/owasp-by-stack.md +0 -574
- package/skills/secure-coding/scripts/verify.sh +0 -208
- package/skills/security-scan/SKILL.md +0 -219
- package/skills/security-scan/evals/README.md +0 -14
- package/skills/security-scan/evals/cases.yaml +0 -50
- package/skills/security-scan/references/tools.md +0 -97
- package/skills/security-scan/references/triage.md +0 -92
- package/skills/security-scan/scripts/verify.sh +0 -108
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
# Memory safety, native code and binary loading
|
|
2
|
+
|
|
3
|
+
Load when untrusted bytes are handled by memory-unsafe or privileged code: C, C++, Objective-C, Rust `unsafe`, FFI bindings, drivers and kernel modules, decoders, network daemons, firmware, loaders, runtimes and JITs. Protocol authorization and message state machines live in [protocols-and-messaging.md](protocols-and-messaging.md); this file is about process integrity.
|
|
4
|
+
|
|
5
|
+
Split a large target into slices before reading: parsers, allocation and lifetime, FFI, concurrency, loading, runtime/JIT, privileged interfaces.
|
|
6
|
+
|
|
7
|
+
## Ground rules for this domain
|
|
8
|
+
|
|
9
|
+
- Work out every bound and every lifetime again yourself, starting from attacker input and covering all callers. Test against the largest input the code accepts, not the friendly test vector.
|
|
10
|
+
- A crash, a panic or a sanitizer report is a defect only if realistic untrusted input can drive execution there. A label such as "heap overflow" does not by itself prove corruption, code execution or a shared outage.
|
|
11
|
+
- Prove in a local harness only ([../isolated-execution.md](../isolated-execution.md)): sanitizers, deterministic thread schedules, the project's existing fuzz targets, a debugger to classify the fault. Stop once the broken invariant and its visible effect are shown. Never build exploitation past the corruption point.
|
|
12
|
+
- Sanitizers have blind spots: hand-written assembly, JIT output, custom allocators, accesses inside one object, prebuilt foreign libraries. Check that the faulting instruction was actually instrumented.
|
|
13
|
+
- Verdicts follow [../verification.md](../verification.md). Without known ABI, allocator, architecture, build flag, deployment or reachability facts, the finding stays at needs-validation.
|
|
14
|
+
|
|
15
|
+
## Bounds and representation
|
|
16
|
+
|
|
17
|
+
### `out-of-bounds-access`
|
|
18
|
+
|
|
19
|
+
**What.** A length, offset, index or terminator is used against a fixed or heap buffer without a correct limit, so the code reads or writes outside it.
|
|
20
|
+
|
|
21
|
+
**Where to look.** `memcpy`, `memmove`, `strcpy`, `sprintf`, manual loops over `buf[i]`, `ptr + off`, slice indexing in `unsafe` blocks, `get_unchecked`. Recompute free space after headers, alignment, padding and the NUL terminator. Check the capacity of both the source and the destination. Check whether the code reads bytes that a truncated input never supplied, because it believed the declared length.
|
|
22
|
+
|
|
23
|
+
**How to prove.** Untrusted input → the arithmetic that sets the bound → the access. A small fixture under ASan/KASAN showing the invalid read or write at that line.
|
|
24
|
+
|
|
25
|
+
**Only a note.** An out-of-range access on data the caller fully controls inside its own process, with no trust boundary crossed.
|
|
26
|
+
|
|
27
|
+
### `integer-arithmetic-flaw`
|
|
28
|
+
|
|
29
|
+
**What.** Overflow, underflow, truncation or a sign error in attacker-influenced arithmetic that feeds an allocation, copy, loop, index or pointer.
|
|
30
|
+
|
|
31
|
+
**Where to look.**
|
|
32
|
+
|
|
33
|
+
| Pattern | Typical result |
|
|
34
|
+
|---|---|
|
|
35
|
+
| `a - b` where `b` can exceed `a` | huge unsigned length |
|
|
36
|
+
| `count * elem_size` | small allocation, large copy |
|
|
37
|
+
| additions close to the type maximum | wrap to a small value |
|
|
38
|
+
| negative signed value cast to unsigned | huge size |
|
|
39
|
+
| 64-bit length stored in a 32-bit field | truncated check, full copy |
|
|
40
|
+
| sentinel `-1` used as a size | maximum size |
|
|
41
|
+
|
|
42
|
+
Confirm which form of the value (checked or unchecked, wide or narrow) the later operation actually uses.
|
|
43
|
+
|
|
44
|
+
**How to prove.** The boundary value, the wrapped result, and the sink that consumes it, reproduced in a sanitizer build (UBSan for the arithmetic, ASan for the memory effect).
|
|
45
|
+
|
|
46
|
+
**Only a note.** A theoretical wrap that an earlier cap makes unreachable; cite the cap.
|
|
47
|
+
|
|
48
|
+
### `unit-confusion`
|
|
49
|
+
|
|
50
|
+
**What.** Code mixes units: bytes vs elements, code units vs characters, pages, words, wire units, or the element size at the wrong pointer depth.
|
|
51
|
+
|
|
52
|
+
**Where to look.** Follow one length from parse to validation to allocation to the API boundary to the copy, and write the unit at each step. UTF-16 vs UTF-8 lengths, `sizeof(ptr)` vs `sizeof(*ptr)`, `wchar_t` buffers, page counts multiplied in the wrong place. If the check and the allocation share one wrong unit, the check passes and is still wrong.
|
|
53
|
+
|
|
54
|
+
**How to prove.** Show the two units side by side in source, then a fixture whose length differs between them, with the resulting out-of-bounds effect.
|
|
55
|
+
|
|
56
|
+
**Only a note.** A unit mismatch where both values are always equal for every accepted input (for example, a byte-only alphabet).
|
|
57
|
+
|
|
58
|
+
### `uninitialized-data-exposure`
|
|
59
|
+
|
|
60
|
+
**What.** Memory that was never fully written (a buffer, struct padding, a field, spare vector capacity) leaves the code: sent across a trust boundary, serialized, hashed, compared or returned.
|
|
61
|
+
|
|
62
|
+
**Where to look.** Structs copied whole to the wire or to user space, `malloc` without full write, `set_len` / `MaybeUninit` misuse in Rust, responses sized by capacity instead of length.
|
|
63
|
+
|
|
64
|
+
**How to prove.** A consumer that observes the bytes on the far side of the boundary, with a realistic output length. MSan or a canary pattern shows stale content leaving.
|
|
65
|
+
|
|
66
|
+
**Only a note.** A stack allocation that is never read before being written, or uninitialized memory that never reaches an observer.
|
|
67
|
+
|
|
68
|
+
## Lifetime, type and concurrency
|
|
69
|
+
|
|
70
|
+
### `use-after-free`
|
|
71
|
+
|
|
72
|
+
**What.** An owner is freed while something can still reach it: a callback, a wait queue, a timer, an iterator, a borrowed slice, a cached raw pointer. Also covers stale views after `realloc` and double frees.
|
|
73
|
+
|
|
74
|
+
**Where to look.** Every error, cancel, close and `realloc` path, not only the happy path. Objects that embed notification anchors or observer lists: every path that frees must first remove or drain each observer.
|
|
75
|
+
|
|
76
|
+
**How to prove.** The input sequence that frees then reuses, and the ASan or KASAN use-after-free report pointing at the stale access.
|
|
77
|
+
|
|
78
|
+
**Only a note.** A dangling pointer that is provably never dereferenced again.
|
|
79
|
+
|
|
80
|
+
### `type-confusion`
|
|
81
|
+
|
|
82
|
+
**What.** The code learns an object's kind from one thing (its tag, discriminator, vtable, kind field or foreign handle) and then reads it as some other representation.
|
|
83
|
+
|
|
84
|
+
**Where to look.** Unchecked downcasts (`static_cast` on a base pointer, `reinterpret_cast`, C union access), tags left stale when an object slot is reused, serialized containers where the validated element type differs from the one consumed.
|
|
85
|
+
|
|
86
|
+
**How to prove.** A local fixture that makes the code read or write the object as the wrong type. Do not extend the test beyond showing the invariant break.
|
|
87
|
+
|
|
88
|
+
**Only a note.** A cast guarded by a check on every reachable path.
|
|
89
|
+
|
|
90
|
+
### `refcount-ownership-race`
|
|
91
|
+
|
|
92
|
+
**What.** Retain/release that is not atomic, a check and then a use after the lock is dropped, or different ownership rules on different threads, so an object is freed or mutated while in use.
|
|
93
|
+
|
|
94
|
+
**Where to look.** Compare the fast path, error path, shutdown path and compatibility path for the same object: same lock, same ownership rule? Look for `refcount++` without atomics and `get` then `put` split across a lock release.
|
|
95
|
+
|
|
96
|
+
**How to prove.** A deterministic schedule (barriers, injected sleeps in a test build) or a ThreadSanitizer trace that shows the bad interleaving and its effect.
|
|
97
|
+
|
|
98
|
+
**Only a note.** A race with no security-relevant state change.
|
|
99
|
+
|
|
100
|
+
### `shared-state-toctou`
|
|
101
|
+
|
|
102
|
+
**What.** Concurrent streams, global caches, lazy initializers, signal handlers or teardown change a bound, policy or pointer after it was checked.
|
|
103
|
+
|
|
104
|
+
**Where to look.** Globals touched by several parser instances, `once` initializers with fallible setup, signal handlers calling non-reentrant code, teardown racing with in-flight work.
|
|
105
|
+
|
|
106
|
+
**How to prove.** A repeatable local schedule, a barrier test or TSan output. A merely possible interleaving with no proven security-relevant transition stays at needs-validation.
|
|
107
|
+
|
|
108
|
+
### `lock-order-deadlock`
|
|
109
|
+
|
|
110
|
+
**What.** Reachable operations take locks in inconsistent order, or hold a lock across a callback or blocking I/O, and progress stops.
|
|
111
|
+
|
|
112
|
+
**Where to look.** Lock acquisition graphs, callbacks invoked under a lock, I/O under a mutex.
|
|
113
|
+
|
|
114
|
+
**How to prove.** A bounded input that halts shared progress. Report it as availability (see [resource-exhaustion.md](resource-exhaustion.md)).
|
|
115
|
+
|
|
116
|
+
**Only a note.** A deadlock only the operator or the caller's own process can trigger; file it as a concurrency bug to fix, not as a vulnerability.
|
|
117
|
+
|
|
118
|
+
## FFI and ABI boundaries
|
|
119
|
+
|
|
120
|
+
### `ffi-ownership-mismatch`
|
|
121
|
+
|
|
122
|
+
**What.** The two sides of a foreign call disagree on buffer ownership (which side allocates it, mutates it, pins it, releases it), on how long a pointer into it stays valid, or whether a length counts bytes or elements.
|
|
123
|
+
|
|
124
|
+
**Where to look.** Every `extern` block, CGo, JNI, Python C extensions, N-API, generated wrappers. Check null pointers, zero lengths, aliasing between arguments, callbacks that keep a pointer after the call returns.
|
|
125
|
+
|
|
126
|
+
**How to prove.** Cite both declarations, then a local test that triggers the double free, leak-then-reuse or wrong-length copy under a sanitizer.
|
|
127
|
+
|
|
128
|
+
### `abi-layout-mismatch`
|
|
129
|
+
|
|
130
|
+
**What.** The two sides see different layouts or conventions depending on target architecture or compile flags: struct fields, bitfields, packed records, enums, integer widths, callback signatures, calling conventions.
|
|
131
|
+
|
|
132
|
+
**Where to look.** `repr(C)` / `repr(packed)`, `#pragma pack`, alignment attributes, endianness, `long` and `size_t` widths, enum sizes, `stdcall` vs `cdecl`.
|
|
133
|
+
|
|
134
|
+
**How to prove.** When both declarations are in the repo, a size/offset assertion or a test that misreads a field confirms it. When the foreign implementation is opaque, needs-validation.
|
|
135
|
+
|
|
136
|
+
### `unwind-and-thread-affinity`
|
|
137
|
+
|
|
138
|
+
**What.** A panic or exception crosses an ABI that forbids unwinding, a callback runs after teardown, or a single-thread API is called from another thread.
|
|
139
|
+
|
|
140
|
+
**Where to look.** `extern "C"` functions that can panic, C++ exceptions escaping into C, UI or runtime APIs called from worker threads, cancellation during a callback.
|
|
141
|
+
|
|
142
|
+
**How to prove.** Show what actually happens: a clean abort (lower impact) or corrupted state (higher). Do not assign impact before observing which.
|
|
143
|
+
|
|
144
|
+
## Binary loading and runtimes
|
|
145
|
+
|
|
146
|
+
### `library-search-order-hijack`
|
|
147
|
+
|
|
148
|
+
**What.** A process with privileges maps code (a shared library, a plugin, a helper binary, a runtime image) from a location that someone with less trust can write, or resolves a bare name through a working directory or environment variable an attacker can influence.
|
|
149
|
+
|
|
150
|
+
**Where to look.** `dlopen`, `LoadLibrary`, `LD_LIBRARY_PATH`, `DYLD_*`, `@rpath`, plugin directories, `PATH` lookups of helpers, fallback and compatibility search paths. Compare each candidate path's owner with the install owner.
|
|
151
|
+
|
|
152
|
+
**How to prove.** Name the lower-trust writer, the writable path, and show the privileged process mapping a planted dummy library in a sandbox.
|
|
153
|
+
|
|
154
|
+
**Only a note.** Someone loading a plugin of their choice into a process they already own: no boundary is crossed.
|
|
155
|
+
|
|
156
|
+
### `verify-then-load-gap`
|
|
157
|
+
|
|
158
|
+
**What.** The loader checks one file or metadata record but maps something else, because path resolution, file replacement, multi-architecture slices or embedded resources are not tied to the check.
|
|
159
|
+
|
|
160
|
+
**Where to look.** Signature checks by path followed by a second open, fat binaries where one slice is checked and another loaded, resources loaded separately from the verified container. Authenticity of the delivery channel itself is a supply-chain question, not this class.
|
|
161
|
+
|
|
162
|
+
**How to prove.** Show the checked identity and the mapped identity differ, and name who can make them differ.
|
|
163
|
+
|
|
164
|
+
### `malformed-binary-metadata`
|
|
165
|
+
|
|
166
|
+
**What.** Section and symbol tables, relocations, counts, offsets, bytecode or debug info inside a binary format are used before the code checks that they stay in range, do not overlap, and have the expected representation.
|
|
167
|
+
|
|
168
|
+
**Where to look.** ELF/PE/Mach-O/WASM/bytecode parsers, relocation appliers, symbol table walkers, debug-info readers.
|
|
169
|
+
|
|
170
|
+
**How to prove.** A small crafted fixture under sanitizers. Separate real memory corruption from a malformed file that is rejected safely.
|
|
171
|
+
|
|
172
|
+
**Only a note.** A clean rejection or a controlled error.
|
|
173
|
+
|
|
174
|
+
### `jit-consistency`
|
|
175
|
+
|
|
176
|
+
**What.** The validator, interpreter, optimizer and generated code disagree on types, bounds, side effects or lifetimes.
|
|
177
|
+
|
|
178
|
+
**Where to look.** Bounds-check elimination, type speculation, inlining assumptions, deoptimization paths.
|
|
179
|
+
|
|
180
|
+
**How to prove.** Run the same local input through optimized and unoptimized tiers and show a process-integrity difference (out-of-bounds, wrong type).
|
|
181
|
+
|
|
182
|
+
**Only a note.** Output that differs between tiers but stays within the language's defined semantics.
|
|
183
|
+
|
|
184
|
+
### `unload-teardown-dangling`
|
|
185
|
+
|
|
186
|
+
**What.** Code or data owned by a module (function pointers, registered callbacks, threads it started, views into its memory) stays reachable after the module unloads or the runtime resets.
|
|
187
|
+
|
|
188
|
+
**Where to look.** Shutdown code and failed-load cleanup, reviewed as closely as startup. Registered callbacks not unregistered, threads not joined.
|
|
189
|
+
|
|
190
|
+
**How to prove.** Unload then trigger the callback in a harness; sanitizer shows the stale call.
|
|
191
|
+
|
|
192
|
+
## Kernel and privileged interfaces
|
|
193
|
+
|
|
194
|
+
### `user-copy-double-fetch`
|
|
195
|
+
|
|
196
|
+
**What.** Kernel code (an ioctl, a syscall, a driver, an in-kernel parser) validates a value read from user memory, then fetches it from that user address a second time, after the user may have changed it.
|
|
197
|
+
|
|
198
|
+
**Where to look.** Repeated `copy_from_user` / `get_user` on the same pointer, length read once and data read later. Also check size, direction and access checks at every user-copy primitive.
|
|
199
|
+
|
|
200
|
+
**How to prove.** Cite both reads; a local VM test with a racing thread that changes the value between them. The fix is one full copy or revalidation of the second copy.
|
|
201
|
+
|
|
202
|
+
### `privileged-object-lifecycle`
|
|
203
|
+
|
|
204
|
+
**What.** Objects reachable from outside have unbalanced retain/release, teardown that skips observer drain, unchecked selector or table indices, or a duplicated compatibility path that omits a guard.
|
|
205
|
+
|
|
206
|
+
**Where to look.** Diff each dispatch path and each free path side by side: 32-bit compat handlers, legacy ioctls, method tables indexed by user selectors.
|
|
207
|
+
|
|
208
|
+
**How to prove.** The missing guard on one path and a VM-local trigger showing its effect.
|
|
209
|
+
|
|
210
|
+
### `under-authorized-privileged-interface`
|
|
211
|
+
|
|
212
|
+
**What.** An admin socket, device node, management API or helper checks that a request is well formed, and never asks whether this caller may act on the target resource.
|
|
213
|
+
|
|
214
|
+
**Where to look.** Device node permissions, admin socket handlers, management RPCs with no caller check.
|
|
215
|
+
|
|
216
|
+
**How to prove.** Establish who can actually reach the interface. If permissions or sandbox policy live outside the repo, needs-validation.
|
|
217
|
+
|
|
218
|
+
## Moves that apply to every class above
|
|
219
|
+
|
|
220
|
+
- When a fix lands for one source-to-sink shape, look for the same shape in siblings. Guarding one caller does not guard the rest; the same holds for one architecture, one protocol role, one feature flag, one compat path.
|
|
221
|
+
- For each parser or FFI boundary, fill one row: accepted length and type, checked representation, allocation owner, consumer, thread, teardown. Most native findings are one cell that disagrees with another.
|
|
222
|
+
- Use existing corpora and small local boundary fixtures. Keep the exact sanitizer or runtime output, and note which property of the input causes it. No large resource use, no live target.
|
|
223
|
+
|
|
224
|
+
## Checklist before reporting
|
|
225
|
+
|
|
226
|
+
1. A realistic untrusted entry point and the exact operation that breaks an invariant (lifetime, bounds, ABI, type, concurrency, loading or authority).
|
|
227
|
+
2. The observed effect, named precisely: out-of-bounds read or write, use of a stale alias, access to the wrong object, leaked uninitialized bytes, an image loaded without authority, a deadlock, or a clean termination. Claim nothing stronger than what was seen.
|
|
228
|
+
3. The narrowest harness, test, sanitizer or fuzzer that reproduces it, with sanitizer coverage of the faulting operation checked and architecture and build flags recorded.
|
|
229
|
+
4. Concurrency: a deterministic schedule or a sanitizer trace. Loading: checked identity differs from mapped identity, and the lower-trust writer is named.
|
|
230
|
+
5. Confirmed needs exact input, source trace and observed result. Otherwise needs-validation, naming the one missing fact (reachability, ABI, build, deployment, runtime) and the check that would settle it.
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# Protocols, RPC and messaging
|
|
2
|
+
|
|
3
|
+
Load when the target speaks gRPC, GraphQL over a non-HTTP transport, Cap'n Proto, Thrift, Protobuf, a custom binary protocol, streaming RPC, webhooks, or uses brokers, queues, pub/sub or an event bus. Parser memory safety belongs in [memory-and-binary.md](memory-and-binary.md); availability impact belongs in [resource-exhaustion.md](resource-exhaustion.md).
|
|
4
|
+
|
|
5
|
+
This file covers who the peer is, how a message is interpreted, where it is routed, and what happens on replay, reordering and redelivery. Split large systems by producer/consumer pair, by internal vs external peer, and by sync RPC vs stream vs async message.
|
|
6
|
+
|
|
7
|
+
## Ground rules for this domain
|
|
8
|
+
|
|
9
|
+
- A service being "internal" authenticates nobody. At every hop, name the peer identity and show how it turns into the application principal that authorization uses.
|
|
10
|
+
- A schema check proves the message has the right shape. It says nothing about where it came from, what the sender may touch, its order, or whether its values are safe. Follow the decoded fields all the way to policy and side effects.
|
|
11
|
+
- What the broker guarantees and what the application assumes are different things. Write down retry, ordering, ack, dedup and transaction behaviour before judging any state change.
|
|
12
|
+
- A parser-disagreement claim needs two concrete consumers (or schema versions, or wire forms) and one security-relevant value they decode differently.
|
|
13
|
+
- Prove with bounded local producer/consumer tests or an in-memory transport ([../isolated-execution.md](../isolated-execution.md)), never against a live broker. Verdicts follow [../verification.md](../verification.md); broker ACLs, mesh identity, topic wiring or compatibility settings outside the repo leave a finding at needs-validation.
|
|
14
|
+
|
|
15
|
+
## Framing and interpretation
|
|
16
|
+
|
|
17
|
+
### `message-canonicalization-mismatch`
|
|
18
|
+
|
|
19
|
+
**What.** Two components read the same bytes differently. Typical disagreements: framing length, compression, repeated fields, fields the schema does not know, text encoding, normalization, integer width, and whether the envelope or the body wins.
|
|
20
|
+
|
|
21
|
+
**Where to look.** Generated parser vs a hand-written one, gateway vs backend, two language bindings, version converters. Protobuf last-field-wins vs JSON first-wins, int64 read as float in JavaScript, duplicate map keys.
|
|
22
|
+
|
|
23
|
+
**How to prove.** Cite both decoders, feed one fixture to both, and show a different principal, resource or operation after decoding. If either side rejects the message cleanly, it is not confirmed.
|
|
24
|
+
|
|
25
|
+
### `variant-default-confusion`
|
|
26
|
+
|
|
27
|
+
**What.** Unknown enum values, a missing discriminator, zero values, privileges granted by default or legacy compatibility mappings flow into code that believes the case was already validated.
|
|
28
|
+
|
|
29
|
+
**Where to look.** `switch` with a permissive `default`, proto3 zero values meaning "admin" or "all", old consumers reading a newly added field as absent, `oneof` with no case set.
|
|
30
|
+
|
|
31
|
+
**How to prove.** A message with the unknown or zero variant, and the privileged branch it lands in.
|
|
32
|
+
|
|
33
|
+
**Only a note.** An unknown variant that falls through to a safe rejection.
|
|
34
|
+
|
|
35
|
+
### `envelope-body-identity-mismatch`
|
|
36
|
+
|
|
37
|
+
**What.** Authorization reads trusted-looking routing or envelope metadata, but the handler acts on a different tenant, account, subject, object or sender taken from the body.
|
|
38
|
+
|
|
39
|
+
**Where to look.** Headers/metadata checked by middleware, then `req.body.tenantId` used by the handler. Decide which source is authoritative and whether the client can override it.
|
|
40
|
+
|
|
41
|
+
**How to prove.** One message where envelope and body name different principals, and the side effect landing on the body's one.
|
|
42
|
+
|
|
43
|
+
## RPC identity and authorization
|
|
44
|
+
|
|
45
|
+
### `interceptor-coverage-gap`
|
|
46
|
+
|
|
47
|
+
**What.** An authn/authz interceptor guards unary calls but not streams, server reflection, health checks, gateway-transcoded routes, legacy service names or individual stream messages.
|
|
48
|
+
|
|
49
|
+
**Where to look.** Every server registration: `UnaryInterceptor` vs `StreamInterceptor`, reflection service enabled in production, REST gateway routes, duplicated services under an old package name. Map each route to the operation it reaches.
|
|
50
|
+
|
|
51
|
+
**How to prove.** The same operation reached through the unguarded route without credentials, in a local server.
|
|
52
|
+
|
|
53
|
+
### `channel-principal-confusion`
|
|
54
|
+
|
|
55
|
+
**What.** mTLS, workload identity, bearer metadata, a forwarded identity header or broker credentials authenticate the channel, but a caller-supplied field picks the user or tenant.
|
|
56
|
+
|
|
57
|
+
**Where to look.** `x-user-id`, `on_behalf_of`, `tenant` fields read after peer authentication without a policy that ties the peer to that principal.
|
|
58
|
+
|
|
59
|
+
**How to prove.** A peer authenticated as A that acts as B by setting the field. The fix is a deterministic binding between channel identity and claimed principal.
|
|
60
|
+
|
|
61
|
+
### `stream-item-authz-gap`
|
|
62
|
+
|
|
63
|
+
**What.** A stream, subscription, batch or bulk request is authorized once; later items name other resources, or the stream keeps running after role change, membership removal or token revocation.
|
|
64
|
+
|
|
65
|
+
**Where to look.** Authorization at stream open only, batch handlers checking the first item, long-lived subscriptions with no re-check.
|
|
66
|
+
|
|
67
|
+
**How to prove.** A local stream where a later item touches an unauthorized resource, or delivery continues after revocation.
|
|
68
|
+
|
|
69
|
+
### `reply-correlation-confusion`
|
|
70
|
+
|
|
71
|
+
**What.** Correlation IDs that are guessable, reused or shared across tenants let one caller's response, webhook, ack or cancel complete someone else's pending operation.
|
|
72
|
+
|
|
73
|
+
**Where to look.** Sequential request IDs, reply-to queues shared across tenants, webhook callbacks matched only by an ID, cancellation by ID without owner check.
|
|
74
|
+
|
|
75
|
+
**How to prove.** Two local callers; one satisfies or cancels the other's pending request. Bind every pending request to its peer, its tenant, its operation and its lifecycle.
|
|
76
|
+
|
|
77
|
+
## Broker and queue isolation
|
|
78
|
+
|
|
79
|
+
### `topic-scope-gap`
|
|
80
|
+
|
|
81
|
+
**What.** A publisher or subscriber can pick a channel that belongs to another tenant: a topic, a partition, a wildcard pattern, a reply queue, a consumer group or a dead-letter route.
|
|
82
|
+
|
|
83
|
+
**Where to look.** Topic names built from request input, `#` / `*` / `>` wildcards allowed to clients, consumer group IDs chosen by the client. Check broker ACLs when they are in the repo, and how the app builds namespaces. A tenant name inside the payload isolates nothing.
|
|
84
|
+
|
|
85
|
+
**How to prove.** A local broker where tenant A's client receives or publishes on tenant B's channel. ACLs not visible in the repo: needs-validation.
|
|
86
|
+
|
|
87
|
+
### `dead-letter-disclosure`
|
|
88
|
+
|
|
89
|
+
**What.** Messages sent to dead-letter queues, error topics, traces or operator consoles carry secrets or other tenants' payloads to a lower-trust reader.
|
|
90
|
+
|
|
91
|
+
**Where to look.** The failure path: what gets copied into the DLQ, error event or span, who can read it, and whether redaction happens there and not only on normal delivery.
|
|
92
|
+
|
|
93
|
+
**How to prove.** A failing local message whose sensitive content lands where a lower-trust consumer reads it.
|
|
94
|
+
|
|
95
|
+
**Only a note.** Operator-only diagnostics under an intended access policy.
|
|
96
|
+
|
|
97
|
+
### `unauthenticated-control-message`
|
|
98
|
+
|
|
99
|
+
**What.** A message body can claim to be an admin event, a provider callback, a replication record or a migration instruction, and is handled as such even though nobody authenticated the producer or the event type separately from the body.
|
|
100
|
+
|
|
101
|
+
**Where to look.** Handlers switching on `body.type == "admin"`, webhooks without signature checks, signature checks that do not bind source, account and audience.
|
|
102
|
+
|
|
103
|
+
**How to prove.** An ordinary producer publishes a forged control message and the privileged handler runs, locally.
|
|
104
|
+
|
|
105
|
+
## Replay, ordering and transactions
|
|
106
|
+
|
|
107
|
+
### `duplicate-delivery-side-effect`
|
|
108
|
+
|
|
109
|
+
**What.** A retry or redelivery repeats a side effect because dedup is missing, happens after the mutation, or uses a dedup key that two tenants or two operations can share.
|
|
110
|
+
|
|
111
|
+
**Where to look.** At-least-once consumers that charge, credit, grant or send; idempotency keys without tenant prefix; dedup written after the side effect.
|
|
112
|
+
|
|
113
|
+
**How to prove.** Establish the actual delivery model, then deliver the same message twice in-memory and show the non-idempotent effect twice.
|
|
114
|
+
|
|
115
|
+
### `stale-message-acceptance`
|
|
116
|
+
|
|
117
|
+
**What.** An older state, a revoked membership, a cancelled job or a pre-step-up authorization arrives after a newer one and overwrites it.
|
|
118
|
+
|
|
119
|
+
**Where to look.** Missing sequence/version checks, tombstones that are not honoured, partition rebalancing, replay and restore workflows.
|
|
120
|
+
|
|
121
|
+
**How to prove.** Reorder two messages locally and show the stale one winning.
|
|
122
|
+
|
|
123
|
+
### `ack-commit-ordering`
|
|
124
|
+
|
|
125
|
+
**What.** The ack goes out before the durable commit, so security-relevant work is lost; or the commit happens before an ack that can fail, so a mutation is duplicated.
|
|
126
|
+
|
|
127
|
+
**Where to look.** Manual ack placement, auto-ack consumers, missing transactional outbox/inbox, crash-recovery behaviour.
|
|
128
|
+
|
|
129
|
+
**How to prove.** Inject a failure between ack and commit in a local test and show the lost or duplicated security effect.
|
|
130
|
+
|
|
131
|
+
### `partial-multi-consumer-transition`
|
|
132
|
+
|
|
133
|
+
**What.** Several consumers together carry one authorization or business transition; retries and partial failure leave only some of them committed.
|
|
134
|
+
|
|
135
|
+
**Where to look.** Sagas without compensation, grant-then-notify chains, revocation fanned out to several services.
|
|
136
|
+
|
|
137
|
+
**How to prove.** Fail one consumer locally and show the inconsistent end state (for example, access granted but not recorded, or revoked in one service only). Name the invariant that must become atomic or be compensated under current authorization.
|
|
138
|
+
|
|
139
|
+
## Moves that apply to every class above
|
|
140
|
+
|
|
141
|
+
- For each message family, draw producer → transport/broker → gateway → consumer → storage. At each hop record the authenticated peer, the authoritative tenant/resource fields, validation, and the side effect.
|
|
142
|
+
- Feed one small fixture to every schema version and language binding in the repo. Try messages that are replayed, reordered, duplicated, missing a field, carrying unknown fields, or sitting at a boundary value. Never generate load.
|
|
143
|
+
- Check that the policy still holds on every alternative route: retries, the DLQ, replays, migrations, stream methods, reflection, and routes a gateway transcodes. Changing transport must not drop the check.
|
|
144
|
+
|
|
145
|
+
## Checklist before reporting
|
|
146
|
+
|
|
147
|
+
1. A realistic producer or peer, the accepted message, the authenticated channel identity, the affected principal or resource, and the unauthorized mutation or disclosure.
|
|
148
|
+
2. Disagreement claims: both parsers or consumers cited, and the diverging decoded value. A safe rejection on either side means not confirmed.
|
|
149
|
+
3. Replay/order claims: real delivery guarantees established and the broken invariant reproduced on a bounded local or in-memory transport.
|
|
150
|
+
4. Authorization and isolation: every interceptor, broker ACL, gateway and consumer layer visible in source checked. Anything attached outside the repo makes it needs-validation.
|
|
151
|
+
5. Confirmed needs the full message lifecycle and an observed meaningful result. Otherwise needs-validation, naming the single delivery, route, service-identity or broker fact still to check.
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# Resource exhaustion and availability
|
|
2
|
+
|
|
3
|
+
Load when anything untrusted (a request, a message, a file, tenant state, work an agent runs) can burn CPU, memory, disk, connections, worker slots, paid API calls or queue capacity, or can crash or deadlock a shared service. A reachable fatal error belongs here for its shared impact even when the parser bug itself is covered in [memory-and-binary.md](memory-and-binary.md); broker delivery logic is in [protocols-and-messaging.md](protocols-and-messaging.md).
|
|
4
|
+
|
|
5
|
+
The job of this file is to separate an availability vulnerability you can show from source from an ordinary performance complaint.
|
|
6
|
+
|
|
7
|
+
## Ground rules for this domain
|
|
8
|
+
|
|
9
|
+
- A finding needs three things: a path from input to cost, a limit that is missing or ineffective, and damage to someone else (another user, a shared service, a safety function, or money the operator pays). If the only process that suffers is the requester's own, there is no vulnerability.
|
|
10
|
+
- "No rate limit" alone is not a finding. Before calling a path unbounded, check per-tenant quotas, upstream gateways, deadlines, constraints in the database, queue sizes, concurrency limits, and size caps on bodies, messages and files.
|
|
11
|
+
- **Never stress, saturate or load-test anything shared or live.** Proof means complexity analysis on paper, a few small growth points, paid calls replaced by mocks, hard resource caps on the local process, and cancellation tests with a fixed schedule, all inside the sandbox described in [../isolated-execution.md](../isolated-execution.md).
|
|
12
|
+
- Always state: what it costs the attacker, how much work the service does, whether the effect persists, how wide it reaches, and how it recovers. One small input with a superlinear or lasting shared effect is a different finding from sustained volume.
|
|
13
|
+
- Verdicts follow [../verification.md](../verification.md). Upstream caps, deployed topology, autoscaling, paid quotas or recovery behaviour outside the repo leave a finding at needs-validation.
|
|
14
|
+
|
|
15
|
+
## Computational amplification
|
|
16
|
+
|
|
17
|
+
### `superlinear-processing`
|
|
18
|
+
|
|
19
|
+
**What.** A small accepted input triggers catastrophic regex backtracking, deep nested parsing, recursive validation, symbolic evaluation, graph walks, template expansion, or adversarial sort/hash behaviour.
|
|
20
|
+
|
|
21
|
+
**Where to look.** Regexes with nested quantifiers or overlapping alternation (`(a+)+`, `(a|a)*`) run on user input; recursive descent parsers without a depth cap; JSON-schema `$ref` loops; template engines with include/macro recursion; hash tables keyed by attacker strings without a seeded hash.
|
|
22
|
+
|
|
23
|
+
**How to prove.** Derive the accepted depth or cardinality and the complexity, then time a few input sizes locally under a strict timeout and show the growth curve.
|
|
24
|
+
|
|
25
|
+
### `expansion-bomb`
|
|
26
|
+
|
|
27
|
+
**What.** Compressed, sparse, nested, aliased or encoded input grows far beyond the size that was checked on the wire or on disk.
|
|
28
|
+
|
|
29
|
+
**Where to look.** Zip/gzip/brotli inflate, archives within archives, image dimensions vs file size, fonts, office documents, YAML anchors and aliases, XML entity expansion, protocol header-compression tables. Limits must hold after every expansion step and across parser stages.
|
|
30
|
+
|
|
31
|
+
**How to prove.** A small bomb fixture under a memory-capped local process, showing the post-expansion size or the cap being hit where none exists in code.
|
|
32
|
+
|
|
33
|
+
### `downstream-query-amplification`
|
|
34
|
+
|
|
35
|
+
**What.** One small request fans out: wide scans, costly joins, unbounded sorts or aggregates, or a flood of calls to other services. The cause is a missing cap on page size, query depth, filter cardinality or expansion fields.
|
|
36
|
+
|
|
37
|
+
**Where to look.** GraphQL depth/alias/complexity, `?expand=` / `include=` parameters, `limit` taken from the client without a max, N+1 fan-out to other services, `ORDER BY` on unindexed columns from user input.
|
|
38
|
+
|
|
39
|
+
**How to prove.** Count queries or downstream calls per request locally, or show the unbounded parameter. Confirm authorization does not deliberately grant that same scope.
|
|
40
|
+
|
|
41
|
+
**Only a note.** A slow query over data the caller is entitled to scan, behind an effective page cap.
|
|
42
|
+
|
|
43
|
+
## Resource accumulation
|
|
44
|
+
|
|
45
|
+
### `unbounded-accumulation`
|
|
46
|
+
|
|
47
|
+
**What.** Bodies, out-of-order stream chunks, uploads, sessions, unique cache keys, metric labels, log fields, subscriptions or pending jobs pile up without a per-item and an aggregate cap.
|
|
48
|
+
|
|
49
|
+
**Where to look.** In-memory maps keyed by request data, metric labels from user values, reassembly buffers, session stores without expiry. Check cleanup on disconnect, timeout, cancel and partial parse.
|
|
50
|
+
|
|
51
|
+
**How to prove.** A bounded local loop showing state growing with attacker-chosen cardinality and never reclaimed.
|
|
52
|
+
|
|
53
|
+
### `handle-leak`
|
|
54
|
+
|
|
55
|
+
**What.** Malformed or cancelled work skips cleanup and keeps sockets, files, DB cursors, timers, subprocesses, temp files or object references.
|
|
56
|
+
|
|
57
|
+
**Where to look.** Error branches without `finally` / `defer` / `with` / RAII, early returns, exceptions between open and close, child processes not reaped.
|
|
58
|
+
|
|
59
|
+
**How to prove.** Repeat the bad input a bounded number of times locally and show the count of open handles rising inside a shared pool.
|
|
60
|
+
|
|
61
|
+
### `orphaned-work-after-cancel`
|
|
62
|
+
|
|
63
|
+
**What.** The client times out, disconnects, cancels, or fails authorization, control returns, but database, model, network or worker work keeps running.
|
|
64
|
+
|
|
65
|
+
**Where to look.** Context/deadline/abort signal not passed to DB drivers, HTTP clients, LLM calls or worker queues; `fire-and-forget` tasks started before the auth check.
|
|
66
|
+
|
|
67
|
+
**How to prove.** A deterministic cancel test showing the downstream mock still invoked or still running after cancel.
|
|
68
|
+
|
|
69
|
+
## Quotas and scheduling
|
|
70
|
+
|
|
71
|
+
### `pre-auth-cost-imbalance`
|
|
72
|
+
|
|
73
|
+
**What.** Costly parsing, key lookups, cryptography, decompression or outbound requests run before authentication and before the earliest size or rate gate.
|
|
74
|
+
|
|
75
|
+
**Where to look.** Middleware order: body parsing and decompression before auth, password hashing for unknown users, signature verification of huge payloads, fetching a remote JWKS on every bad token.
|
|
76
|
+
|
|
77
|
+
**How to prove.** Compare minimal requester effort with service cost, and check any upstream limit visible in config.
|
|
78
|
+
|
|
79
|
+
### `quota-accounting-gap`
|
|
80
|
+
|
|
81
|
+
**What.** Budget is counted on a dimension the attacker can change (IP, route, tenant, key prefix, task ID), so one principal escapes its budget or spends another's.
|
|
82
|
+
|
|
83
|
+
**Where to look.** Rate limiter keys, `X-Forwarded-For` trust, counters that overflow, distributed counters without atomic increments, counters reset on reconnect or account switch, retries not counted.
|
|
84
|
+
|
|
85
|
+
**How to prove.** A local test where one principal exceeds its quota by varying the key, or exhausts another principal's allocation.
|
|
86
|
+
|
|
87
|
+
### `shared-pool-starvation`
|
|
88
|
+
|
|
89
|
+
**What.** Low-priority or attacker-driven jobs hold shared locks, workers, DB connections, event-loop turns or scheduler priority that unrelated users need.
|
|
90
|
+
|
|
91
|
+
**Where to look.** Blocking calls on an async event loop, single global worker pools, jobs with no deadline, priority set by the client.
|
|
92
|
+
|
|
93
|
+
**How to prove.** Show a path that bypasses queue or concurrency fairness, or keeps a slot past its deadline, with a small local schedule.
|
|
94
|
+
|
|
95
|
+
## Failure and recovery
|
|
96
|
+
|
|
97
|
+
### `reachable-fatal-error`
|
|
98
|
+
|
|
99
|
+
**What.** Untrusted input reaches `panic`, `abort`, a fatal assertion, an unhandled exception, `process.exit`, a lock cycle or an infinite loop in a shared process.
|
|
100
|
+
|
|
101
|
+
**Where to look.** `unwrap()` / `expect()` on parsed input, `assert` on request data, unhandled promise rejections, `os.Exit` in handlers, `while` loops whose exit depends on input.
|
|
102
|
+
|
|
103
|
+
**How to prove.** The input and the crash locally. State the supervisor scope: one worker or the whole service. A restarted isolated worker lowers impact; the defect remains.
|
|
104
|
+
|
|
105
|
+
### `retry-storm`
|
|
106
|
+
|
|
107
|
+
**What.** Timeouts, dependency errors, half-processed messages or failed health checks cause synchronized or unbounded retries with no jitter, ceiling, circuit breaker or dedup.
|
|
108
|
+
|
|
109
|
+
**Where to look.** Retry loops without max attempts or backoff, health checks that restart everything at once, fail-open fallbacks that do more work.
|
|
110
|
+
|
|
111
|
+
**How to prove.** One bounded local failure source producing lasting aggregate work against mocks.
|
|
112
|
+
|
|
113
|
+
### `poison-record-blocking`
|
|
114
|
+
|
|
115
|
+
**What.** One malformed record fails again and again at the front of something shared: a queue, a partition, a migration, a startup scan, a recovery loop.
|
|
116
|
+
|
|
117
|
+
**Where to look.** Consumers that never skip or quarantine, offsets committed only on success, startup that crashes on one bad row. Check whether other tenants share the blocked unit.
|
|
118
|
+
|
|
119
|
+
**How to prove.** Insert one bad record locally and show the unit stuck for everyone behind it.
|
|
120
|
+
|
|
121
|
+
### `unsafe-recovery`
|
|
122
|
+
|
|
123
|
+
**What.** When the service restarts, falls back, cleans up or restores, it rebuilds state without limits, skips today's quotas, or puts back the very input that fails again.
|
|
124
|
+
|
|
125
|
+
**Where to look.** Replay-on-startup, cache warmers, restore jobs, fallback paths with no limits. Recovery is part of availability.
|
|
126
|
+
|
|
127
|
+
**How to prove.** A local restart loop or an unbounded rebuild shown with small data.
|
|
128
|
+
|
|
129
|
+
## Moves that apply to every class above
|
|
130
|
+
|
|
131
|
+
- Build one table per input: earliest accepted size and cardinality, work done before auth, downstream fan-out, persistence, which shared pool it uses, which limit and cleanup owns it, how it recovers.
|
|
132
|
+
- Compare per-object limits with aggregate limits. 10,000 legal one-byte items each pass the per-message cap, yet together they fill state shared by the tenant or the process.
|
|
133
|
+
- Run proofs only in a sandboxed fixture with tight caps on CPU, memory and time, using a few small input sizes. Replace external and paid calls with mocks. Stop the moment the missing bound or the missing cancellation shows.
|
|
134
|
+
|
|
135
|
+
## Checklist before reporting
|
|
136
|
+
|
|
137
|
+
1. Untrusted input, requester effort, the amplification or retained resource, the shared blast radius, and recovery. Missing limits with no concrete shared impact are hardening notes.
|
|
138
|
+
2. No upstream, parser, queue, tenant or framework bound in source stops the path. Unknown deployed controls mean needs-validation.
|
|
139
|
+
3. Superlinear: accepted complexity plus bounded local growth. Leak: repeatable retention after cleanup should have run. Fatal path: process and supervisor isolation identified.
|
|
140
|
+
4. Rank by low requester effort, unauthenticated reach, cross-tenant scope, persistence and poor recovery. Never validate by causing an outage.
|
|
141
|
+
5. Confirmed needs safe local proof and a meaningful shared effect. Otherwise needs-validation, naming what the owner must look at: the specific upstream limit, quota, topology or recovery behaviour.
|