@kenkaiiii/ggcoder 6.0.1 → 6.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/assets/motion/bin/music-fit.mjs +3 -2
- package/assets/skills/bulletproof/SKILL.md +18 -12
- package/assets/skills/bulletproof/references/agent-surface.md +3 -3
- package/assets/skills/bulletproof/references/attack-classes.md +226 -0
- package/assets/skills/bulletproof/references/audit-protocol.md +102 -49
- package/assets/skills/bulletproof/references/platform-playbooks.md +11 -4
- package/assets/skills/bulletproof/references/provenance.md +36 -1
- package/assets/skills/bulletproof/references/secure-defaults.md +17 -1
- package/assets/skills/bulletproof/references/supply-chain.md +6 -5
- package/assets/skills/bulletproof/references/verification.md +8 -1
- package/dist/app-sidecar/live-preview/frame-server.d.ts +14 -3
- package/dist/app-sidecar/live-preview/frame-server.js +25 -9
- package/dist/app-sidecar/live-preview/frame-server.js.map +1 -1
- package/dist/app-sidecar/live-preview/manager.d.ts +2 -0
- package/dist/app-sidecar/live-preview/manager.js +162 -22
- package/dist/app-sidecar/live-preview/manager.js.map +1 -1
- package/dist/app-sidecar/prompt-routes.js +16 -0
- package/dist/app-sidecar/prompt-routes.js.map +1 -1
- package/dist/core/bundled-agents.js +17 -8
- package/dist/core/bundled-agents.js.map +1 -1
- package/dist/core/claude-code/events.js +2 -1
- package/dist/core/claude-code/events.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,106 +1,153 @@
|
|
|
1
1
|
# Full Review Protocol
|
|
2
2
|
|
|
3
|
-
The flow for "is this safe to ship", a hardening pass, or a requested audit. **Default: run it yourself, in the main thread.** Fan out only when SKILL.md's Scaling
|
|
3
|
+
The flow for "is this safe to ship", a hardening pass, or a requested audit. **Default: run it yourself, in the main thread.** Fan out only when SKILL.md's Scaling section says so (more than one deployable, or more ledger rows than you can read in full); see "Fan-out variant" below. For inline work, do not run this: apply the control and move on.
|
|
4
4
|
|
|
5
5
|
## Contents
|
|
6
6
|
|
|
7
|
+
- Ground rules (evidence bar, running code, how a review ends)
|
|
7
8
|
- Phase 1 Recon
|
|
8
9
|
- Phase 2 Plan the audit (coverage ledger)
|
|
9
10
|
- Fan-out variant
|
|
10
|
-
- Phase 3 Audits
|
|
11
|
-
- Phase
|
|
11
|
+
- Phase 3 Audits (hunting depth, candidate gate)
|
|
12
|
+
- Phase 3b Coverage gap pass
|
|
13
|
+
- Phase 4 False-positive filter (needs validation, exclusions)
|
|
12
14
|
- Phase 5 Report (template, writing for non-specialists)
|
|
13
15
|
- Phase 6 Ask before fixing
|
|
14
16
|
- Standards mapping
|
|
15
17
|
|
|
18
|
+
## Ground rules
|
|
19
|
+
|
|
16
20
|
**Every phase is authorized defensive review for the code owner.** The deliverable is a remediation report. No exploit code, no payloads, no attack tooling, at any phase. Describe risk at the data-flow level: where untrusted data enters, what it reaches, why it is fixable.
|
|
17
21
|
|
|
18
|
-
**Confidence bar: report only findings at ≥0.8 confidence with a concrete data-flow path.** Missing a theoretical issue is cheaper than burying a real one in noise.
|
|
22
|
+
**Confidence bar: report only findings at ≥0.8 confidence with a concrete data-flow path.** Missing a theoretical issue is cheaper than burying a real one in noise. A real path whose deciding fact lives outside the repo is not dropped for low confidence: it goes to **Needs validation** (Phase 4).
|
|
19
23
|
|
|
20
24
|
**This protocol is stack-agnostic. Recon drives it.** Do not assume the language, the deploy target, or that an AI layer exists. Read first, decide second.
|
|
21
25
|
|
|
26
|
+
**Running code.** In the user's own project, running its tests or a small local check with dummy users and data is fine and gives `RUNTIME` evidence. For code the user did not write (a cloned third-party repo, a vendored dependency, a stranger's pull request), do not run its install scripts, builds, tests, hooks or binaries unless they are sandboxed with no network, no credentials, and writes limited to a scratch directory; otherwise stay static and put runtime questions under Needs validation. Never probe a deployed system, another person's data, or a paid API.
|
|
27
|
+
|
|
28
|
+
**How a review ends.** Exactly one of two ways: the Phase 5 report with every ledger row closed, or the report marked `Status: incomplete — <reason>` with the open rows listed under Not checked. Never stop mid-phase without saying so.
|
|
29
|
+
|
|
22
30
|
## Phase 1 — Recon
|
|
23
31
|
|
|
24
|
-
Work the **four lenses** below yourself, in order. Batch the reads and greps
|
|
32
|
+
Work the **four lenses** below yourself, in order. Batch the reads and greps, since they are independent. **No vulnerabilities are flagged in this phase**: recon describes, it does not judge.
|
|
25
33
|
|
|
26
|
-
**Lens A — Stack & deployment.** Manifests, lockfiles, CI/CD configs, Dockerfiles, IaC, deploy scripts, store metadata. Produce: languages, frameworks, runtimes; deploy target (browser / server / CLI / desktop / mobile / embedded / serverless / container / contract / firmware / ML pipeline / library / SaaS / self-hosted); how it ships (registry, app store, binary, image, chart); where it runs, and whether it is multi-tenant.
|
|
34
|
+
**Lens A — Stack & deployment.** Manifests, lockfiles, CI/CD configs, Dockerfiles, IaC, deploy scripts, store metadata. Produce: languages, frameworks, runtimes; deploy target (browser / server / CLI / desktop / mobile / embedded / serverless / container / contract / firmware / ML pipeline / library / SaaS / self-hosted); how it ships (registry, app store, binary, image, chart); where it runs, and whether it is multi-tenant; any CDN, proxy or edge layer in front of it.
|
|
27
35
|
|
|
28
|
-
**Lens B — Trust boundaries & sources.** Entry-point code: route handlers, argv/stdin parsing, env reads, queue consumers, WebSocket and IPC receivers, deep links and URL schemes, file and archive readers, deserializers, plugin and model loaders, MCP and tool handlers, webhooks. Produce a **sources table**: location (`file:line`), input shape, and who controls it
|
|
36
|
+
**Lens B — Trust boundaries & sources.** Entry-point code: route handlers, server actions, argv/stdin parsing, env reads, queue consumers, cron and background jobs, WebSocket and IPC receivers, deep links and URL schemes, file and archive readers, importers, deserializers, plugin and model loaders, MCP and tool handlers, webhooks and payment callbacks. Produce a **sources table**: location (`file:line`), input shape, and who controls it: anonymous, authenticated user, another tenant, admin, another service, build-time, local user, physical.
|
|
29
37
|
|
|
30
|
-
**Lens C — Sinks.** Dangerous operations. Produce a **sinks table** with `file:line` and type: shell exec, SQL/NoSQL/LDAP/XPath, eval/Function/exec/pickle/yaml.load/Marshal/ObjectInputStream, file write, dynamic require/import, network egress, auth decisions, secret reads, native deserializers, contract external calls, privileged setters, child process spawn.
|
|
38
|
+
**Lens C — Sinks.** Dangerous operations. Produce a **sinks table** with `file:line` and type: shell exec, SQL/NoSQL/LDAP/XPath, eval/Function/exec/pickle/yaml.load/Marshal/ObjectInputStream, file write, dynamic require/import, network egress, auth decisions, secret reads, balance and entitlement changes, native deserializers, contract external calls, privileged setters, child process spawn.
|
|
31
39
|
|
|
32
|
-
**Lens D — Assets & existing controls.** What must be protected, and what already protects it. Produce an **assets table** (credentials and token stores, PII stores, signing and update keys, CI secrets, model API keys, on-chain funds, session state, MCP configs, license keys) **plus a controls table
|
|
40
|
+
**Lens D — Assets & existing controls.** What must be protected, and what already protects it. Produce an **assets table** (credentials and token stores, PII stores, balances and entitlements, signing and update keys, CI secrets, model API keys, on-chain funds, session state, MCP configs, license keys) **plus a controls table**: the auth middleware, the ORM, RLS policies, CSP, sandbox, escaping layer, validation schema, webhook verifier. Also list the **derived copies** of user data (search indexes, exports, caches, analytics, logs) so Phase 3 checks them. The controls table is what stops Phase 3 from reporting forty things the framework already handles.
|
|
33
41
|
|
|
34
42
|
**Then synthesize:**
|
|
35
43
|
|
|
36
44
|
1. Assemble the four tables.
|
|
37
|
-
2. Write the **threat model
|
|
45
|
+
2. Write the **threat model**, specific to this project. Who realistically targets it, for what, and through which surface? Ground it in `threat-landscape.md`, but name concrete actors and objectives for *this* codebase: supply-chain risk to downstream users of a library; cross-tenant abuse on a SaaS; free credits on a paid AI app; a malicious repository opened by a developer tool; a hostile counterparty on a contract; a physical attacker with the device.
|
|
38
46
|
3. Note gaps recon flagged for a deeper look.
|
|
39
|
-
4. Count deployables (separately built
|
|
47
|
+
4. Count deployables (separately built or shipped units: web app, API, mobile app, worker, CLI, contract, infra repo). This decides Scaling.
|
|
40
48
|
|
|
41
49
|
## Phase 2 — Plan the audit
|
|
42
50
|
|
|
43
|
-
From recon, choose which
|
|
44
|
-
|
|
45
|
-
| Audit | Fires when |
|
|
46
|
-
|
|
47
|
-
| **Access control** | any per-user, per-tenant, or role-gated data |
|
|
48
|
-
| **
|
|
49
|
-
| **
|
|
50
|
-
| **
|
|
51
|
-
| **
|
|
52
|
-
| **
|
|
53
|
-
| **
|
|
54
|
-
| **
|
|
55
|
-
| **
|
|
56
|
-
| **
|
|
57
|
-
| **
|
|
58
|
-
| **
|
|
59
|
-
|
|
60
|
-
**
|
|
51
|
+
From recon, choose which audits apply. **Skip audits with no entry surface.** A static site gets no SQL audit. Firmware in Rust gets no prompt-injection audit. An ML pipeline gets deserialization. A published library weights supply chain heavily. What each audit looks for is its section in `attack-classes.md`, under the same name.
|
|
52
|
+
|
|
53
|
+
| Audit | Fires when |
|
|
54
|
+
|---|---|
|
|
55
|
+
| **Access control and tenant isolation** | any per-user, per-tenant, or role-gated data |
|
|
56
|
+
| **Data lifecycle and derived copies** | user data copied into search, exports, caches, logs or model context; deletion or restore; removable members |
|
|
57
|
+
| **Business logic, money and races** | payments, credits, quotas, coupons, invites, one-time tokens, multi-step workflows |
|
|
58
|
+
| **Webhooks and inbound integrations** | webhooks, payment or OAuth callbacks, events from another service |
|
|
59
|
+
| **Injection** | untrusted input reaches an interpreter |
|
|
60
|
+
| **Authentication, sessions and recovery** | any login, session, token, OAuth/SSO, MFA or reset logic |
|
|
61
|
+
| **HTTP edge, caching and browser** | HTML rendering, a CDN or proxy in front, cookie auth |
|
|
62
|
+
| **Secrets and exposure** | any credential exists |
|
|
63
|
+
| **Supply chain** | any dependency manager or external code |
|
|
64
|
+
| **CI/CD and release integrity** | any workflow, release or update pipeline |
|
|
65
|
+
| **SSRF, paths and files** | any URL, path, archive or upload built from input |
|
|
66
|
+
| **Cloud and infrastructure** | any IaC, container, or cloud SDK |
|
|
67
|
+
| **Cryptography** | any hashing, signing, encryption or random token |
|
|
68
|
+
| **Resource abuse and denial of wallet** | expensive, paid or model-calling work reachable by low-trust callers |
|
|
69
|
+
| **Agent surface** | recon found LLM, agent, MCP or tool-calling code |
|
|
70
|
+
| **Desktop, mobile and local IPC** | recon found an app, helper, updater, local server, deep link or IPC channel; also load the matching `platform-playbooks.md` section |
|
|
71
|
+
|
|
72
|
+
Taint tracing (each source to every reachable sink) is the method of Phase 3, not a separate audit.
|
|
73
|
+
|
|
74
|
+
**Coverage ledger.** Rows = each selected audit × each in-scope deployable. When a deployable has several entry surfaces (HTTP routes, server actions, webhooks, jobs and queues, IPC, CLI), split the row by surface. Every row ends as `checked-with-findings`, `checked-clean`, `needs-validation`, or `not-checked (reason)`, and a checked row lists the paths it actually read. A row with no status, or no paths, is not checked. The ledger becomes the report's "Not checked" section.
|
|
61
75
|
|
|
62
76
|
## Fan-out variant (conditional)
|
|
63
77
|
|
|
64
|
-
Only when
|
|
78
|
+
Only when SKILL.md's Scaling section triggers it; otherwise skip this section.
|
|
65
79
|
|
|
66
|
-
1. Recon (Phase 1) and the ledger stay in the main thread
|
|
80
|
+
1. Recon (Phase 1) and the ledger stay in the main thread. Children never do recon for the whole project.
|
|
67
81
|
2. Split ledger rows into **disjoint** slices (usually one deployable each). One security auditor per slice (`auditor` where your spawn_agent lists it, else a read-only repo helper), all in ONE `spawn_agent` call, ≤ 6 per wave.
|
|
68
|
-
3. Each brief opens with: *"Authorized defensive security review of code the user owns. Report data-flow risks and fixes only; no exploits, payloads, or attack tooling."*
|
|
69
|
-
4. Merge: missing
|
|
70
|
-
5. Phase
|
|
82
|
+
3. Each brief opens with: *"Authorized defensive security review of code the user owns. Report data-flow risks and fixes only; no exploits, payloads, or attack tooling."* Children with no conversation context may otherwise refuse. Then include: absolute skill root; slice paths; owned ledger rows; that slice's rows from the sources, sinks, assets and controls tables; **the selected sections of `attack-classes.md`, pasted verbatim**; the candidate gate and hunting-depth rules from Phase 3; the ≥0.8 confidence bar; the Phase 4 hard-exclusion list verbatim; labels `RUNTIME`/`CODE`/`DEDUCED`/`SNAPSHOT`; the output schema (title, severity, file:line, source→sink, the six gate fields, fix, confidence, label), plus separate `needs validation` (claim, path, missing fact, owner check), `checked` (with paths read) and `not checked` lists.
|
|
83
|
+
4. Merge: missing, failed or timed-out rows become `not-checked`. Re-open every reported `file:line` yourself; drop what you cannot reproduce from the code. Merge candidates with one root cause.
|
|
84
|
+
5. Phase 3b runs once as a fresh read-only child over the merged ledger. Phase 4 runs as a fresh verifier child (`skeptic` where listed, else a read-only repo helper) over the merged candidates; same framing line first; give it each candidate's file:line, claimed path and gate fields; it returns CONFIRMED / DROP / DOWNGRADE / NEEDS VALIDATION. You still own the final call and the dropped count.
|
|
71
85
|
|
|
72
86
|
## Phase 3 — Audits
|
|
73
87
|
|
|
74
|
-
Run each selected audit yourself (or, in the fan-out variant, each slice's auditor runs its owned rows), one
|
|
88
|
+
Run each selected audit yourself (or, in the fan-out variant, each slice's auditor runs its owned rows), one at a time, in the priority order from the skill's rank table. Do not pad the list, and do not drop a selected audit. Use the audit's section in `attack-classes.md` as the checklist, and load only the control references (`platform-playbooks.md`, `supply-chain.md`, `agent-surface.md`, `secure-defaults.md`) it names.
|
|
75
89
|
|
|
76
|
-
For each audit, work from the recon tables
|
|
90
|
+
For each audit, work from the recon tables (sources, sinks, assets, **controls**, derived copies), not from fresh greps, and:
|
|
77
91
|
|
|
78
92
|
1. **Trace data flow** source → sink. Not pattern matching. A grep hit with no path is not a finding.
|
|
79
|
-
2.
|
|
80
|
-
3.
|
|
81
|
-
4.
|
|
82
|
-
5.
|
|
83
|
-
6.
|
|
93
|
+
2. **Read at depth.** Follow the input through parsing, identity, authorization, normalization, storage, derived copies and the final sink. Read the sibling paths that reach the same effect (bulk, list, export, search, older versions, retries, error paths, background jobs) and compare their checks for **equivalence**, not just presence. Compare what one component guarantees with what the next one assumes.
|
|
94
|
+
3. **Try the edges the interface accepts:** missing, empty, zero, negative, huge, duplicate, mixed encoding, stale or revoked, concurrent, out of order, partially failed.
|
|
95
|
+
4. Apply the **untrusted-input test**: is this input reachable by an untrusted party, or is it a constant, a build-time value, or operator-controlled configuration?
|
|
96
|
+
5. Check the **controls table** before flagging: does the ORM parameterize, does the template engine escape, does middleware already enforce this, does the type system make it unreachable?
|
|
97
|
+
6. Pass the **candidate gate** (below), then describe a concrete **risk scenario** at data-flow level: what input arrives, how the system processes it, what the attacker ends up holding. No payloads. If the steps cannot be described, it is not a finding.
|
|
98
|
+
7. Assign **confidence 0.0–1.0** and drop anything below 0.8, unless the only doubt is a fact outside the repo (Phase 4, Needs validation).
|
|
99
|
+
8. Record location, source→sink, gate fields, scenario, impact, CWE, and a concrete code-level fix at the last trusted decision point.
|
|
100
|
+
|
|
101
|
+
**Candidate gate.** A candidate names all six, or it is not a candidate:
|
|
102
|
+
|
|
103
|
+
1. the lower-trust **actor** (anonymous, another user, another tenant, a malicious repo, another local app);
|
|
104
|
+
2. the **input or action** they control;
|
|
105
|
+
3. the **control** that should stop them;
|
|
106
|
+
4. the **boundary** crossed;
|
|
107
|
+
5. the **affected** user, tenant or resource, which is not the actor's own;
|
|
108
|
+
6. the **result**: what they read, change, spend, run or keep.
|
|
109
|
+
|
|
110
|
+
Harm a user can only do to their own account, data or machine with their own authority is not a finding. One root cause reachable through several paths is one candidate, with the strongest path and the others listed; independent missing controls are separate candidates.
|
|
111
|
+
|
|
112
|
+
## Phase 3b — Coverage gap pass
|
|
113
|
+
|
|
114
|
+
Once, before filtering, check the ledger for gaps rather than trusting memory:
|
|
115
|
+
|
|
116
|
+
- entry points in the sources table that no row covered;
|
|
117
|
+
- sibling paths of a traced path (bulk, export, search, jobs, older versions) left unread;
|
|
118
|
+
- derived copies from Lens D that no row checked;
|
|
119
|
+
- a selected audit with no row, or a row closed without paths;
|
|
120
|
+
- earlier findings or needs-validation items (from a prior report or the project's Checklist record) that nothing re-checked.
|
|
121
|
+
|
|
122
|
+
Run the gaps you find, then mark anything still open `not-checked (reason)`. One pass, not a loop. In the fan-out variant a fresh read-only child does this pass.
|
|
84
123
|
|
|
85
124
|
## Phase 4 — False-positive filter
|
|
86
125
|
|
|
87
|
-
Switch sides. For each candidate
|
|
126
|
+
Switch sides. For each candidate, start from "this is a false positive" and try to kill it: re-read the actual code path (not your notes), hunt for the control you missed (middleware, ORM parameterization, framework escaping, a type that makes the path unreachable), re-check every gate field, and check whether the input is genuinely attacker-reachable rather than a constant or operator config. Each candidate ends as one of:
|
|
127
|
+
|
|
128
|
+
- **Keep**: the path survives; severity never exceeds what the path demonstrates.
|
|
129
|
+
- **Drop**: the code refutes it, or an exclusion below applies. Count it.
|
|
130
|
+
- **Downgrade**: real, but weaker than claimed.
|
|
131
|
+
- **Needs validation**: the path is real in the code, but the deciding fact lives outside the repo: a dashboard setting (RLS state, bucket policy), proxy or CDN configuration, provider behaviour, production environment, store or OS policy. It gets no severity and is not counted as a finding. Record the exact missing fact and a safe check the owner can run. Never use it for weak evidence: if the code refutes the path, drop it.
|
|
132
|
+
|
|
133
|
+
Only findings that survive your own attempt to disprove them get reported. In the fan-out variant, or for a pre-ship verdict with Critical/High findings, run this pass as a verifier child (see above) instead of only yourself.
|
|
88
134
|
|
|
89
135
|
**Hard exclusions — do not report these, even when technically real:**
|
|
90
136
|
|
|
91
137
|
- Denial of service, rate limiting, or memory exhaustion without a clear amplification primitive (exception: a missing rate limit on login, signup, password reset, or a paid/LLM endpoint is reportable)
|
|
92
|
-
- Theoretical races with no demonstrable trigger window
|
|
138
|
+
- Theoretical races with no demonstrable trigger window (exception: a check-then-act on money, credits, quotas, coupons, invites or one-time tokens is reportable; parallel requests are free)
|
|
139
|
+
- Self-impact: a user harming only their own account, data or machine with their own authority
|
|
93
140
|
- Regex denial of service where the pattern is not attacker-supplied
|
|
94
141
|
- Log injection or log spoofing (cosmetic)
|
|
95
142
|
- SSRF where the URL is a constant or build-time string
|
|
96
143
|
- Environment-variable trust (the environment is operator-controlled by definition)
|
|
97
144
|
- Client-side validation "bypass" on an endpoint that revalidates server-side
|
|
98
|
-
- Framework-escaped rendering paths
|
|
145
|
+
- Framework-escaped rendering paths: only the explicit unsafe sinks (`dangerouslySetInnerHTML`, `v-html`, `bypassSecurityTrust*`, raw template filters) count
|
|
99
146
|
- Command injection in a shell script with no untrusted input path
|
|
100
147
|
- Findings in documentation, examples, or test fixtures
|
|
101
148
|
- Dev-only tooling that does not ship to users and does not process untrusted repositories
|
|
102
149
|
- Missing hardening headers or "could be improved" preferences with no demonstrated path
|
|
103
|
-
- Secrets that are obviously test fixtures or public sample keys
|
|
150
|
+
- Secrets that are obviously test fixtures or public sample keys (but say you saw them and confirmed they are not live)
|
|
104
151
|
|
|
105
152
|
## Phase 5 — Report
|
|
106
153
|
|
|
@@ -117,6 +164,7 @@ One report. No code edits in this phase.
|
|
|
117
164
|
```
|
|
118
165
|
# Bulletproof Report — [project]
|
|
119
166
|
Date: [today] Scope: [what was reviewed] Not reviewed: [what was not]
|
|
167
|
+
Status: complete | incomplete — [reason]
|
|
120
168
|
|
|
121
169
|
## Exposure summary
|
|
122
170
|
[One paragraph: realistic exposure profile, where untrusted data enters, what an attacker would be after.]
|
|
@@ -140,22 +188,27 @@ Date: [today] Scope: [what was reviewed] Not reviewed: [what was not]
|
|
|
140
188
|
- Location: path:line
|
|
141
189
|
- Category: <slug> CWE: CWE-XXX Confidence: 0.95 Evidence: RUNTIME | CODE | DEDUCED | SNAPSHOT
|
|
142
190
|
- Reachable by: <anonymous internet / authenticated user / other tenant / local user / malicious repo / build system>
|
|
191
|
+
- Boundary: <control that should stop it> → <whose data or resource is affected>
|
|
143
192
|
- Source → Sink: <`POST /api/invoice` `body.id` → `db.query` string concat>
|
|
144
193
|
- Risk scenario (data-flow level, no payloads):
|
|
145
194
|
1. Untrusted input of <shape> reaches <source>
|
|
146
195
|
2. It is processed as <what>, with <no/ineffective> validation at <where>
|
|
147
196
|
3. Result: <what the attacker holds>
|
|
197
|
+
- Also reachable via: <sibling paths with the same root cause, if any>
|
|
148
198
|
- Impact: <blast radius: whose data, how many, what spreads>
|
|
149
199
|
- Fix: <concrete, code-level, at the chokepoint>
|
|
150
200
|
- Verify: <the test or command that proves the fix>
|
|
151
201
|
|
|
152
202
|
[…ordered Critical → High → Medium…]
|
|
153
203
|
|
|
204
|
+
## Needs validation
|
|
205
|
+
[No severity. For each: the claim in plain words, the code path (path:line), the exact fact the repo cannot show, and a safe check the owner can run (a dashboard setting, a header on a real response, a console command).]
|
|
206
|
+
|
|
154
207
|
## What was not flagged
|
|
155
|
-
[Which
|
|
208
|
+
[Which audits returned zero findings, how many candidates the filter dropped and why. Show the work, not only the survivors.]
|
|
156
209
|
|
|
157
210
|
## Not checked
|
|
158
|
-
[
|
|
211
|
+
[Ledger rows not checked, with reasons; surfaces, repos, or components outside this pass.]
|
|
159
212
|
```
|
|
160
213
|
|
|
161
214
|
## Phase 6 — Ask before fixing
|
|
@@ -168,12 +221,12 @@ If a Critical finding involves an exposed live credential, do not wait for the f
|
|
|
168
221
|
|
|
169
222
|
## Standards mapping
|
|
170
223
|
|
|
171
|
-
Cite these in the `Category`/`CWE` fields, not in prose. Re-verified
|
|
224
|
+
Cite these in the `Category`/`CWE` fields, not in prose. Re-verified 27 Nov 2026; re-verify before quoting as current.
|
|
172
225
|
|
|
173
226
|
- **OWASP Top 10:2025** (final) — A01 Broken Access Control (SSRF folded in), A02 Security Misconfiguration, A03 Software Supply Chain Failures, A04 Cryptographic Failures, A05 Injection, A06 Insecure Design, A07 Authentication Failures, A08 Software or Data Integrity Failures, A09 Security Logging & Alerting Failures, A10 Mishandling of Exceptional Conditions. Note the renumbering: A03 is supply chain now, not injection.
|
|
174
227
|
- **CWE Top 25 (2025 edition)**, top ten in order — CWE-79 XSS, CWE-89 SQLi, CWE-352 CSRF, CWE-862 Missing Authorization, CWE-787 Out-of-bounds Write, CWE-22 Path Traversal, CWE-416 Use After Free, CWE-125 Out-of-bounds Read, CWE-78 OS Command Injection, CWE-94 Code Injection.
|
|
175
228
|
- **OWASP API Security Top 10 (2023, still current)** — API1 BOLA, API2 Broken Authentication, API3 BOPLA, API4 Unrestricted Resource Consumption, API5 Broken Function Level Authorization, API6 Unrestricted Access to Sensitive Business Flows, API7 SSRF, API8 Misconfiguration, API9 Improper Inventory Management, API10 Unsafe Consumption of APIs.
|
|
176
229
|
- **OWASP ASVS 5.0.0** (May 2025) — ~350 requirements, cumulative L1/L2/L3. Requirement IDs were renumbered from 4.x; do not cite a 4.x ID as 5.0.
|
|
177
230
|
- **OWASP Top 10 for LLM Applications 2026** — LLM01:2026 Prompt Injection … LLM10:2026 Improper Output Handling (renumbered from 2025; cite IDs with the year).
|
|
178
|
-
- **OWASP Top 10 for Agentic Applications (2026)** — ASI01 Agent Goal Hijack, ASI02 Tool Misuse, ASI03
|
|
231
|
+
- **OWASP Top 10 for Agentic Applications (2026)** — ASI01 Agent Goal Hijack, ASI02 Tool Misuse and Exploitation, ASI03 Identity and Privilege Abuse, ASI04 Agentic Supply Chain Vulnerabilities, ASI05 Unexpected Code Execution, ASI06 Memory and Context Poisoning, ASI07 Insecure Inter-Agent Communication, ASI08 Cascading Failures, ASI09 Human-Agent Trust Exploitation, ASI10 Rogue Agents (exact titles not re-read from OWASP; cite by ID).
|
|
179
232
|
- **OWASP MASVS v2.1.0** — eight categories (STORAGE, CRYPTO, AUTH, NETWORK, PLATFORM, CODE, RESILIENCE, PRIVACY). **There are no L1/L2 levels since v2.0.0**; cite MASTG test IDs instead.
|
|
@@ -35,6 +35,10 @@ The best-understood surface; the failures are still the same three.
|
|
|
35
35
|
| **File upload** | Three independent checks: extension allowlist **and** magic-byte sniff **and** a parse as the claimed type. Random generated names, original discarded; stored outside the web root; served from a separate origin with `Content-Disposition: attachment` and `nosniff`; size caps server-side | Any single check falls to double extensions (`x.php.jpg`), null bytes in names, spoofed `Content-Type`, prepended magic bytes, or polyglot files. SVG is a scriptable XML document — sanitize or refuse it. Archives get zip-slip path checks per entry |
|
|
36
36
|
| **XXE** | Every XML parse of untrusted input has DTDs, external entities, and XInclude disabled at the parser. XML hides in DOCX/XLSX/PPTX (ZIP of XML), SVG, SAML, RSS, SOAP — and in JSON APIs converted to XML server-side | Several stacks still default entity resolution on: Java needs `disallow-doctype-decl`; Python should parse with `defusedxml`; .NET needs `DtdProcessing.Prohibit` and a null resolver |
|
|
37
37
|
| **Rate limits on credential paths** | Login, reset, MFA, token exchange, invite acceptance | These are the endpoints where volume converts directly to account takeover |
|
|
38
|
+
| **Webhooks** | Signature verified on the raw body before any work; a missing signature rejected; timestamp window and event-ID dedupe; the object re-fetched from the provider before granting anything | A webhook that trusts its payload is a public "mark this order paid" endpoint |
|
|
39
|
+
| **Host & forwarded headers** | Links, redirects and "is HTTPS" decisions use a configured origin; `X-Forwarded-*` honoured only from a known proxy hop | Password-reset poisoning: the victim's reset link is built with the attacker's host and mailed to the victim |
|
|
40
|
+
| **Caching of private responses** | Authenticated responses send `Cache-Control: private` or `no-store`; CDN rules bypass the cache on auth cookies or include them in the key; no "cache everything" rule over dynamic paths; framework route caching checked per route | A CDN that caches one user's page serves it to the next; cache deception requests `/account/settings.css` to make a private page look static |
|
|
41
|
+
| **Account linking** | Social or SSO identities link to an existing account only after signing in to it, or by a verified email from a provider trusted for it | Auto-linking on an unverified email lets anyone sign up as the victim |
|
|
38
42
|
| **Errors** | Generic message to the client, detail to the log; no stack traces, SQL text, or env in responses | A10:2025 is new and is exactly this: fail-open and mishandled exceptional conditions |
|
|
39
43
|
|
|
40
44
|
**Backend-as-a-service (Supabase / Firebase / PocketBase and similar) — the highest-yield indie failure** (CVE-2025-48757: 170+ generated apps shipped Supabase tables without RLS) [S]:
|
|
@@ -80,7 +84,7 @@ Standards [V]: **MASVS v2.1.0** (8 categories, no L1/L2 levels since v2.0.0) and
|
|
|
80
84
|
| **Backup / pasteboard** | `android:allowBackup`, `dataExtractionRules`; `UIPasteboard.general` for tokens | Auto Backup exfiltrates tokens off-device by default |
|
|
81
85
|
| **Client-side gating** | Any entitlement, price, or role decided in the app | Re-decide server-side. The client binary is attacker-owned |
|
|
82
86
|
|
|
83
|
-
**Store gates** [S]: Apple requires `PrivacyInfo.xcprivacy` privacy manifests with required-reason API declarations and signed binary dependencies for listed SDKs (rejection codes in the `ITMS-9105x` family). Google Play
|
|
87
|
+
**Store gates** [S]: Apple requires `PrivacyInfo.xcprivacy` privacy manifests with required-reason API declarations and signed binary dependencies for listed SDKs (rejection codes in the `ITMS-9105x` family). Google Play requires new apps and updates to target Android 16 (API level 36) since 31 Aug 2026; the extension window ended 1 Nov 2026 [V]. Data-safety declarations must match real SDK behavior.
|
|
84
88
|
|
|
85
89
|
---
|
|
86
90
|
|
|
@@ -105,9 +109,12 @@ Standards [V]: **MASVS v2.1.0** (8 categories, no L1/L2 levels since v2.0.0) and
|
|
|
105
109
|
|---|---|---|
|
|
106
110
|
| **Loopback HTTP servers** | Bind `127.0.0.1` explicitly (never `0.0.0.0`), require a per-launch bearer token, validate `Origin` and `Host` | Any local process — and, via DNS rebinding, any web page the user visits — can reach an unauthenticated loopback port |
|
|
107
111
|
| **Local IPC** | Unix socket at `0700` with peer-credential checks; Windows named pipe with an explicit DACL and `PIPE_REJECT_REMOTE_CLIENTS` | Default pipe ACLs are broader than you expect |
|
|
112
|
+
| **Caller identity** | Authorize each IPC or loopback call from the channel's identity (peer credentials, per-launch token), never from a user, profile or account field in the request | An authenticated caller asks for another user's or profile's data and gets it |
|
|
113
|
+
| **Privileged helpers** | A helper running as root or admin allowlists its operations and re-validates every argument on every call; no caller-chosen command or path | A confused deputy runs whatever the unprivileged app, or anything impersonating it, asks |
|
|
114
|
+
| **Logout & account switch** | Tokens, caches, webview storage and pending actions are cleared on logout and on switching accounts | The next account sees, or acts as, the previous one |
|
|
108
115
|
| **Deep links** | Custom schemes are first-come-first-served (Windows) or last-registered-wins (macOS); any app can claim yours | Never treat a deep-link parameter as authenticated; bind auth codes to a state/nonce you generated |
|
|
109
116
|
| **Updater** | Verify the signature **before** unpacking; pin the public key in the binary; include version and target in the signed payload | Rollback and cross-target swaps are the bugs left after signing is added. Design key rotation before you need it |
|
|
110
|
-
| **Signing** | macOS: Developer ID, `--options runtime`, `--timestamp`, `notarytool`, then `stapler staple` so offline machines verify. Every nested binary and sidecar signed individually |
|
|
117
|
+
| **Signing** | macOS: Developer ID, `--options runtime`, `--timestamp`, `notarytool`, then `stapler staple` so offline machines verify. Every nested binary and sidecar signed individually | Developer ID certificates from the current (G2) authority last one year, and certificates from the original authority stop signing on 1 Feb 2027 [V]. Publicly trusted code-signing certificates (Windows) are capped at 460 days under CA/B ballot CSC-31 [V] (from 1 Mar 2026 [S]), with keys in certified hardware. Build rotation into the release pipeline and always timestamp |
|
|
111
118
|
|
|
112
119
|
---
|
|
113
120
|
|
|
@@ -129,7 +136,7 @@ The distinguishing risk: **these programs open repositories, files, and projects
|
|
|
129
136
|
|
|
130
137
|
## Embedded, IoT & firmware
|
|
131
138
|
|
|
132
|
-
**Regulatory dates that drive engineering** [V]: the EU Cyber Resilience Act is in force since 10 Dec 2024 and fully applicable 11 Dec 2027, with **Article 14 reporting obligations starting 11 September 2026** — early warning within 24 hours, full notification within 72 hours, final report within 14 days once a fix exists. Two traps: only *actively exploited* vulnerabilities trigger reporting, and it applies to products already on the market, so shipping date is irrelevant. UK PSTI has been enforced since Apr 2024 — unique or user-set passwords, a disclosure programme, and a published support period. The US Cyber Trust Mark
|
|
139
|
+
**Regulatory dates that drive engineering** [V]: the EU Cyber Resilience Act is in force since 10 Dec 2024 and fully applicable 11 Dec 2027, with **Article 14 reporting obligations starting 11 September 2026** — early warning within 24 hours, full notification within 72 hours, final report within 14 days once a fix exists. Two traps: only *actively exploited* vulnerabilities trigger reporting, and it applies to products already on the market, so shipping date is irrelevant. UK PSTI has been enforced since Apr 2024 — unique or user-set passwords, a disclosure programme, and a published support period. The US Cyber Trust Mark is still voluntary and not yet operating; the FCC was still taking comment on its labeling rules in Oct 2026 [S]. Do not plan around it as a market gate.
|
|
133
140
|
|
|
134
141
|
**Device controls:** hardware root of trust with secure boot and anti-rollback counters; OTA images signed and verified **before** flashing to an inactive slot, with A/B plus watchdog rollback; JTAG/SWD fused off and UART consoles disabled in production builds (grep build configs for debug flags and fuse-burn steps); no shared per-fleet keys — per-device identity or a compromise is fleet-wide; an SBOM generated in CI per firmware version and retained, because you cannot answer "which units are affected" in 24 hours without one.
|
|
135
142
|
|
|
@@ -141,7 +148,7 @@ The distinguishing risk: **these programs open repositories, files, and projects
|
|
|
141
148
|
|
|
142
149
|
Grep priorities in this order: privileged setters without timelock and multisig; `onlyOwner` on collateral, oracle, or fee parameters; unbounded proxy `upgradeTo`; uninitialized implementations and missing `initializer`; spot prices read from `getReserves`/`slot0` used as an oracle; `ecrecover` without nonce, deadline, and chain ID (use EIP-712); cross-chain message verification that trusts a sender field; and reentrancy on external calls before state writes.
|
|
143
150
|
|
|
144
|
-
**Compiler** [V]: current is **0.8.
|
|
151
|
+
**Compiler** [V]: current is **0.8.39** (19 Nov 2026). Every release since 0.8.37 (Sep 2026) fixed a security bug: 0.8.39 a storage corruption when copying recursive structs, 0.8.38 stale Yul-optimizer knowledge that could drop needed stores, 0.8.37 memory-slot reuse under stack-too-deep workarounds. Earlier, 0.8.34 (Feb 2026) fixed a high-severity storage-clearing bug in the IR pipeline. Since 0.8.31 the default EVM target moved, so **pin `evmVersion` explicitly** or a compiler bump silently retargets your chain. 0.9.0-pre.1 (26 Nov 2026) removes ABI coder v1 and virtual modifiers and drops pre-Byzantium EVM targets; `send`/`transfer` on `address` are deprecated too. Plan the migration before 0.9.0 is final.
|
|
145
152
|
|
|
146
153
|
**CI gates:** Slither failing on high/medium, Foundry invariant and fuzz suites with bounded handlers (property tests catch the economic bugs unit tests miss), Echidna, and storage-layout diffing on every upgradeable deploy.
|
|
147
154
|
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
- Re-verified 3 October 2026
|
|
6
6
|
- Re-verified 22 October 2026
|
|
7
7
|
- Re-verified 22 November 2026
|
|
8
|
+
- Re-verified 27 November 2026
|
|
9
|
+
- Methodology update 27 November 2026
|
|
8
10
|
- Source classes
|
|
9
11
|
- Known gaps in this snapshot
|
|
10
12
|
- What this skill is not
|
|
@@ -78,7 +80,40 @@ Changed this pass: `threat-landscape.md` rewritten as technique + fingerprint (c
|
|
|
78
80
|
| MCP: no spec revision after 2026-07-28 | [V] | blog.modelcontextprotocol.io |
|
|
79
81
|
| CWE Top 25 2025 still the latest; CWE 5.0 (28 Oct 2026) deprecates CWE-377/391/613, none cited here | [V] | cwe.mitre.org/news/archives/news2026.html |
|
|
80
82
|
|
|
81
|
-
Not added, unverified: React Server Components CVE-2026-126187 (date disputed, React advisory not reached); GitHub secret scanning of Actions logs and Agentic Workflows GA (changelog bodies not read); the OWASP Agent Control Standard (not read). No supply-chain incident from 22 Oct to 22 Nov 2026 could be confirmed from a primary source: that is "no hits", not "none happened".
|
|
83
|
+
Not added, unverified: React Server Components CVE-2026-126187 (date disputed, React advisory not reached; resolved 27 Nov, below); GitHub secret scanning of Actions logs and Agentic Workflows GA (changelog bodies not read); the OWASP Agent Control Standard (not read). No supply-chain incident from 22 Oct to 22 Nov 2026 could be confirmed from a primary source: that is "no hits", not "none happened".
|
|
84
|
+
|
|
85
|
+
## Re-verified 27 November 2026
|
|
86
|
+
|
|
87
|
+
Unchanged and re-confirmed: MCP 2026-07-28 still current; OAuth 2.1 draft -17; RFC 9700; OWASP Top 10:2025, LLM Top 10 2026, API Top 10 2023, ASVS 5.0.0, MASVS 2.1.0 / MASTG 2.0.0; CWE Top 25 2025; NIST SP 800-63B-4; Node.js 11 Nov and Next.js 3 Nov releases still the latest security releases; npm 12 script blocking, staged publishing, 48-hour trusted-publishing expiry; GitGuardian 2026 figures; OpenSSL 3.5 and Firefox hybrid PQ defaults; CRA dates; UK PSTI; Electron fuse names.
|
|
88
|
+
|
|
89
|
+
| Claim | Marker | Primary source |
|
|
90
|
+
|---|---|---|
|
|
91
|
+
| React RSC CVE-2026-126187 (GHSA-xqc2-xf4c-x3h3), published 14 Oct 2026, fixed in 19.0.9 / 19.1.10 / 19.2.9 / 19.3.1 | [V] | github.com/advisories/GHSA-xqc2-xf4c-x3h3 |
|
|
92
|
+
| Solidity 0.8.39 (19 Nov 2026) current; 0.8.37–0.8.39 security fixes; 0.9.0-pre.1 (26 Nov 2026) | [V] | github.com/argotorg/solidity/releases |
|
|
93
|
+
| Granular-token direct publishing removed January 2027 (was [U]) | [V] | docs.npmjs.com/about-access-tokens |
|
|
94
|
+
| npm refuses trusted publishing from `issue_comment`; `strict-allow-scripts` (were [S]) | [V] | docs.npmjs.com/trusted-publishers; npm CLI config definitions |
|
|
95
|
+
| `pull_request_target` default policy: public repos without their own event policy, enforced 2 Dec 2026; read-only default-branch cache unless `cache-mode` opts out | [V] | docs.github.com/en/actions/reference/security/securely-using-pull_request_target |
|
|
96
|
+
| `actions/checkout` backports shipped 20 Jul 2026 (not 16 Jul); opt-out `allow-unsafe-pr-checkout` | [V] | github.com/actions/checkout/releases |
|
|
97
|
+
| ChainDrop hooks pushed as GitHub-signed `github-actions[bot]` commits (previous author detail not supported by the source) | [V] | securitylabs.datadoghq.com (5 Aug 2026) |
|
|
98
|
+
| Apple Developer ID G2 certificates last one year; original authority expires 1 Feb 2027; the 460-day cap is the CA/B code-signing rule (CSC-31), not Apple's | [V] | developer.apple.com/help/account/certificates; cabforum.org ballot CSC-31 |
|
|
99
|
+
| Google Play: target API 36 since 31 Aug 2026, extensions to 1 Nov 2026 | [V] | support.google.com/googleplay/android-developer/answer/11926878 |
|
|
100
|
+
| Apple OS 26 system TLS advertises X25519MLKEM768 | [V] | support.apple.com/en-us/122756 |
|
|
101
|
+
| "The Attacker Moves Second": the "human red-teamers beat every scenario" wording is not in the abstract; rewritten to what the abstract states | [V] | arxiv.org/abs/2510.09023 |
|
|
102
|
+
| MCP: binding local servers to 127.0.0.1 is a SHOULD, not a MUST | [V] | modelcontextprotocol.io/specification/2026-07-28/basic/transports/streamable-http |
|
|
103
|
+
| OWASP Agentic Top 10 titles: two files disagreed; aligned to the commonly cited titles | [S] | official page not readable this pass; cite by ASI ID |
|
|
104
|
+
| US Cyber Trust Mark: FCC sought comment on labeling rules in Oct 2026 | [S] | FCC DA-26-834A1; Oct notice via secondary reporting |
|
|
105
|
+
|
|
106
|
+
Not added: a Vite advisory (GHSA-p4f5-76q4-ffq7) reported by search could not be opened; Django, Rails and Electron advisories from Oct–Nov 2026 are routine patch releases, covered by the "patch latency" rule. No supply-chain or AI-agent incident from 22 to 27 Nov 2026 could be confirmed from a primary source: "no hits", not "none happened".
|
|
107
|
+
|
|
108
|
+
## Methodology update 27 November 2026
|
|
109
|
+
|
|
110
|
+
This section changed no dated facts (those are logged above). The review method was compared with Cloudflare's open-source `security-audit` skill (github.com/cloudflare/security-audit-skill, MIT License, © 2025–2026 Cloudflare, Inc.), and these ideas were adapted, in new wording, for small teams and a single agent:
|
|
111
|
+
|
|
112
|
+
- `attack-classes.md`: one section per audit in a fixed shape, pasted verbatim into child briefs; new audits for data lifecycle and derived copies, business logic and races, webhooks, the HTTP edge and caching, and denial of wallet.
|
|
113
|
+
- `audit-protocol.md`: the six-field candidate gate, the self-impact exclusion, hunting depth (sibling paths, edge inputs), the needs-validation outcome, one coverage gap pass, root-cause merging, safe execution limits for code the user did not write, and the rule that a review ends complete or explicitly incomplete.
|
|
114
|
+
- Controls for webhooks, account linking, reset-link host poisoning, private-response caching, IPC caller identity, privileged helpers and logout cleanup in `secure-defaults.md` and `platform-playbooks.md`.
|
|
115
|
+
|
|
116
|
+
Not adopted: its multi-agent hunting waves, budget accounting, JSON schema and validators, and the descriptor-level artifact promotion procedure. They suit a security team's fleet, not a single-agent review.
|
|
82
117
|
|
|
83
118
|
## Source classes
|
|
84
119
|
|
|
@@ -9,6 +9,7 @@ Snapshot 3 October 2026. **[V]** verified, **[S]** snapshot-volatile, **[U]** un
|
|
|
9
9
|
- Secrets
|
|
10
10
|
- Authentication
|
|
11
11
|
- Authorization
|
|
12
|
+
- Money, quotas & webhooks
|
|
12
13
|
- Cryptography
|
|
13
14
|
- Input handling
|
|
14
15
|
- Web response headers
|
|
@@ -45,6 +46,9 @@ Implementation:
|
|
|
45
46
|
- Session tokens from a CSPRNG, ≥128 bits. Rotate the session identifier on login and on privilege change. Server-side revocation must exist — a stateless token you cannot revoke is an outage during an incident.
|
|
46
47
|
- Constant-time comparison for tokens, signatures, and MFA codes — but **validate the shape before you compare**. A stored credential whose hex/base64 decodes to the wrong length, or whose scheme/salt/hash does not parse, must be rejected as malformed and fail closed; never fall through to the comparison. `timingSafeEqual` on two empty buffers returns true, so an unparsed record can verify any password.
|
|
47
48
|
- Rate-limit and lock out on login, reset, MFA, and token exchange. Generic failure messages: never reveal whether the account exists.
|
|
49
|
+
- **Account linking:** attach a social or SSO identity to an existing account only after the user signs in to that account, or when both emails are verified and the provider is trusted for that address. Never link by matching an unverified email; that is account takeover with one sign-up.
|
|
50
|
+
- **Reset and magic links:** build the URL from a configured origin, never from the request's `Host` or `X-Forwarded-Host`. Tokens are single-use, short-lived (an hour at most), stored hashed, and voided by a password change or a newer token.
|
|
51
|
+
- **Sensitive account changes** (email, password, MFA, passkeys, recovery codes, API keys) require recent re-authentication and notify the old address.
|
|
48
52
|
- **JWTs, when used:** pin the verification algorithm from your own config — never read `alg` from the token header, reject `none`. HMAC secrets ≥256 bits from a CSPRNG, never a passphrase. Always set and validate `exp` (minutes, not days) and include `jti` so revocation is possible. In a browser, the token lives in an `HttpOnly`/`Secure`/`SameSite` cookie — localStorage is readable by any XSS. Rotate refresh tokens on use; a reused refresh token means theft — revoke the whole family.
|
|
49
53
|
|
|
50
54
|
## Authorization
|
|
@@ -57,8 +61,20 @@ Implementation:
|
|
|
57
61
|
- **Removal is revocation.** Leaving an org, a role downgrade, or account deletion must invalidate that user's sessions, refresh tokens, and API keys immediately — not at next login.
|
|
58
62
|
- Return the same 404 for "does not exist" and "not yours" — a 403 confirms the resource exists and invites enumeration. Non-guessable IDs (UUIDv4) are defense-in-depth on top; authorization is still the control.
|
|
59
63
|
- Check the **parent chain**: accessing a comment means verifying ownership of the post it belongs to, not just that the comment ID resolves.
|
|
64
|
+
- **Derived copies inherit the rule.** Search indexes, exports, reports, caches, analytics, notifications and model context apply the same owner or tenant filter as the main read, and soft-deleted rows are excluded everywhere.
|
|
60
65
|
- Test it: the cross-user access test (user B requests user A's resource, expect 403/404) is the highest-value security test a small team can write.
|
|
61
66
|
|
|
67
|
+
## Money, quotas & webhooks
|
|
68
|
+
|
|
69
|
+
Where a bug turns directly into money, these are the defaults:
|
|
70
|
+
|
|
71
|
+
- **The server sets the price.** Price, plan, currency and discount come from the server's catalog; the client sends an ID and a quantity, validated as a positive integer under a limit.
|
|
72
|
+
- **Spend atomically.** Redeem, spend and claim with one conditional write (`UPDATE … SET balance = balance - :n WHERE id = :id AND balance >= :n`, then check the affected row count), a row lock, or a unique constraint on the one-time item. Never read, check, then write in application code.
|
|
73
|
+
- **Idempotency keys** on every request that charges, grants or sends, and on outgoing calls to the payment provider.
|
|
74
|
+
- **Entitlements come from the provider,** via a verified event or an API call, stored server-side. A success redirect or a client flag grants nothing.
|
|
75
|
+
- **Webhooks:** verify the signature over the raw request body with the provider's library (or HMAC plus a constant-time compare); reject a missing signature; enforce the timestamp tolerance; dedupe by event ID; re-fetch the object from the provider before granting anything that matters; use a separate secret per environment.
|
|
76
|
+
- **Multi-step flows** keep their state server-side and allow only valid transitions. On partial failure, roll back or compensate.
|
|
77
|
+
|
|
62
78
|
## Cryptography
|
|
63
79
|
|
|
64
80
|
Do not invent constructions. Use a vetted library's high-level API.
|
|
@@ -74,7 +90,7 @@ Do not invent constructions. Use a vetted library's high-level API.
|
|
|
74
90
|
| Transport | TLS 1.3, HSTS with a long max-age | TLS 1.0/1.1 gone; 1.2 only for legacy peers |
|
|
75
91
|
| Tokens | Short-lived, audience-bound, revocable | Reject `alg: none`; pin the expected algorithm |
|
|
76
92
|
|
|
77
|
-
**Post-quantum** [V]: FIPS 203 (ML-KEM), 204 (ML-DSA) and 205 (SLH-DSA) were finalised Aug 2024. Hybrid key exchange `X25519MLKEM768` is on by default in Chrome and Firefox [V] (Safari
|
|
93
|
+
**Post-quantum** [V]: FIPS 203 (ML-KEM), 204 (ML-DSA) and 205 (SLH-DSA) were finalised Aug 2024. Hybrid key exchange `X25519MLKEM768` is on by default in Chrome and Firefox [V], and advertised by default in system TLS on iOS, iPadOS, macOS and visionOS 26 [V] (Safari specifically [S]); it is also the default TLS 1.3 group in **OpenSSL 3.5+** [V]. Certificates remain classical; only key exchange is PQ-protected. What a small team does: (1) if a CDN/PaaS terminates TLS, nothing — check it negotiates the hybrid; (2) if you run nginx/Apache/HAProxy yourself, run TLS 1.3 on OpenSSL 3.5+ and **delete or update any pinned curve list** (`ssl_ecdh_curve`, `Groups`) that omits `X25519MLKEM768`, which silently disables it; (3) don't touch PQ signatures or hand-roll PQC; (4) treat harvest-now-decrypt-later as material only for data that must stay secret for 10+ years.
|
|
78
94
|
|
|
79
95
|
## Input handling
|
|
80
96
|
|
|
@@ -19,7 +19,7 @@ Before adding any package — and **especially** one you or a model produced fro
|
|
|
19
19
|
|
|
20
20
|
`preinstall`/`postinstall` scripts run arbitrary code with full developer privileges before anything is reviewed, with access to your registry tokens, cloud credentials, source, and filesystem [V]. This is the mechanism behind the worm lineage.
|
|
21
21
|
|
|
22
|
-
- **npm ≥ 12** (8 Jul 2026) [V] blocks dependency `preinstall`/`install`/`postinstall`, implicit `node-gyp` builds, and git/remote-URL dependencies by default; approve per package in `allowScripts`. A blocked script only **warns and exits 0** — add `strict-allow-scripts=true` [
|
|
22
|
+
- **npm ≥ 12** (8 Jul 2026) [V] blocks dependency `preinstall`/`install`/`postinstall`, implicit `node-gyp` builds, and git/remote-URL dependencies by default; approve per package in `allowScripts`. A blocked script only **warns and exits 0** — add `strict-allow-scripts=true` [V] so CI fails loudly.
|
|
23
23
|
- **pnpm ≥ 10** blocks dependency scripts by default; allowlist builders explicitly. On older npm: `ignore-scripts=true` plus manual builds.
|
|
24
24
|
- Review every change to the script allowlist like a code change.
|
|
25
25
|
- In CI, install with a frozen lockfile (`npm ci`, `pnpm install --frozen-lockfile`) in a job with no cloud credentials and no `id-token: write`.
|
|
@@ -28,10 +28,10 @@ Before adding any package — and **especially** one you or a model produced fro
|
|
|
28
28
|
|
|
29
29
|
If others install your code, you are their supply chain.
|
|
30
30
|
|
|
31
|
-
- **npm state of play** [V]: classic tokens were permanently revoked on 9 Dec 2025; `npm login` now yields 2-hour session tokens; granular write tokens enforce 2FA by default (Bypass-2FA is opt-in) and are capped at 90 days.
|
|
31
|
+
- **npm state of play** [V]: classic tokens were permanently revoked on 9 Dec 2025; `npm login` now yields 2-hour session tokens; granular write tokens enforce 2FA by default (Bypass-2FA is opt-in) and are capped at 90 days. Direct publishing with granular tokens is removed in January 2027 [V]: move CI to a stage-only token or trusted publishing now.
|
|
32
32
|
- **Trusted publishing (OIDC) instead of stored tokens.** A token in CI is the exact asset every worm enumerates. But OIDC alone did not stop TanStack or ChainDrop: put `id-token: write` only on the publish job, never in a job that runs PR code or restores a cache a PR could have written.
|
|
33
33
|
- **Staged publishing** (GA 22 May 2026, npm CLI ≥ 11.15.0) [V]: CI uploads to a stage queue and a maintainer approves with 2FA; since Sep 2026 approval waits for npm's malware scan; since 2 Oct 2026 it also covers creating brand-new packages [V]. For a solo maintainer, this is the single best publish control — a stolen CI identity can stage but not release.
|
|
34
|
-
- **Bind trust to immutable IDs.** Until its first publish, an npm trusted-publishing config matched the repo by renameable `owner/repo` name, so whoever claimed a freed name could publish ("SlugFest", disclosed 13 Oct 2026) [S]. Since 2 Oct 2026 unvalidated configs expire after 48 hours [V] and npm refuses trusted-publishing tokens from `issue_comment` workflows as well as `pull_request_target` [
|
|
34
|
+
- **Bind trust to immutable IDs.** Until its first publish, an npm trusted-publishing config matched the repo by renameable `owner/repo` name, so whoever claimed a freed name could publish ("SlugFest", disclosed 13 Oct 2026) [S]. Since 2 Oct 2026 unvalidated configs expire after 48 hours [V] and npm refuses trusted-publishing tokens from `issue_comment` workflows as well as `pull_request_target` [V]. Publish once right after creating a binding, recreate bindings after any rename or transfer, and apply the same rule to your own authorization code: key on IDs, not names.
|
|
35
35
|
- 2FA on the registry and source-control accounts, phishing-resistant (passkey/security key) where possible.
|
|
36
36
|
- Generate provenance/attestations — but **provenance proves where an artifact was built, not that the build was honest.** ChainDrop (Aug 2026) and the `tensorlake@0.5.144` worm (8 Oct 2026, GHSA-rqxj-g25x-4v9v [V], via a preinstall hook) both shipped valid provenance [S].
|
|
37
37
|
- Verify what is in the tarball before it ships: `npm pack --dry-run` or equivalent. Ship no source maps, no `.env`, no test fixtures, no internal docs. A source-map leak has already exposed a major product's source [S].
|
|
@@ -46,7 +46,7 @@ The highest-value target, because CI holds every credential at once — 59% of m
|
|
|
46
46
|
| **Pin actions by SHA** | `uses: org/action@<40-char-sha>`. A version tag is mutable: the 2025 `tj-actions/changed-files` compromise retroactively repointed its tags at malicious code [S] |
|
|
47
47
|
| **Least-privilege token** | An explicit `permissions:` block, default `contents: read`, elevated only in the job that needs it |
|
|
48
48
|
| **Enforce pinning** | Repo/org setting: Actions policy → require full-SHA pins (fails unpinned workflows; available since Aug 2025) [V]. Let Dependabot bump the SHAs |
|
|
49
|
-
| **`pull_request_target` / `workflow_run`** | Avoid them. These run with the base repo's token
|
|
49
|
+
| **`pull_request_target` / `workflow_run`** | Avoid them. These run with the base repo's token and secrets [V]; `pull_request_target` gets read-only access to the default branch's cache unless the workflow declares a write-capable `cache-mode`, which reopens cache poisoning [V]. Since 8 Dec 2025 the workflow always comes from the default branch [V], and current `actions/checkout` refuses fork-PR head refs under `pull_request_target` unless `allow-unsafe-pr-checkout: true` is set (v7; backported 20 Jul 2026 as v6.1.0, v5.1.0 and older majors — **SHA- or patch-pinned checkouts must be bumped to get it**) [V]. Never check out or run PR code there. From 2 Dec 2026 GitHub enforces a default policy blocking `pull_request_target` in public repositories that have no Actions event policy of their own; private and internal repos are not affected, and an event policy can re-allow specific workflows [V]: treat any re-allow as a reviewed security decision, not a fix for a broken workflow |
|
|
50
50
|
| **Cache poisoning** | Any job that runs untrusted code must not save caches the release job restores; key release caches separately or skip caching in release. This was TanStack's initial access [V] |
|
|
51
51
|
| **OIDC scope** | `id-token: write` only on the deploy/publish job; cloud trust policies pinned to repo + branch/environment, not just the org |
|
|
52
52
|
| **Script injection** | Never interpolate `${{ github.event.* }}` (titles, branch names, comment bodies) directly into a `run:` block. Pass through `env:` and quote |
|
|
@@ -60,7 +60,7 @@ The highest-value target, because CI holds every credential at once — 59% of m
|
|
|
60
60
|
- **MCP servers**: the first in-the-wild malicious server, `postmark-mcp`, cloned the official server under the same npm name and added a silent BCC in its 16th release [V]. Install from the official registry with signing and verification where possible; pin versions; review the tool list after every update. See `agent-surface.md`.
|
|
61
61
|
- **Container base images**: pin by digest, scan, prefer minimal or distroless, rebuild regularly rather than pinning to a stale digest forever.
|
|
62
62
|
- **Model artifacts**: signed and verified at load, code-capable formats rejected, dataset revisions pinned by hash. See the ML section of `platform-playbooks.md`.
|
|
63
|
-
- **Opening an untrusted repository is itself an install.** Before opening one in an editor or an agent, check `.vscode/tasks.json` for `runOn: folderOpen`, agent hook configuration (`.claude/settings.json` hooks and equivalents), `.git/config` for `core.fsmonitor` and `core.pager`, and any install script. ChainDrop persisted through exactly these,
|
|
63
|
+
- **Opening an untrusted repository is itself an install.** Before opening one in an editor or an agent, check `.vscode/tasks.json` for `runOn: folderOpen`, agent hook configuration (`.claude/settings.json` hooks and equivalents), `.git/config` for `core.fsmonitor` and `core.pager`, and any install script. ChainDrop persisted through exactly these, pushed to `main`, release and older version branches as GitHub-signed `github-actions[bot]` commits [V] — `git log --all -- .claude/settings.json .vscode/tasks.json` on your own repos after any suspected token theft.
|
|
64
64
|
|
|
65
65
|
## Keeping it current
|
|
66
66
|
|
|
@@ -68,6 +68,7 @@ The highest-value target, because CI holds every credential at once — 59% of m
|
|
|
68
68
|
- Track a real SBOM (CycloneDX or SPDX) generated in CI per release. It is a regulatory obligation for some products [V], and independently it is the only way to answer "are we affected" in hours instead of days.
|
|
69
69
|
- **The controllable variable is your patch latency**, not the attacker's speed.
|
|
70
70
|
- **Run a currently patched runtime line.** Node ships security releases several times a year (21 Oct 2026: a Brotli decoder out-of-bounds write and a TLS hostname-check bypass; 11 Nov 2026: an HTTPS re-entrancy read that can leak TLS private keys, plus HTTP/2 remote crashes, fixed in 22.23.5 / 24.22.3 / 26.13.1) [V]; stay on a supported line and take its patch releases, rather than pinning a remembered version.
|
|
71
|
+
- **React Server Components:** CVE-2026-126187 (GHSA-xqc2-xf4c-x3h3, published 14 Oct 2026) is an unauthenticated RCE in `react-server-dom-webpack`/`-parcel`/`-turbopack`, fixed in 19.0.9, 19.1.10, 19.2.9 and 19.3.1 [V]. Any app using a framework with RSC needs the patched package, not only a framework bump; check the lockfile.
|
|
71
72
|
- **After a framework upgrade, check its transitive native dependencies.** Next.js's 14 Oct 2026 advisories included unauthenticated RCE through SVG handling in image optimization and `next/og` (native `sharp`/librsvg) [V]: the framework version was the fix, but the reachable code was a native image library. List native deps (`npm ls sharp`, lockfile) and confirm they moved too.
|
|
72
73
|
- Subscribe to advisories for your actual stack. For a small team, three feeds you read beats thirty you filter.
|
|
73
74
|
|
|
@@ -22,7 +22,14 @@ For a small team, four tests cover most real risk. Write these instead of a larg
|
|
|
22
22
|
3. **Role boundary.** A normal user hits every admin route; expect denial.
|
|
23
23
|
4. **The fix regression test.** For each finding fixed, a test that fails against the old code. If it passes both ways, you did not test the fix.
|
|
24
24
|
|
|
25
|
-
Then, where the surface justifies it:
|
|
25
|
+
Then, where the surface justifies it:
|
|
26
|
+
|
|
27
|
+
- **Concurrent redemption:** send the same coupon, credit spend or invite acceptance many times in parallel; exactly one succeeds.
|
|
28
|
+
- **Webhook rejection:** unsigned, wrongly signed and replayed events are rejected with no side effect.
|
|
29
|
+
- **Revocation:** remove a member or change a password, then reuse the old session, refresh token and API key; all are denied.
|
|
30
|
+
- **Derived copies:** as user B, search, export and count; none of user A's records appear.
|
|
31
|
+
|
|
32
|
+
Beyond those: property or fuzz tests over parsers and deserializers, invariant tests for financial and contract logic, and a test that the failure path denies (kill the auth dependency, expect denial, not a pass-through).
|
|
26
33
|
|
|
27
34
|
## Free tooling by job
|
|
28
35
|
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import http from "node:http";
|
|
2
2
|
import type { SessionContext } from "../session-types.js";
|
|
3
3
|
export declare const LIVE_HEADER = "x-gg-live";
|
|
4
|
+
/** Which browser tab the frame is in: each tab chats with its own session. */
|
|
5
|
+
export declare const TAB_HEADER = "x-gg-live-tab";
|
|
6
|
+
/** One tab's chat: its session and what that session said before the tab connected. */
|
|
7
|
+
export interface FrameTab {
|
|
8
|
+
session: SessionContext;
|
|
9
|
+
replay: readonly string[];
|
|
10
|
+
/** An event stream opened; call the result when it closes. */
|
|
11
|
+
watch: () => () => void;
|
|
12
|
+
}
|
|
4
13
|
export interface FrameConfig {
|
|
5
14
|
/** The dev server the agent is told about (not the proxy). */
|
|
6
15
|
devUrl: string;
|
|
@@ -9,10 +18,12 @@ export interface FrameConfig {
|
|
|
9
18
|
}
|
|
10
19
|
export interface FrameServerOptions {
|
|
11
20
|
assetsDir: string;
|
|
12
|
-
|
|
21
|
+
/** The tab's chat, started on its first request; an error to send when there can't be one. */
|
|
22
|
+
tab: (id: string) => Promise<FrameTab | {
|
|
23
|
+
status: number;
|
|
24
|
+
error: string;
|
|
25
|
+
}>;
|
|
13
26
|
config: () => FrameConfig;
|
|
14
|
-
/** SSE frames broadcast so far, so a reloaded page rebuilds its transcript. */
|
|
15
|
-
replay: () => readonly string[];
|
|
16
27
|
usage: (provider: "anthropic" | "moonshot") => Promise<unknown>;
|
|
17
28
|
}
|
|
18
29
|
export interface FrameServer {
|