project-brain 0.24.0 → 0.26.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 +1 -1
- package/package.json +6 -6
- package/templates/project.claude.md +1 -1
- package/templates/skills/brain-audit/SKILL.md +17 -7
- package/templates/skills/brain-audit/references/abuse.md +36 -11
- package/templates/skills/brain-audit/references/accessibility.md +50 -22
- package/templates/skills/brain-audit/references/ai.md +39 -15
- package/templates/skills/brain-audit/references/analytics.md +34 -11
- package/templates/skills/brain-audit/references/api.md +38 -13
- package/templates/skills/brain-audit/references/backend.md +41 -9
- package/templates/skills/brain-audit/references/browser.md +146 -0
- package/templates/skills/brain-audit/references/complexity.md +22 -12
- package/templates/skills/brain-audit/references/concurrency.md +36 -18
- package/templates/skills/brain-audit/references/consistency.md +32 -9
- package/templates/skills/brain-audit/references/contract-drift.md +34 -16
- package/templates/skills/brain-audit/references/cost.md +45 -23
- package/templates/skills/brain-audit/references/cross-surface-parity.md +38 -11
- package/templates/skills/brain-audit/references/database.md +43 -17
- package/templates/skills/brain-audit/references/dependencies-licensing.md +27 -12
- package/templates/skills/brain-audit/references/design-system.md +40 -17
- package/templates/skills/brain-audit/references/devops.md +32 -17
- package/templates/skills/brain-audit/references/documentation.md +38 -16
- package/templates/skills/brain-audit/references/failure.md +40 -18
- package/templates/skills/brain-audit/references/feature-flags.md +31 -15
- package/templates/skills/brain-audit/references/flow-integrity.md +42 -10
- package/templates/skills/brain-audit/references/frontend.md +40 -12
- package/templates/skills/brain-audit/references/functional.md +31 -11
- package/templates/skills/brain-audit/references/future.md +28 -7
- package/templates/skills/brain-audit/references/goal.md +15 -6
- package/templates/skills/brain-audit/references/i18n.md +30 -8
- package/templates/skills/brain-audit/references/idempotency.md +46 -24
- package/templates/skills/brain-audit/references/infrastructure.md +43 -13
- package/templates/skills/brain-audit/references/mobile.md +37 -15
- package/templates/skills/brain-audit/references/multi-tenancy.md +41 -12
- package/templates/skills/brain-audit/references/numeric.md +33 -16
- package/templates/skills/brain-audit/references/observability.md +43 -19
- package/templates/skills/brain-audit/references/packaging.md +39 -13
- package/templates/skills/brain-audit/references/performance.md +43 -13
- package/templates/skills/brain-audit/references/privacy.md +38 -15
- package/templates/skills/brain-audit/references/product.md +29 -10
- package/templates/skills/brain-audit/references/prompt-spec-gap.md +34 -10
- package/templates/skills/brain-audit/references/reachability.md +38 -18
- package/templates/skills/brain-audit/references/repo-history.md +23 -16
- package/templates/skills/brain-audit/references/runtime.md +48 -10
- package/templates/skills/brain-audit/references/scalability.md +37 -10
- package/templates/skills/brain-audit/references/security.md +46 -22
- package/templates/skills/brain-audit/references/state-model.md +44 -15
- package/templates/skills/brain-audit/references/supply-chain.md +42 -13
- package/templates/skills/brain-audit/references/temporal.md +37 -14
- package/templates/skills/brain-audit/references/testing.md +38 -14
- package/templates/skills/brain-audit/references/tooling-baseline.md +34 -18
- package/templates/skills/brain-audit/references/type-safety.md +38 -19
- package/templates/skills/brain-audit/references/usability.md +78 -0
- package/templates/skills/brain-audit/references/versioning-compatibility.md +34 -12
- package/templates/skills/brain-audit/references/visual-design.md +38 -12
- package/templates/skills/brain-audit/references/web-metadata.md +47 -19
- package/templates/skills/brain-record/SKILL.md +297 -0
- package/templates/skills/brain-record/assets/build-video.sh +142 -0
- package/templates/skills/brain-record/assets/record.mjs +283 -0
- package/templates/skills/brain-record/references/pitfalls.md +233 -0
- package/templates/skills/brain-worktree/SKILL.md +103 -0
|
@@ -14,20 +14,22 @@ Enumerate the sinks, then check what reaches each one. For every hit, the rule-o
|
|
|
14
14
|
|
|
15
15
|
- [ ] **Query** — `search_code` for string concatenation or template interpolation feeding a query call (`+ req.`, `` `${...}` `` next to a query function, `.raw(`, `f"SELECT`). Trace the interpolated value back with `trace_path`; parameterised or nothing. CWE-89, #2 in the 2025 CWE Top 25. `Critical`.
|
|
16
16
|
- [ ] **Shell** — `search_code` for `exec(`, `spawn(` with `shell: true`, `os.system(`, `subprocess.` with `shell=True`, or backtick/string command construction. Trace the command string's origin; prefer argument arrays with no shell. CWE-78/CWE-77 (OS command injection, #9/#23 in the 2025 CWE Top 25).
|
|
17
|
-
- [ ] **Filesystem** — `search_code` for `path.join(`/`os.path.join(` fed by a request parameter, or raw string path building. Read the resolved-path handling for `..` traversal and absolute-path override; the fix is resolve-then-verify-inside-root, not string filtering. CWE-22 Path Traversal, #6 in the 2025 CWE Top 25.
|
|
17
|
+
- [ ] **Filesystem** — `search_code` for `path.join(`/`os.path.join(` fed by a request parameter, or raw string path building. Read the resolved-path handling for `..` traversal and absolute-path override; the fix is resolve-then-verify-inside-root, not string filtering. CWE-22 Path Traversal, #6 in the 2025 CWE Top 25 (CVE-2021-41773 in Apache HTTP Server 2.4.49 is a canonical instance — a path-normalisation regression that, combined with enabled CGI, reached remote code execution).
|
|
18
18
|
- [ ] **Code** — `search_code` for `eval(`, `new Function(`, dynamic `require(`/`import(` of a computed name, `pickle.loads`, `yaml.load` without `SafeLoader`, or other deserialisation of untrusted data. Trace the argument to its source. CWE-94 Code Injection (#10) or CWE-502 Deserialization of Untrusted Data (#15) in the 2025 CWE Top 25 — cite whichever fits the sink.
|
|
19
|
-
- [ ] **Template/markup** — `search_code` for `innerHTML`, `dangerouslySetInnerHTML`, `v-html`, or a template engine's raw/unescaped filter. Trace the value; a hit rendering only static or already-sanitised content is not the finding.
|
|
19
|
+
- [ ] **Template/markup** — `search_code` for `innerHTML`, `dangerouslySetInnerHTML`, `v-html`, or a template engine's raw/unescaped filter. Trace the value; a hit rendering only static or already-sanitised content is not the finding. CWE-79 Cross-Site Scripting, #1 in the 2025 CWE Top 25.
|
|
20
20
|
- [ ] **Model prompt** — `search_code` for string concatenation into a prompt or messages array. Trace the concatenated text to confirm it is untrusted user content, not a fixed system instruction; see `abuse.md` and `ai.md`.
|
|
21
|
+
- [ ] **Outbound request (SSRF)** — `search_code` for `fetch(`, `axios.get(`, `requests.get(`/`urllib.request`, `http.get(`/`net/http` fed by a request-derived value (a webhook-target field, an "import from URL"/avatar-by-URL feature, a PDF-render-from-URL endpoint). Trace the URL's origin with `trace_path`; a value checked against a destination allowlist before the request executes is not the finding. CWE-918 Server-Side Request Forgery, #22 in the 2025 CWE Top 25.
|
|
22
|
+
- [ ] **Redirect** — `search_code` for `res.redirect(`/`window.location =`/a `Location:` response header fed by a query or body parameter (`?returnUrl=`, `?next=`, `?redirect_uri=` outside a fixed OAuth callback list). Trace the parameter's origin with `trace_path`; a target checked against an allowlist or resolved through a fixed id-to-URL mapping is not the finding. CWE-601 URL Redirection to Untrusted Site.
|
|
21
23
|
|
|
22
24
|
## AuthN
|
|
23
25
|
|
|
24
26
|
ASVS 5.0 §V6 (Authentication) and §V7 (Session Management) cover this section.
|
|
25
27
|
|
|
26
|
-
- [ ] Credential comparison is constant-time. `search_code` for `===`, `==`, or `.equals(` comparing a token, secret, or hash — read the call site; a comparison against a non-secret value (a public id, a CSRF token already bound to session) does not qualify.
|
|
27
|
-
- [ ] Passwords are hashed with a slow, salted algorithm. `find_symbol`/`search_code` the registration or password-set handler and read what it calls before persisting — `bcrypt`/`argon2`/`scrypt` is correct, `md5`/`sha256`/plain storage is the finding.
|
|
28
|
-
- [ ] Sessions and tokens expire, and expiry is checked with the correct comparison. `find_symbol` the verify function and read the comparison operator literally — an off-by-one on `<` vs `<=` at the expiry boundary is a real defect, not a style nit.
|
|
28
|
+
- [ ] Credential comparison is constant-time. `search_code` for `===`, `==`, or `.equals(` comparing a token, secret, or hash — read the call site; a comparison against a non-secret value (a public id, a CSRF token already bound to session) does not qualify. CWE-208 Observable Timing Discrepancy.
|
|
29
|
+
- [ ] Passwords are hashed with a slow, salted algorithm. `find_symbol`/`search_code` the registration or password-set handler and read what it calls before persisting — `bcrypt`/`argon2`/`scrypt` is correct, `md5`/`sha256`/plain storage is the finding. This is `High` at `read`; `find_callees` on the handler between receiving the password and the persist call, confirming no hash/bcrypt/argon2/scrypt call intervenes, promotes it to `traced`, and `Critical`.
|
|
30
|
+
- [ ] Sessions and tokens expire (ASVS 5.0 §V7.3.1 inactivity timeout and §V7.3.2 absolute session lifetime), and expiry is checked with the correct comparison. `find_symbol` the verify function and read the comparison operator literally — an off-by-one on `<` vs `<=` at the expiry boundary is a real defect, not a style nit.
|
|
29
31
|
- [ ] Tokens are validated for signature, issuer, audience, and expiry. Read the verify call's options argument directly — a call that only decodes (`jwt.decode` with verification disabled, or no `verify()` at all) is the finding regardless of what happens after.
|
|
30
|
-
- [ ] Logout invalidates server-side. `find_symbol` the logout handler, then `find_callees` — a handler that only clears a client-side cookie or local storage entry, with no server-side session/token revocation call, is the finding.
|
|
32
|
+
- [ ] Logout invalidates server-side. `find_symbol` the logout handler, then `find_callees` — a handler that only clears a client-side cookie or local storage entry, with no server-side session/token revocation call, is the finding. ASVS 5.0 §V7.4.1: termination must "disallow any further use of the session" — client-side cookie deletion alone is explicitly insufficient. Rule out a stateless-token design with no server-side session store at all and a short token TTL — confirm which applies before flagging.
|
|
31
33
|
|
|
32
34
|
## AuthZ
|
|
33
35
|
|
|
@@ -35,45 +37,62 @@ ASVS 5.0 §V8 (Authorization) covers this section. The specific defect below —
|
|
|
35
37
|
|
|
36
38
|
- [ ] Every protected operation checks authorisation, and the check is on the server. `find_callers` on the authorisation helper, then compare against the full list of protected handlers from `get_architecture`/route discovery — the gap between the two lists is the finding. CWE-862 Missing Authorization, #4 in the 2025 CWE Top 25.
|
|
37
39
|
- [ ] Authorisation is checked against the *resource*, not only the *route*. `trace_path` from the handler to the query that loads the record and confirm the caller's identity is compared against an ownership or ACL field before the read/write executes — a handler that only checks "is authenticated" and then loads by the id in the URL is the finding (BOLA, see above).
|
|
38
|
-
- [ ] No object reference from the client is trusted as ownership proof — same
|
|
40
|
+
- [ ] No object reference from the client is trusted as ownership proof — `trace_path` the same handler-to-query path as above; the id in the request is data, not a credential.
|
|
39
41
|
- [ ] A caught exception or an unmatched branch in an authorisation check does not fail open. Read the authorisation helper's error handling directly — a `try/catch` around the permission check that falls through to "allow" on any exception, or a `switch`/`if` chain with no explicit deny in the default branch, is the finding. This is OWASP Top 10:2025 A10 (Mishandling of Exceptional Conditions), new for the 2025 edition.
|
|
40
42
|
- [ ] Mass assignment: `search_code` for `...req.body` spread into an update call, or an ORM `.update(req.body)`/`.save(req.body)` with no field allowlist. A hit with an explicit `pick`/DTO/schema validation between the request and the update is not the finding. OWASP API Security Top 10:2023 API3 (Broken Object Property Level Authorization / BOPLA).
|
|
41
|
-
- [ ] Default is deny.
|
|
43
|
+
- [ ] Default is deny. `search_code` the router/framework's default-route configuration for an unmatched or newly added route — a default-allow framework configuration is itself a finding even with no missing check found yet.
|
|
42
44
|
|
|
43
45
|
## Secrets
|
|
44
46
|
|
|
45
|
-
- [ ] `search_code` for `secret`, `password`, `token`, `api_key`, `private_key`, `Bearer` as literal string assignments. This is the highest false-positive check in the whole skill — read every hit before reporting. A hit assigning a hardcoded literal (`"sk-...")`, `"changeme"` used as a real default, a real-looking key in a fixture reused outside tests) is the finding; a hit reading from `process.env`, a config object backed by env, or a secret-manager client call is not.
|
|
46
|
-
- [ ] No secret in an error message, stack trace, or debug output —
|
|
47
|
-
- [ ] Secrets come from the environment or a secret manager, and absence fails loudly at startup. `search_code` the config-loading module for a fallback default on a secret-shaped key — a silent fallback (`|| 'default-secret'`) is the finding, not the absence of one. Application/service secrets should also carry an expiry or rotation mechanism, not just a source — read the secret-manager client call for a TTL/rotation parameter; its total absence on a long-lived service credential is `read`-tier evidence for a finding (this does not apply to user passwords, where mandatory periodic rotation is now considered outdated guidance per
|
|
48
|
-
- [ ] If a secret is found in the working tree,
|
|
47
|
+
- [ ] `search_code` for `secret`, `password`, `token`, `api_key`, `private_key`, `Bearer` as literal string assignments (OWASP Secrets Management Cheat Sheet). This is the highest false-positive check in the whole skill — read every hit before reporting. A hit assigning a hardcoded literal (`"sk-...")`, `"changeme"` used as a real default, a real-looking key in a fixture reused outside tests) is the finding; a hit reading from `process.env`, a config object backed by env, or a secret-manager client call is not. This is `High` at `read`; `find_callers` on the constant the literal is assigned to (or `trace_path` from its module to the client constructor) showing it reaches a live client/service constructor promotes it to `traced`, and `Critical`.
|
|
48
|
+
- [ ] No secret in an error message, stack trace, or debug output — Read the logging/error-serialisation call sites found under Information disclosure below for a secret-bearing field, don't infer it.
|
|
49
|
+
- [ ] Secrets come from the environment or a secret manager, and absence fails loudly at startup. `search_code` the config-loading module for a fallback default on a secret-shaped key — a silent fallback (`|| 'default-secret'`) is the finding, not the absence of one. Application/service secrets should also carry an expiry or rotation mechanism, not just a source — read the secret-manager client call for a TTL/rotation parameter; its total absence on a long-lived service credential is `read`-tier evidence for a finding (OWASP Secrets Management Cheat Sheet's rotation-cadence guidance; this does not apply to user passwords, where mandatory periodic rotation is now considered outdated guidance per NIST SP 800-63B — "verifiers SHOULD NOT require memorized secrets to be changed arbitrarily," only on evidence of compromise — do not flag its absence).
|
|
50
|
+
- [ ] If a secret is found in the working tree, `search_code` the same value across the tree to bound how far it spread, then hand the history question to `repo-history.md`'s pickaxe search (`git log -p -S'<pattern>'` is that module's probe, not this one's) — removal from `HEAD` does not remove it from history. **Rotation is required regardless of whether the check-in was reverted or the history was later rewritten** — per OWASP's Secrets Management Cheat Sheet, squashing/rewriting history addresses the commit trail, not the exposure: the secret was retrievable, so it is compromised, full stop. Proactive, exhaustive history scanning is owned by `repo-history.md`; this line stays reactive — do not expand history work here.
|
|
49
51
|
|
|
50
52
|
## Transport and headers
|
|
51
53
|
|
|
52
54
|
- [ ] TLS enforced; no plaintext transport for credentials or user data. `search_code` for `rejectUnauthorized: false`, `NODE_TLS_REJECT_UNAUTHORIZED=0`, `verify=False` (requests/httpx), or `InsecureSkipVerify: true` (Go) — each disables certificate verification outright and needs no further rule-out.
|
|
53
|
-
- [ ] CORS is not permissive-with-credentials. `search_code` for the CORS configuration and read it as one object — a wildcard origin (`*`) and `credentials: true` must be set on the *same* middleware instance to qualify; a wildcard on a public, unauthenticated endpoint with `credentials: false` elsewhere is not the finding.
|
|
54
|
-
- [ ] Cookies are `HttpOnly`, `Secure`, and have an appropriate `SameSite`. `search_code` for the cookie-setting call (`res.cookie(`, `Set-Cookie`, `set_cookie(`) and read the options object directly rather than assuming defaults.
|
|
55
|
+
- [ ] CORS is not permissive-with-credentials. `search_code` for the CORS configuration and read it as one object — a wildcard origin (`*`) and `credentials: true` must be set on the *same* middleware instance to qualify; a wildcard on a public, unauthenticated endpoint with `credentials: false` elsewhere is not the finding. MDN: a wildcard `Access-Control-Allow-Origin` combined with `credentials: true` on the same response is the invalid, exploitable combination.
|
|
56
|
+
- [ ] Cookies are `HttpOnly`, `Secure`, and have an appropriate `SameSite`. `search_code` for the cookie-setting call (`res.cookie(`, `Set-Cookie`, `set_cookie(`) and read the options object directly rather than assuming defaults. IETF httpbis, *Cookies: HTTP State Management Mechanism*: `Secure` gates transmission to a secure channel, `HttpOnly` gates non-HTTP API access, and an absent/unrecognised `SameSite` value defaults to `Lax`-equivalent enforcement.
|
|
57
|
+
- [ ] `search_code` the server/middleware configuration (`helmet(`, a custom response-header middleware, framework security defaults) for `X-Frame-Options` or a Content-Security-Policy `frame-ancestors` directive on HTML-serving responses. No hit on either, on a page that is not an intentionally embeddable widget, is the finding. OWASP Clickjacking Defense Cheat Sheet recommends `X-Frame-Options: DENY`/`SAMEORIGIN` and CSP `frame-ancestors` on every HTML response unless framing is a designed feature.
|
|
55
58
|
- [ ] State-changing requests are protected against cross-site forgery where cookie auth is used. First confirm the auth mechanism: `search_code` for how the session is authenticated — a pure Bearer-token API with no cookie in the auth path does not need CSRF protection, and flagging its absence there is the false positive. Where cookie auth is confirmed, `search_code` for CSRF middleware/token verification and check it is wired into the state-changing routes, not just imported.
|
|
56
59
|
|
|
57
60
|
## Information disclosure
|
|
58
61
|
|
|
59
|
-
- [ ] No stack trace, internal path, dependency version, or query text reaches a client. `search_code` the central error handler for `err.stack`, `err.message`, or a caught error object serialised directly into the response body. Cross-reference `failure.md`.
|
|
62
|
+
- [ ] No stack trace, internal path, dependency version, or query text reaches a client. `search_code` the central error handler for `err.stack`, `err.message`, or a caught error object serialised directly into the response body. OWASP Top 10:2025 A10 (Mishandling of Exceptional Conditions), CWE-209 Generation of Error Message Containing Sensitive Information. Cross-reference `failure.md`.
|
|
60
63
|
- [ ] Error messages do not distinguish "no such user" from "wrong password". Read the login and password-reset handlers directly and literally compare the status code and message text returned on each branch — they must be identical, not merely similar.
|
|
61
64
|
- [ ] Directory listing, source maps, and debug endpoints are disabled in production. `search_code` the production build/deploy config for `sourceMap: true`, `devtool:` set to a non-hidden value, or a static-file server with listing enabled.
|
|
62
65
|
- [ ] Logs do not contain credentials, tokens, or personal data. Read what is passed to the logger at the request-boundary middleware — a logged `req` or `req.headers` object without redaction is the finding; cross-reference `privacy.md`.
|
|
63
66
|
|
|
64
67
|
## Dependencies
|
|
65
68
|
|
|
66
|
-
- [ ] Known-vulnerable dependencies: cross-reference `dependencies-licensing.md` rather than duplicating that inventory here. Do not maintain a CVE list in this module — it goes stale the day it's written; live vulnerability status is unverifiable from source and belongs in Out of static reach.
|
|
67
|
-
- [ ] Lockfile present and committed
|
|
69
|
+
- [ ] Known-vulnerable dependencies: cross-reference `dependencies-licensing.md` (`search_code` the CI pipeline for an `npm audit`/`pip-audit`/`osv-scanner` step) rather than duplicating that inventory here. Do not maintain a CVE list in this module — it goes stale the day it's written; live vulnerability status is unverifiable from source and belongs in Out of static reach.
|
|
70
|
+
- [ ] Lockfile present and committed — owned by `supply-chain.md` (`get_architecture` packageManager, then confirm the lockfile is tracked); reuse its finding, do not re-report.
|
|
68
71
|
|
|
69
72
|
## Out of static reach
|
|
70
73
|
|
|
71
74
|
- Whether a flagged dependency vulnerability is actually exploitable in this codebase's usage of it — that needs the vulnerable code path exercised, not just present.
|
|
72
|
-
- Live CVE/advisory status for any dependency — the manifest is a point-in-time read; advisories are published continuously.
|
|
75
|
+
- Live CVE/advisory status for any dependency — the manifest is a point-in-time read; advisories are published continuously. Closeable via `runtime.md` if the project declares an audit/scan command that CI already runs.
|
|
73
76
|
- Whether network-layer controls (WAF rules, firewall policy, a reverse proxy's own header stripping) already mitigate a code-level finding.
|
|
74
|
-
- Actual production TLS/certificate configuration, as opposed to what the code declares — the deployed reality can diverge from the repo.
|
|
75
|
-
- Whether a secret found in git history has actually been rotated — this module can only prove exposure, not remediation; the reactive line above stays here, proactive scanning is `repo-history.md`'s job.
|
|
77
|
+
- Actual production TLS/certificate configuration, as opposed to what the code declares — the deployed reality can diverge from the repo; the certificate itself and the handshake that negotiated it stay out of reach regardless.
|
|
78
|
+
- Whether a secret found in git history or the current working tree has actually been rotated after the finding was reported — this module can only prove exposure, not remediation; the reactive line above stays here, proactive scanning is `repo-history.md`'s job.
|
|
76
79
|
- Whether a rate limit, lockout policy, or auth control holds up under real concurrent traffic — cross-reference `abuse.md` and `concurrency.md` for the structural checks; effectiveness under load is not something source can show.
|
|
80
|
+
- Whether a response header the code sets is the header a real client receives — a reverse proxy, CDN, or load balancer sitting in front of the app can strip or override a header the source code sets; without browser observation, source proves intent, not delivery.
|
|
81
|
+
- Whether an unvalidated outbound-request sink can actually reach a sensitive internal target (a cloud metadata endpoint, an internal admin panel) in production — that is a network-topology fact, not a code fact.
|
|
82
|
+
- Whether a found secret is still active versus already rotated/revoked at the provider — this module can prove exposure, never current validity; it cannot call the credential's own provider to check.
|
|
83
|
+
|
|
84
|
+
## What browser observation closes
|
|
85
|
+
|
|
86
|
+
Applies only when `browser.md` ran; findings here are `observed` and cite the bundle path with a line or step number. Never claim TLS handshake data or certificate validity from this bundle — `network.jsonl` shows only the request's scheme and response headers.
|
|
87
|
+
|
|
88
|
+
| Artefact | Gap it closes | Observed instance earns |
|
|
89
|
+
|---|---|---|
|
|
90
|
+
| `network.jsonl` | Missing HSTS or CSP response headers, with a measurer present | High |
|
|
91
|
+
| `network.jsonl` | Cookie flags (`HttpOnly`/`Secure`/`SameSite`) on a real `Set-Cookie` response header | High |
|
|
92
|
+
| `network.jsonl` | Mixed content — an `http://` request made from an `https://` page | High |
|
|
93
|
+
| `network.jsonl` | Anti-clickjacking headers (`X-Frame-Options`, CSP `frame-ancestors`) on the primary HTML document response | High |
|
|
94
|
+
| `network.jsonl` | CORS preflight response exposes a wildcard origin with credentials allowed — `OPTIONS` response header pair on the same endpoint | High |
|
|
95
|
+
| `console.jsonl` | CSP violation reported by the browser itself, scaled to what the violated directive protects | Medium |
|
|
77
96
|
|
|
78
97
|
## Severity guidance
|
|
79
98
|
|
|
@@ -81,8 +100,10 @@ ASVS 5.0 §V8 (Authorization) covers this section. The specific defect below —
|
|
|
81
100
|
|---|---|
|
|
82
101
|
| Injection sink reachable from unvalidated external input | Critical |
|
|
83
102
|
| Missing authorisation on a protected operation | Critical |
|
|
84
|
-
| Secret
|
|
85
|
-
|
|
|
103
|
+
| Secret literal traced (`find_callers`) to a live client/service constructor, still committed | Critical |
|
|
104
|
+
| Secret committed to the repository (regardless of later history rewrite), reach not traced | High |
|
|
105
|
+
| Password unhashed, traced (`find_callees`) with no hash call between input and persistence | Critical |
|
|
106
|
+
| Password stored unhashed or reversibly, reach not traced | High |
|
|
86
107
|
| Authorisation check fails open on an unhandled exception | High |
|
|
87
108
|
| Certificate verification disabled | High |
|
|
88
109
|
| Authorisation checked on route but not on resource (BOLA) | High |
|
|
@@ -90,3 +111,6 @@ ASVS 5.0 §V8 (Authorization) covers this section. The specific defect below —
|
|
|
90
111
|
| Non-constant-time secret comparison | Medium |
|
|
91
112
|
| Missing cookie security attributes | Medium |
|
|
92
113
|
| Internal detail disclosed in an error | Medium |
|
|
114
|
+
| Outbound request reaching an unvalidated destination (SSRF), traced to unvalidated external input | Critical |
|
|
115
|
+
| Redirect target traced (`trace_path`) to unvalidated client input, no allowlist | Medium |
|
|
116
|
+
| Missing anti-clickjacking headers on an HTML-serving response | Medium |
|
|
@@ -10,64 +10,93 @@ A formal state model — a statechart, in Harel's original sense, standardised b
|
|
|
10
10
|
|
|
11
11
|
- [ ] Find every declaration of the state set: an enum, a union type, a database column's `CHECK` constraint or comment listing valid values, a state-machine library's chart definition (XState, a `transitions` table). `find_symbol` on the type/enum name to get the canonical list.
|
|
12
12
|
- [ ] Find every place that switches on it: `find_callers` on the enum/type, then read each `switch`/`match`/if-chain for completeness against the list above.
|
|
13
|
-
- [ ]
|
|
13
|
+
- [ ] Read the state set found above and note its shape once, in prose, so every later check has a fixed reference — this is the yardstick, same discipline as establishing the token vocabulary in `design-system.md`.
|
|
14
14
|
|
|
15
15
|
## Declared but unreachable
|
|
16
16
|
|
|
17
17
|
- [ ] A state present in the enum that no code path ever assigns. `search_code` the state's literal value as an assignment target (`status = 'archived'`, `.setState(Status.Archived)`); if nothing assigns it, it is dead data, not dead code — cross-reference `reachability.md` for the mechanics but report the finding here since the enum is the artefact.
|
|
18
|
-
- [ ] A state assigned only in a test fixture or seed script, never by application logic — the same shape, one layer removed.
|
|
18
|
+
- [ ] A state assigned only in a test fixture or seed script, never by application logic — `search_code` the state's literal value as an assignment target restricted to test/fixture/seed paths; the same shape as above, one layer removed.
|
|
19
19
|
|
|
20
20
|
## Assigned but unhandled
|
|
21
21
|
|
|
22
|
-
- [ ] The inverse and more dangerous gap: a state that gets assigned somewhere but that a `switch`/`match` elsewhere doesn't handle. Read each switch site found via `find_callers` above for a **missing `default`/`else` arm** — code that silently falls through and does nothing is worse than a crash, because nothing signals the gap ever fired.
|
|
23
|
-
- [ ] `search_code` for the exhaustiveness marker itself (`: never`, `assertNever(`, `@Exhaustive`, a sealed-class `when` in Kotlin). Its absence at a switch site is exactly what let the current gaps exist, and adding it is the fix that prevents the next one. Cross-reference `type-safety.md` if the exhaustiveness gap is hidden behind an `any`/suppressed cast.
|
|
24
|
-
- [ ] Among the switch sites
|
|
25
|
-
- [ ] Every creation path (constructor, insert, factory function) assigns one of the declared states explicitly. `search_code` the record's construction sites; a field left `null`/undefined at insert time behaves as a phantom extra state that no switch was written to handle.
|
|
22
|
+
- [ ] The inverse and more dangerous gap: a state that gets assigned somewhere but that a `switch`/`match` elsewhere doesn't handle. Read each switch site found via `find_callers` above for a **missing `default`/`else` arm** — code that silently falls through and does nothing is worse than a crash, because nothing signals the gap ever fired. TypeScript's own `never`-typed exhaustiveness pattern exists precisely because "adding a new union member without a matching `case`" should be caught before runtime, not silently fall through (Microsoft, official language documentation, current, https://www.typescriptlang.org/docs/handbook/2/narrowing.html).
|
|
23
|
+
- [ ] `search_code` for the exhaustiveness marker itself (`: never`, `assertNever(`, `@Exhaustive`, a sealed-class `when` in Kotlin). Its absence at a switch site is exactly what let the current gaps exist, and adding it is the fix that prevents the next one — the pattern assigns the narrowed impossible remaining value to a `never`-typed variable so an unhandled new member becomes a compile error (Microsoft, official language documentation, current, https://www.typescriptlang.org/docs/handbook/2/narrowing.html). Cross-reference `type-safety.md` if the exhaustiveness gap is hidden behind an `any`/suppressed cast.
|
|
24
|
+
- [ ] Among the switch sites Read above, a `default`/`else` arm that maps every unrecognised state to some fallback value rather than erroring or logging — a milder form of the same gap: it hides a genuinely unhandled state behind output that looks intentional, so nobody notices the switch was incomplete. This is the same shape Yuan et al.'s analysis of 198 real-world distributed-systems failures names as the dominant cause of the most catastrophic ones: incorrect handling of an already-signalled condition, not a missing check (Ding Yuan et al., University of Toronto, USENIX OSDI '14, 2014, https://www.eecg.toronto.edu/failureAnalysis/).
|
|
25
|
+
- [ ] Every creation path (constructor, insert, factory function) assigns one of the declared states explicitly. `search_code` the record's construction sites; a field left `null`/undefined at insert time behaves as a phantom extra state that no switch was written to handle — the "make illegal states unrepresentable" principle argues for exactly this: a value with no declared state is itself a representable illegal state (Functional Architecture reference site, attributing Yaron Minsky, community reference page, current, https://functional-architecture.org/make_illegal_states_unrepresentable/).
|
|
26
26
|
|
|
27
27
|
## Transitions
|
|
28
28
|
|
|
29
|
-
- [ ] Every transition path is deliberate: `trace_path` (or a straightforward read of the transition table) from each state to the states it's allowed to reach. A transition with no guard — any state can jump to any other by just setting the field — is not a state machine, it's a label.
|
|
29
|
+
- [ ] Every transition path is deliberate: `trace_path` (or a straightforward read of the transition table) from each state to the states it's allowed to reach. A transition with no guard — any state can jump to any other by just setting the field — is not a state machine, it's a label. A guard is "a condition function that the machine checks when it goes through an event" (Stately/XState maintainers, official framework documentation, current, https://stately.ai/docs/guards); the transition table's edges only mean something if every edge is actually gated by one.
|
|
30
|
+
- [ ] `find_symbol` each guard/condition function gating a transition found above and `find_callees` it. A guard that calls a mutating function (a write, a network call, an event emission) rather than only reading and returning a boolean breaks the assumption every consumer of that transition makes: that evaluating whether a move is legal has no effect on whether it happens. Guards "should be pure, synchronous functions that return either `true` or `false`" (Stately/XState maintainers, official framework documentation, current, https://stately.ai/docs/guards) — the specific, named requirement this check verifies. Refuted if the "mutation" is a memoization/cache write with no externally visible effect (idempotent, same-process, no side effect a caller could observe) — confirm by reading what the callee actually mutates before flagging.
|
|
30
31
|
- [ ] Transitions that skip a declared intermediate state. If the model says `draft → review → published`, `search_code` every write site setting `published` directly (`status = 'published'`, `.setState(Status.Published)`) and check its originating state — confirm any direct `draft → published` write is intentional (an admin override) rather than a bypass nobody meant to allow.
|
|
31
32
|
- [ ] Terminal states with a way out that shouldn't exist — `search_code` for a write to the state field inside any code path reachable after a `cancelled`/`refunded`/terminal check, e.g. `if (status === 'cancelled') { ... status = ... }`.
|
|
32
|
-
- [ ] Non-terminal states with no path forward at all:
|
|
33
|
+
- [ ] Non-terminal states with no path forward at all: Read the transition table built above — any state that appears as a **target** of some transition but never as a **source** of one. Records land there and stay forever. Rule out first: a manual/support-only transition that's real but undocumented in code (an admin panel, a direct DB fix) — state which you checked.
|
|
33
34
|
|
|
34
35
|
## Duplicated state sets
|
|
35
36
|
|
|
36
|
-
- [ ] The same conceptual state set declared twice — a backend enum and a frontend union, a database `CHECK` constraint and a client-side type — and already out of sync.
|
|
37
|
+
- [ ] The same conceptual state set declared twice — a backend enum and a frontend union, a database `CHECK` constraint and a client-side type — and already out of sync. `find_symbol` each declaration and Read to diff the literal member lists; a backend value with no frontend counterpart renders as `undefined`/a blank label, not an error. **Cross-reference `cross-surface-parity.md`**, which owns diverged behavioural rules between surfaces; this module reports the divergence, that module tracks the general pattern.
|
|
37
38
|
- [ ] Where a shared type is meant to be the single source, `search_code` the second surface's directory for a local re-declaration of the same enum/union name rather than an import from the shared location — a local copy that happens to match today is the drift waiting to happen.
|
|
38
39
|
|
|
40
|
+
## Orthogonal state modeled as flags
|
|
41
|
+
|
|
42
|
+
- [ ] `search_code` for two or more independently-writable status-like fields on the same entity (`isPaid`, `isShipped`, `isCancelled`, or a separate `paymentStatus` alongside `fulfillmentStatus`) that are read together at a decision point, then `find_callers` on each flag's write site to confirm both are independently writable with no mutual exclusion. If any combination the fields can independently reach is semantically invalid (`isCancelled=true` and `isShipped=true` both set) and no write path prevents it, this is a hand-rolled orthogonal region without the guard a real parallel state would have — the cross-product of independently-set fields is exactly the "representable illegal state" the "make illegal states unrepresentable" principle targets (Functional Architecture reference site, attributing Yaron Minsky, community reference page, current, https://functional-architecture.org/make_illegal_states_unrepresentable/). Refuted if the "invalid" combination is unreachable because one flag's write path always checks the other first (an implicit guard exists, just not expressed as a single enum) — quote the guarding `if` before flagging.
|
|
43
|
+
|
|
39
44
|
## Persisted values the code no longer knows about
|
|
40
45
|
|
|
41
|
-
- [ ] Values existing in stored data (a `status` column, a serialized state field) that don't appear in the current enum at all — the fingerprint of a state renamed or removed without a data migration. `search_code` for the old name in migration history or a comment; if the current switch has no case for it, every row carrying that value falls through the unhandled-state gap above, silently, in production, for real records.
|
|
42
|
-
- [ ] `search_code` migration files for an `ALTER`/`CHECK`-constraint change to the state column with no accompanying `UPDATE` statement backfilling the old values to a valid new one.
|
|
46
|
+
- [ ] Values existing in stored data (a `status` column, a serialized state field) that don't appear in the current enum at all — the fingerprint of a state renamed or removed without a data migration. `search_code` for the old name in migration history or a comment; if the current switch has no case for it, every row carrying that value falls through the unhandled-state gap above, silently, in production, for real records. The static evidence is `inferred`, not `read` — the search proves the value is unhandled if present, not that any row carries it — so this caps at `Medium`; cross-reference `runtime.md` for a declared DB-inspection command that would confirm live rows directly, promoting this to `executed`, and `Critical`.
|
|
47
|
+
- [ ] `search_code` migration files for an `ALTER`/`CHECK`-constraint change to the state column with no accompanying `UPDATE` statement backfilling the old values to a valid new one. On Postgres specifically, an `ALTER TYPE ... ADD VALUE` executed inside a transaction block means "the new value cannot be used until after the transaction has been committed" (PostgreSQL Global Development Group, official database documentation, current, https://www.postgresql.org/docs/current/sql-altertype.html) — the framework's migration-file transaction wrapping matters as much as the SQL itself.
|
|
48
|
+
- [ ] `search_code` migration files for `ALTER TYPE ... ADD VALUE` followed, in the same migration/transaction, by an `INSERT`/`UPDATE` using that new value. Postgres forbids using a value added by `ALTER TYPE` before the adding transaction commits (PostgreSQL Global Development Group, official database documentation, current, https://www.postgresql.org/docs/current/sql-altertype.html); a migration attempting both in one transaction fails outright at deploy time (or, on a framework that silently wraps each migration file in its own transaction, appears to work in dev against an already-migrated dev DB and only fails on a clean deploy). Refuted if the migration tool used demonstrably splits `ADD VALUE` and its use into two separate transactions/files already (framework-level protection exists) — name the mechanism.
|
|
43
49
|
|
|
44
50
|
## Concurrency on transitions
|
|
45
51
|
|
|
46
|
-
- [ ] `search_code` each transition function found above for a read-then-write shape (fetch the record, check its current state, then write the new one) with no atomic guard — optimistic lock, unique constraint, or conditional `UPDATE ... WHERE status = ...`. Two concurrent requests (a double-submit, a webhook retry) racing this gap will both pass the check and both write. Cross-reference `concurrency.md`'s read-modify-write section; report the state-specific instance here.
|
|
47
|
-
- [ ]
|
|
52
|
+
- [ ] `search_code` each transition function found above for a read-then-write shape (fetch the record, check its current state, then write the new one) with no atomic guard — optimistic lock, unique constraint, or conditional `UPDATE ... WHERE status = ...`. Two concurrent requests (a double-submit, a webhook retry) racing this gap will both pass the check and both write — the canonical TOCTOU shape, "two concurrent actors both pass a check before either completes its action," leaving "the system in an inconsistent state" (OWASP Foundation, official OWASP community page, current, https://owasp.org/www-community/pages/vulnerabilities/race_conditions); "with race conditions, everything is multi-step," and even one HTTP request passes through fleeting sub-states an attacker can land inside (PortSwigger Research, James Kettle, official vendor security research, current, https://portswigger.net/research/smashing-the-state-machine). Cross-reference `concurrency.md`'s read-modify-write section; report the state-specific instance here.
|
|
53
|
+
- [ ] Where a transition's precondition is checked in one handler/request and applied in a separate one (a verify-token endpoint and a later apply-change endpoint, a webhook receiver and a separate confirmation step), `trace_path` from the precondition read to the state write to confirm both read the *same* record field at the *same* point in time, not two different sources (a DB row in one, an in-memory/session value carried from the first request in the other). A precondition sourced from a different read than the write it gates is a wider race than a single function's read-then-write — this is the exact shape of the Devise/GitLab email-verification exploit: a token confirmed against a database read, the change applied from a session variable set by an earlier, unrelated request (PortSwigger Research, James Kettle, official vendor security research, current, https://portswigger.net/research/smashing-the-state-machine), the real-world instance being CVE-2022-4037, CVSS 8.5, "verified email forgery and takeover of third-party accounts" (Tenable, security vendor CVE advisory, 2023, https://www.tenable.com/plugins/nessus/171163). Refuted if the two reads are provably of the same up-to-date source (the second handler re-reads the same row rather than trusting a value passed from the first) — quote the re-read.
|
|
54
|
+
- [ ] `search_code` to locate identity- or privilege-bearing state fields by name pattern among the transitions found above (`email_verified = true`, a role/plan upgrade, a session's authenticated flag), then `trace_path` to confirm the write path; flag any match for the checks above first and at the top severity within reach — an unguarded race on a privilege-granting transition has a materially different blast radius (account takeover, CVE-2022-4037, CVSS 8.5: Tenable, security vendor CVE advisory, 2023, https://www.tenable.com/plugins/nessus/171163) than the same shape on a display-only status field. Refuted if the field looks privilege-bearing by name but every read of it is re-validated against a separate authorization check downstream (defense in depth already closes the gap) — cite the downstream check.
|
|
55
|
+
- [ ] A self-transition (a record transitioning back into the state it's already in) unintentionally re-firing side effects — a confirmation email, a webhook, a billing event — that were meant to fire once on entry. `find_callees` on the transition handler to see what it triggers, then check whether it guards on "value actually changed" before triggering them. Stripe's own idempotency-key model exists to prevent an equivalent re-fire on retry — a stored response is replayed rather than the operation repeated (Stripe, official API reference documentation, current, https://docs.stripe.com/idempotency).
|
|
48
56
|
|
|
49
57
|
## Display and downstream consumers
|
|
50
58
|
|
|
51
59
|
- [ ] `search_code` the label/badge/translation lookup that renders the state to a user and diff its case list against the canonical enum from the first section. A state with no display case renders a blank, the raw enum key, or throws, depending on the language's default behaviour for an unmatched case.
|
|
52
60
|
- [ ] `search_code` filter and sort UI (a dashboard's status filter, a report's grouping control) for a hardcoded local list of state values, and diff it against the canonical enum — a state added later silently never appears as a filter option, and records in it become invisible to anyone filtering.
|
|
53
61
|
|
|
62
|
+
## What browser observation closes
|
|
63
|
+
|
|
64
|
+
Applies only when `browser.md` ran; findings here are `observed` and cite the bundle path with a line or step number.
|
|
65
|
+
|
|
66
|
+
| Artefact | Gap it closes | Observed instance earns |
|
|
67
|
+
|---|---|---|
|
|
68
|
+
| `final-state.md`/`screenshots/` showing the rendered status/state value (or `network.jsonl`'s response body when the request errors, since a 2xx response body is not captured), cross-referenced against the enum found via `find_symbol` | A live status/state value absent from the source-declared enum — this is the module's own existing "Persisted value confirmed present in live data" row; the browser bundle is a second path to that same evidence, alongside `runtime.md`'s DB query. Refuted if the value is legitimate output from a newer backend deploy not yet reflected in the checked-out frontend source — check recent commits/deploy timestamps before flagging as drift. | Critical |
|
|
69
|
+
| `screenshots/` for the step, plus `console.jsonl` if a missing-translation-key warning was logged | A rendered status badge/label shows the raw enum key, `undefined`, or is blank for a state reached during the walk. Refuted if the blank/raw render is this specific record's data problem (a null field on one row), not a missing display case for the state itself — confirm by finding the state's case in the label lookup via `search_code` before keeping this as a display-lookup gap. | High |
|
|
70
|
+
| `steps.md` before/after state per step, `final-state.md` | An action expected to fire a declared transition (e.g. "cancel") produces no visible state change, or an error, on a confirmed flow. Refuted if the transition fired but the display consumer wasn't refreshed (a caching/revalidation bug, not a transition bug) — check `network.jsonl` for whether the write request actually returned success before attributing this to the state model rather than to data-fetching. | High |
|
|
71
|
+
|
|
54
72
|
## Out of static reach
|
|
55
73
|
|
|
56
74
|
- Whether an admin-only or support-tooling transition is intentional versus a bypass — usually needs a person to confirm.
|
|
57
75
|
- The actual frequency a given transition fires in production, which decides how urgent an unguarded race really is.
|
|
58
76
|
- Whether a "stuck" non-terminal state is a real dead end or one only reachable through an out-of-repo system (a support queue, a manual ops runbook).
|
|
77
|
+
- Whether every invalid flag combination is truly unreachable, versus merely not found by this pass — that needs a model checker, not a code search.
|
|
78
|
+
- Whether a guard is actually side-effect-free at runtime, beyond what its directly-visible callees show — dynamic dispatch and reflection can hide effects from static tracing.
|
|
79
|
+
- Whether out-of-order webhook delivery can retrigger or reverse a transition — that depends on the third-party provider's ordering guarantees, not this codebase.
|
|
80
|
+
- Whether an unguarded transition is practically exploitable here — this audit proves the race exists structurally, not that a real attacker could time it.
|
|
59
81
|
|
|
60
82
|
## Severity guidance
|
|
61
83
|
|
|
62
84
|
| Situation | Severity |
|
|
63
85
|
|---|---|
|
|
64
|
-
| Persisted value with no current code path
|
|
86
|
+
| Persisted value confirmed present in live data with no current code path (`runtime.md` DB query) | Critical |
|
|
87
|
+
| Transition precondition checked and applied against different data sources across a request boundary, traced via `trace_path` | Critical |
|
|
88
|
+
| Race on an identity- or privilege-granting transition (email verification, role/plan upgrade, session auth flag), traced via `trace_path` | Critical |
|
|
89
|
+
| Persisted value with no current code path that handles it, presence in live data unconfirmed | Medium |
|
|
65
90
|
| Assigned state with no handling branch (silent no-op) | High |
|
|
66
91
|
| Transition with no guard, reachable from any state | High |
|
|
92
|
+
| Guard function with a side effect (a write, a network call, an event emission), traced via `find_callees` | High |
|
|
93
|
+
| Independently-writable status flags reaching a semantically invalid combination with no mutual-exclusion guard | High |
|
|
67
94
|
| Non-terminal state with zero outgoing transitions | High |
|
|
68
95
|
| Same state set duplicated across surfaces and diverged | High |
|
|
69
96
|
| Transition skipping a declared intermediate state | Medium |
|
|
70
97
|
| Terminal state with an unintended exit path | Medium |
|
|
71
98
|
| Missing exhaustiveness check on a state switch | Medium |
|
|
72
99
|
| Declared state never assigned by any code path | Medium |
|
|
73
|
-
| Race on a transition with no atomic guard
|
|
100
|
+
| Race on a transition with no atomic guard, double-charges or double-ships | High |
|
|
101
|
+
| Race on a transition with no atomic guard, otherwise | Medium |
|
|
102
|
+
| Migration adds an enum value and uses it in the same transaction | Low |
|
|
@@ -6,46 +6,69 @@ Can the artefact you ship be trusted, and can the build that produced it be repr
|
|
|
6
6
|
|
|
7
7
|
## Install-time execution
|
|
8
8
|
|
|
9
|
-
- [ ] `search_code` the project's own manifest for `postinstall`, `preinstall`, and `prepare` scripts, and — for any package with native bindings — a `binding.gyp` file. Lifecycle scripts are not the only install-time execution vector: 2026 npm worm campaigns shipped a weaponised `binding.gyp` that triggers `node-gyp` to run attacker code during `install`, specifically because scanners that only watch the `scripts` field miss it.
|
|
9
|
+
- [ ] `search_code` the project's own manifest for `postinstall`, `preinstall`, and `prepare` scripts, and — for any package with native bindings — a `binding.gyp` file. Lifecycle scripts are not the only install-time execution vector: 2026 npm worm campaigns shipped a weaponised `binding.gyp` that triggers `node-gyp` to run attacker code during `install`, specifically because scanners that only watch the `scripts` field miss it. OWASP Top 10:2025 A03 Software Supply Chain Failures names exactly the lifecycle-script vector — the 2025 Shai-Hulud npm worm "used a post-install script to harvest and exfiltrate sensitive data to public GitHub repositories."
|
|
10
10
|
- [ ] Whether the install pipeline disables or audits scripts from dependencies — `search_code` CI config and root config files for `--ignore-scripts` (npm/pnpm), `enable-scripts` (yarn), or `trustedDependencies` (bun). **Falsify before flagging as missing**: some package managers ship this off by default and rely on an allowlist file instead — confirm the allowlist exists rather than assuming no gate at all.
|
|
11
11
|
- [ ] If scripts are not disabled, whether any allowlist restricts which packages may run them — `search_code` for `trustedDependencies`, an `.npmrc` scripts setting, or the package manager's equivalent — rather than trusting the entire dependency tree by default.
|
|
12
12
|
|
|
13
13
|
## Lockfile integrity
|
|
14
14
|
|
|
15
|
-
- [ ] Lockfile present and committed — `get_architecture` packageManager, then confirm the lockfile
|
|
15
|
+
- [ ] Lockfile present and committed — `get_architecture` packageManager, then confirm the lockfile itself is tracked (`search_code` or a direct path check), not merely present on disk and gitignored.
|
|
16
16
|
- [ ] Manifest ranges the lockfile actually satisfies. Read a sample of `dependencies` entries against their resolved lockfile versions — a range the lockfile does not satisfy means a fresh `install` on CI resolves something nobody tested locally. This is the single most common source of "works on my machine, breaks in CI."
|
|
17
17
|
- [ ] In a monorepo, every workspace has its dependencies covered by the root lockfile — `search_code` for a `workspaces` / `packages` field, then confirm no workspace manifest references a dependency absent from the lockfile.
|
|
18
|
-
- [ ]
|
|
19
|
-
- [ ]
|
|
18
|
+
- [ ] Read the lockfile for an integrity hash on every entry (`integrity`, `resolved` + checksum, or the package manager's equivalent). An entry with a version but no hash trusts the registry's word at every future install, not just this one.
|
|
19
|
+
- [ ] `search_code` for `pnpm-lock.yaml`, `package-lock.json`, `yarn.lock`, and `bun.lock` at the repo root and flag more than one hit. Two lockfiles from different tools means whichever one CI happens to read is the one actually enforced, and a developer using the other tool silently resolves a different tree.
|
|
20
20
|
- [ ] What "locked" means for this ecosystem, checked rather than assumed. `Cargo.lock`, `package-lock.json`/`pnpm-lock.yaml`/`bun.lock`, and `uv.lock` each pin the full resolved dependency graph with a per-entry hash — `go.sum` does not: it is an append-only checksum ledger for modules already downloaded, not a resolved-graph lock, so read it alongside `go.mod` under `-mod=readonly` rather than treating it as equivalent. A Python project's `requirements.txt` with exact `==` pins looks locked but carries no hash unless generated with `--require-hashes` (e.g. via `pip-compile --generate-hashes`) — `search_code` for the flag before assuming pinned means verified.
|
|
21
21
|
|
|
22
22
|
## Provenance and pinning
|
|
23
23
|
|
|
24
|
-
- [ ] A minimum-release-age (cooldown) is configured so a freshly-published version cannot resolve immediately — `search_code` for npm's `min-release-age
|
|
24
|
+
- [ ] A minimum-release-age (cooldown) is configured so a freshly-published version cannot resolve immediately — `search_code` for npm's `min-release-age` (npm CLI docs: "only versions that were available more than the given number of days ago will be installed," disabled/`null` by default), pnpm's `minimumReleaseAge` (pnpm ≥10.16), paired with `trustPolicy: no-downgrade` (pnpm ≥10.21), or Bun's `install.minimumReleaseAge` in `bunfig.toml` (Bun ≥1.3). Most compromised releases are pulled within hours; its absence means every install races the takedown.
|
|
25
|
+
- [ ] If the repository claims a SLSA level (README badge, `slsa-github-generator` workflow step, or an in-toto attestation reference found via `search_code`), confirm the CI workflow actually meets that level's stated requirements — provenance generated and distributed (L1), build run on hosted infrastructure with a signed provenance (L2), or build isolation plus secret material withheld from user-defined steps (L3), per the SLSA v1.0 spec — rather than trusting the badge. A project with no SLSA claim at all is not the finding; this only fires against a repository asserting a level the workflow file does not, on its face, meet — name which requirement is missing.
|
|
25
26
|
- [ ] Dependency sources beyond the default registry — `search_code` the lockfile for `git+`, `github:`, direct tarball URLs, or `file:`/`link:` local paths. Each is a supply-chain path the registry's own integrity checks do not cover.
|
|
26
|
-
- [ ] Any git-sourced dependency pinned to a branch or tag rather than a commit SHA —
|
|
27
|
-
- [ ] CI action versions pinned by a full 40-character commit SHA, not a moving tag — the only form GitHub treats as immutable (`uses: actions/checkout@11bd719… # v4.2.2` vs `@v4`) — `search_code` workflow files for `uses:` lines. GitHub's actions
|
|
27
|
+
- [ ] Any git-sourced dependency pinned to a branch or tag rather than a commit SHA — Read the lockfile's `git+` entries for a `#<sha>` suffix versus a branch or tag name. A branch ref is mutable — the maintainer can push different code to it tomorrow and every future install silently picks it up.
|
|
28
|
+
- [ ] CI action versions pinned by a full 40-character commit SHA, not a moving tag — the only form GitHub treats as immutable (`uses: actions/checkout@11bd719… # v4.2.2` vs `@v4`) — `search_code` workflow files for `uses:` lines. GitHub's "allowed actions" policy can enforce SHA-pinning org-wide since August 2025; a repo relying on that setting alone, rather than the pin itself, is still unproven from source.
|
|
28
29
|
- [ ] Container base images pinned by digest (`FROM image@sha256:…`) rather than a tag that can be repointed (`:latest`, `:20`) — `search_code` Dockerfiles for `FROM`.
|
|
29
30
|
|
|
30
31
|
## Release and publish trust
|
|
31
32
|
|
|
32
|
-
- [ ] SBOM generation as part of the release process — `search_code` release workflows for an SBOM tool invocation (`cyclonedx`/`cdxgen` for CycloneDX (spec 1.7,
|
|
33
|
-
- [ ] Provenance or attestation on published artefacts — `search_code` for `npm publish --provenance`, PyPI Trusted Publishing, a `cosign sign`/`cosign attest` step, or GitHub's `actions/attest-build-provenance` action. All four now produce a DSSE-wrapped in-toto statement verifiable with a single tool (cosign
|
|
34
|
-
- [ ] Who can publish the artefact — `search_code` the publish workflow for the trigger condition (tag push, manual approval, protected branch) and whether the publishing token is scoped to this package alone or holds broader org access.
|
|
33
|
+
- [ ] SBOM generation as part of the release process — `search_code` release workflows for an SBOM tool invocation (`cyclonedx`/`cdxgen` for CycloneDX (spec 1.7, Oct 2025 — the final release in the 1.x line, backward compatible with 1.4–1.6; 2.0 is expected later in 2026, so a reader re-checking this later should confirm 1.7 is still current), `syft` for SPDX (spec 3.0.1, current since the 3.0 line shipped Apr 2024; a 3.1 release candidate is underway), `npm sbom`, or equivalent) and confirm the output is actually published as a release artefact, not just generated and discarded.
|
|
34
|
+
- [ ] Provenance or attestation on published artefacts — `search_code` for `npm publish --provenance`, PyPI Trusted Publishing, a `cosign sign`/`cosign attest` step, or GitHub's `actions/attest-build-provenance` action. All four now produce a DSSE-wrapped in-toto statement verifiable with a single tool (cosign has read npm/GitHub/Homebrew provenance alike since v2.4.0; v3 makes this the default) — confirm the step exists, not that anyone has ever run verification against it. npm docs: provenance is "a verifiable link to the package's source code and build instructions," built on Sigstore, but explicitly "does not guarantee the package has no malicious code."
|
|
35
|
+
- [ ] Who can publish the artefact — `search_code` the publish workflow for the trigger condition (tag push, manual approval, protected branch) and whether the publishing token is scoped to this package alone or holds broader org access. `search_code` for a long-lived registry token (`NPM_TOKEN`, a stored `PYPI_API_TOKEN`) versus npm/PyPI Trusted Publishing (OIDC, no standing secret) — a long-lived token is a single credential an attacker who phishes or leaks it can use to publish directly, the exact mechanism behind two confirmed incidents: event-stream (a social-engineered maintainer takeover that added a malicious dependency harvesting Copay bitcoin-wallet credentials) and ua-parser-js (three malicious published versions; GitHub's own advisory calls any host running them "fully compromised," with all secrets and keys on it needing rotation). A stored token scoped to this package alone, with evidence of required 2FA/approval on the publish step, is materially lower-risk than an unscoped, ungated one — this check cannot see the registry-side account state itself.
|
|
35
36
|
- [ ] Whether publishing requires a review gate — `search_code` the publish workflow for a required-approval step or a branch-protection prerequisite before the tag that triggers release — rather than firing on any push to a default branch.
|
|
36
37
|
|
|
38
|
+
## CI/CD pipeline hardening
|
|
39
|
+
|
|
40
|
+
- [ ] `search_code` workflow files for an untrusted GitHub context value (`${{ github.event.issue.title }}`, `${{ github.event.pull_request.title }}`, a PR body or branch name) interpolated directly into a `run:` shell string, especially combined with `pull_request_target` — this is a script-injection path into the CI runner's secrets and publish credentials, not merely a lint concern. OpenSSF Scorecard's "Dangerous-Workflow" check names exactly this pattern as an automated, named defect class. The untrusted value passed through an intermediate `env:` block rather than inlined directly into the shell string — GitHub's own documented mitigation — is not the finding; check for that indirection before flagging.
|
|
41
|
+
|
|
42
|
+
## Third-party script trust
|
|
43
|
+
|
|
44
|
+
- [ ] `search_code` HTML entry points, layout templates, and `<script src=` / `<link rel="stylesheet" href=` occurrences for a cross-origin URL (a CDN host, not the project's own origin) with no `integrity=` attribute; a resource loaded from a third party with no integrity hash is unverified at the browser's own last line of defense against a CDN compromise. W3C Subresource Integrity spec: SRI "defines a mechanism by which user agents may verify that a fetched resource has been delivered without unexpected manipulation," defending against "an attacker who can replace the file on the Content Delivery Network (CDN) server." The framework injecting `integrity` automatically at build time (e.g. a Vite/webpack SRI plugin), rather than it appearing in the source template, is not the finding — check the build config for such a plugin before flagging the source-level absence.
|
|
45
|
+
- [ ] `search_code` server/middleware config (Helmet, Next.js `headers()`, a CSP `<meta>` tag) for a `Content-Security-Policy` with a `script-src` directive; report its absence, or a `script-src` that includes `'unsafe-inline'`/`*` alongside third-party hosts found in the manifest or via the SRI check above, as a control that would not stop an unvetted script origin from executing. OWASP A03:2025 prevention guidance: "Only obtain components from official (trusted) sources over secure links." CSP set at the reverse-proxy/CDN edge (Cloudflare, hosting-platform headers config) rather than in application code is not the finding — confirm via deployment documentation before flagging as absent.
|
|
46
|
+
|
|
37
47
|
## Impersonation and unvetted origin
|
|
38
48
|
|
|
39
|
-
- [ ] Internal-looking package names resolved from a public registry rather than a private one —
|
|
40
|
-
- [ ]
|
|
49
|
+
- [ ] Internal-looking package names resolved from a public registry rather than a private one — Read the manifest for names that look like internal tooling (`@company/*`, `internal-*`) and confirm they resolve from a scoped/private registry, not the public one, where a typosquat could sit under the same unscoped name. Rule out first — an org that has legitimately claimed and publishes under that same scope on the public registry looks identical to a typosquat vector from source alone; confirm via the registry's own ownership/verification page or an org-level `.npmrc` mapping before flagging as unvetted. Duan, Wu, Ji, Rhee, Guo, Bhaskar, Chen & Jiang, "Towards Measuring Supply Chain Attacks on Package Managers for Interpreted Languages," NDSS 2021 — 339 malicious packages found across npm/PyPI/RubyGems, 278 confirmed by the registries, three exceeding 100,000 downloads each.
|
|
50
|
+
- [ ] Read the manifest's dependency names and flag any within a one- or two-character edit distance of a well-known, heavily-downloaded package (`lodash`/`lodahs`, `express`/`experss`, `chalk`/`chalks`) that is not itself the declared dependency. A near-miss name is either a legitimate, deliberately-named internal package or a typosquat riding on a fat-fingered `npm install` — the auditor states which before treating it as either. Rule out a known scoped fork, an intentionally similar in-house polyfill with its own README explaining the name, or a package confirmed via the registry's ownership page as the real, verified maintainer.
|
|
51
|
+
- [ ] Vendored or copied third-party code with no recorded origin — `search_code` for a directory of third-party-looking code with no corresponding manifest entry, no `LICENSE`, and no comment naming its source or version. This is the one class of risk no dependency tool will ever surface, because it was never declared a dependency at all. `dependencies-licensing.md` owns the licensing angle of the same finding (does the retained code carry its original license and attribution); this module's angle is narrower — nobody can vouch for what the code actually does.
|
|
41
52
|
|
|
42
53
|
## Out of static reach
|
|
43
54
|
|
|
44
55
|
- Whether a registry package's published tarball actually matches its public source repository at that version — requires fetching and diffing both, not reading the manifest.
|
|
45
|
-
- Runtime behaviour of any postinstall script or `binding.gyp`-triggered native build — this module can enumerate that scripts (or build files) exist, not what they do without executing them.
|
|
56
|
+
- Runtime behaviour of any postinstall script or `binding.gyp`-triggered native build — this module can enumerate that scripts (or build files) exist, not what they do without executing them — closed by `runtime.md` when execution is enabled: its frozen install (`npm ci`/`pnpm install --frozen-lockfile`) executes any postinstall script and its exit code/output become observable.
|
|
46
57
|
- Whether `--ignore-scripts` (or its equivalent) is actually honoured at install time in CI, versus merely configured somewhere and silently overridden.
|
|
47
58
|
- Registry-level compromise of a dependency between the version pinned in the lockfile and what a fresh resolve would fetch today.
|
|
48
59
|
- Whether the SBOM checked into the release matches the artefact that was actually built and shipped, rather than one generated from a different commit.
|
|
60
|
+
- Whether the humans who can publish a dependency protect that access with 2FA — this module can see who this repo trusts to publish its own artefact, not who a third-party maintainer trusts with theirs.
|
|
61
|
+
- Whether a dangerous-workflow pattern (untrusted input injected into a shell step) is live-exploitable right now — this module can show the pattern exists in source, not that an attacker has a path to trigger it in this repository's current permission and branch-protection configuration.
|
|
62
|
+
- Whether a build platform that requests SLSA L3 genuinely provides its isolation guarantee — that isolation is a property of the CI provider's runtime infrastructure, not of the workflow YAML; the YAML shows what was requested, not what the runner actually enforced.
|
|
63
|
+
|
|
64
|
+
## What browser observation closes
|
|
65
|
+
|
|
66
|
+
Applies only when `browser.md` ran; findings here are `observed` and cite the bundle path with a line or step number.
|
|
67
|
+
|
|
68
|
+
| Artefact | Gap it closes | Observed instance earns |
|
|
69
|
+
|---|---|---|
|
|
70
|
+
| `network.jsonl`, `console.jsonl`, `read_page` output | A third-party script/style host actually loading has no matching `integrity=` in the served markup, and no CSP `script-src` restricting it (cross-checked against the static SRI/CSP findings above) | High |
|
|
71
|
+
| `network.jsonl`, cross-referenced against `search_code` of the manifest/lockfile | A script loading from a public CDN host (`unpkg.com`, `cdn.jsdelivr.net`, `cdnjs.cloudflare.com`) has no corresponding entry in the manifest or lockfile at all — an undeclared dependency none of this module's lockfile-integrity, min-release-age, or provenance checks ever covered | High |
|
|
49
72
|
|
|
50
73
|
## Severity guidance
|
|
51
74
|
|
|
@@ -62,3 +85,9 @@ Can the artefact you ship be trusted, and can the build that produced it be repr
|
|
|
62
85
|
| Lockfile entry missing an integrity hash | Medium |
|
|
63
86
|
| Monorepo workspace not covered by the root lockfile | Medium |
|
|
64
87
|
| No minimum-release-age / cooldown configured on the package manager | Medium |
|
|
88
|
+
| Untrusted GitHub context value interpolated directly into a `run:` shell step (CI script injection) | High |
|
|
89
|
+
| Long-lived, unscoped publish token with no 2FA/approval evidence, instead of Trusted Publishing/OIDC | Medium |
|
|
90
|
+
| Third-party script/style tag loaded cross-origin with no `integrity=` attribute | Medium |
|
|
91
|
+
| Missing or overly permissive `script-src` CSP directive against third-party origins | Low |
|
|
92
|
+
| Repository claims a SLSA level its CI workflow does not, on its face, meet | Medium |
|
|
93
|
+
| Dependency name within edit-distance of a well-known package, not itself declared (typosquat candidate) | Medium |
|
|
@@ -8,59 +8,82 @@ The instant/civil distinction this module probes for by hand is, as of ECMAScrip
|
|
|
8
8
|
|
|
9
9
|
## Storage and representation
|
|
10
10
|
|
|
11
|
-
- [ ] Every timestamp column's declared type: `search_code` the schema/migrations for date fields, then `find_symbol` the column type. `TIMESTAMP WITHOUT TIME ZONE` (or a driver default that behaves like it) storing a value the application treats as an instant is a defect — the offset is silently lost, and every read is a guess about what zone it was written in.
|
|
12
|
-
- [ ] The inverse
|
|
13
|
-
- [ ] Naive local time (`new Date()`, `datetime.now()`, `time.Now()` with no explicit zone) used at a boundary that is supposed to represent a fixed instant — a token expiry, an audit log entry, a scheduled-at field. Rule out first: a value that is genuinely display-only and never compared or persisted is not a defect.
|
|
14
|
-
- [ ]
|
|
11
|
+
- [ ] Every timestamp column's declared type: `search_code` the schema/migrations for date fields, then `find_symbol` the column type. `TIMESTAMP WITHOUT TIME ZONE` (or a driver default that behaves like it) storing a value the application treats as an instant is a defect — the offset is silently lost, and every read is a guess about what zone it was written in. `timestamp` "just stores a date and time you give it... a picture of a calendar and a clock rather than a point in time," while `timestamptz` "records a single moment in time" (PostgreSQL community, official PostgreSQL wiki, current, https://wiki.postgresql.org/wiki/Don%27t_Do_This).
|
|
12
|
+
- [ ] The inverse — Read the same column types for a genuinely civil datetime ("9am local, wherever local is") stored in a timezone-aware column. This double-converts on every read, because the column assumes a single instant and civil time by definition is not one.
|
|
13
|
+
- [ ] Naive local time (`new Date()`, `datetime.now()`, `time.Now()` with no explicit zone) used at a boundary that is supposed to represent a fixed instant — a token expiry, an audit log entry, a scheduled-at field — is `High`: `search_code` for the naive construction and read the boundary it feeds. `trace_path` between the constructing symbol and the comparison symbol establishes only that a call path exists, not that the naive value is the one actually compared — `Read` the intervening assignment chain to confirm dataflow before treating this as anything stronger than `High`. Rule out first: a value that is genuinely display-only and never compared or persisted is not a defect. The instant/civil split is exactly what `Temporal.Instant` now names in the language itself — "a single point in time ('exact time')... no time zone or calendar information is present" (TC39, official proposal-temporal docs, current, https://github.com/tc39/proposal-temporal/blob/main/docs/instant.md) — versus `timestamp`'s "picture of a calendar and a clock" (PostgreSQL community, official PostgreSQL wiki, current, https://wiki.postgresql.org/wiki/Don%27t_Do_This).
|
|
14
|
+
- [ ] `search_code` for `scheduledAt`/`sendAt`/`deliver_at`-style fields feeding a "deliver at 9am" feature, then `Read` the stored type: the instant/civil conflation itself is storing a single UTC instant instead of a wall-clock time plus a zone. This is correct in the sender's zone and wrong in every other zone, and DST will additionally shift it twice a year — a civil "9am" needs the actual wall-clock value plus a zone, not an instant already collapsed to one offset (TC39, official proposal-temporal docs, current, https://github.com/tc39/proposal-temporal/blob/main/docs/instant.md); adding a calendar day to that wall-clock value must itself preserve local time across a DST boundary, "as if the day has 25 hours" (MDN Web Docs, official reference documentation, current, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/ZonedDateTime/add).
|
|
15
15
|
|
|
16
16
|
## DST and calendar arithmetic
|
|
17
17
|
|
|
18
|
-
- [ ] Any `addDays`/`addHours`-style call used to mean "the same wall-clock time tomorrow" rather than "24 hours from now" — `search_code` for day-arithmetic helpers and read what they add. Adding 24 hours across a DST transition lands one hour off the intended wall-clock time.
|
|
18
|
+
- [ ] Any `addDays`/`addHours`-style call used to mean "the same wall-clock time tomorrow" rather than "24 hours from now" — `search_code` for day-arithmetic helpers and read what they add. Adding 24 hours across a DST transition lands one hour off the intended wall-clock time — the calendar-aware way preserves wall-clock time instead, "as if the day has 25 hours" (MDN Web Docs, official reference documentation, current, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/ZonedDateTime/add). Rule out a call whose surrounding name/comment states duration intent (e.g. a rate-limit window, a TTL), which is correct as written.
|
|
19
19
|
- [ ] Recurring schedules (`search_code` for cron-like fields, `RRULE`, or a "repeat every" config) evaluated in a fixed offset rather than a named zone. A schedule anchored to `UTC-5` drifts by an hour relative to local time twice a year; one anchored to `America/Bogota` does not, because Bogota has no DST — the distinction matters exactly where DST exists.
|
|
20
|
-
- [ ]
|
|
21
|
-
- [ ] Whether ambiguous/nonexistent-hour disambiguation is explicit at each construction site rather than left to whatever the library defaults to — `search_code` for tz-aware datetime construction (Python's `fold` attribute or `is_dst=`, JS's `Temporal.ZonedDateTime.from(..., { disambiguation })`) with no argument supplied. Defaults genuinely differ by library and this is a common false assumption: Python's `zoneinfo` (PEP 495) and `pytz` both silently pick a side (the earlier occurrence, or `is_dst=False`) with no error, while `pandas.Series.dt.tz_localize`
|
|
20
|
+
- [ ] `search_code` for range-construction helpers (`startOf`, `endOf`, `setHours(0, 0, 0, 0)`, a `from`/`to` pair) that build a wall-clock start/end, then `Read` whether the construction is zone-aware — a range spanning a "spring forward" gap (a wall-clock hour that never occurs) or a "fall back" overlap (an hour that occurs twice) can silently normalise a nonexistent time to something else, or double-count the ambiguous hour. Calendar-aware arithmetic is exactly what preserves wall-clock intent across such a boundary rather than a raw hour count (MDN Web Docs, official reference documentation, current, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/ZonedDateTime/add); disambiguation of which occurrence a construction picks is a library default, not a language guarantee — Python's `fold` "should have the value 0 for all instances except those that represent the second (chronologically) moment in time in an ambiguous case," defaulting to the earlier occurrence when unset (Alexander Belopolsky, PEP 495, Python Enhancement Proposals, 2015, https://peps.python.org/pep-0495/).
|
|
21
|
+
- [ ] Whether ambiguous/nonexistent-hour disambiguation is explicit at each construction site rather than left to whatever the library defaults to — `search_code` for tz-aware datetime construction (Python's `fold` attribute or `is_dst=`, JS's `Temporal.ZonedDateTime.from(..., { disambiguation })`) with no argument supplied. Defaults genuinely differ by library and this is a common false assumption: Python's `zoneinfo` (PEP 495 — `fold` defaults to 0, the earlier occurrence, with no error: Alexander Belopolsky, PEP 495, Python Enhancement Proposals, 2015, https://peps.python.org/pep-0495/) and `pytz` both silently pick a side (the earlier occurrence, or `is_dst=False`) with no error, while `pandas.Series.dt.tz_localize`'s `ambiguous` and `nonexistent` parameters both "default to `'raise'`," raising `ValueError` unless the caller explicitly picks another option (pandas core team, official pandas API reference, current, https://pandas.pydata.org/docs/reference/api/pandas.Series.tz_localize.html) — a codebase mixing both in one pipeline can have one path fail loudly and the adjacent one fail silently on the same kind of input.
|
|
22
22
|
- [ ] Month-end and leap-year arithmetic: adding a month to 31 January, or a year to 29 February. `search_code` for manual `setMonth`/`setDate`/`setFullYear` chains rather than a date library's calendar-aware add.
|
|
23
|
-
- [ ]
|
|
24
|
-
- [ ] A container/base-image build (`Dockerfile`, base-image manifest) with no mechanism to keep its bundled tz database current — `search_code` the Dockerfile for a `tzdata` package install with no update step, or a base image pinned by digest with no rebuild trigger. The IANA tz database releases several times a year whenever a government changes DST/offset rules (real 2026 examples: Alberta moving to permanent UTC-6, Morocco moving to permanent UTC+0); an image built once and never rebuilt computes the *old* rule for that zone until it is, which reproduces as "the time is right most of the year, then off by an hour around the transition." This is a `read` finding on the Dockerfile itself, not a claim about the deployed environment's actual tzdata version — that stays under Out of static reach.
|
|
23
|
+
- [ ] `search_code` for week-number computation literals (`getISOWeek`, `weekStartsOn`, `%V`, `isoWeekYear`) and compare the report path's hits against the UI path's — ISO week vs. US week, week start on Sunday vs. Monday, applied inconsistently between the two.
|
|
24
|
+
- [ ] A container/base-image build (`Dockerfile`, base-image manifest) with no mechanism to keep its bundled tz database current — `search_code` the Dockerfile for a `tzdata` package install with no update step, or a base image pinned by digest with no rebuild trigger. The IANA tz database releases several times a year whenever a government changes DST/offset rules (real 2026 examples: Alberta's last DST change before moving to permanent UTC-6, Morocco moving to permanent UTC+0 on 2026-09-20 — IANA, official IANA release notes, 2026, https://www.iana.org/time-zones/releases/2026c); an image built once and never rebuilt computes the *old* rule for that zone until it is, which reproduces as "the time is right most of the year, then off by an hour around the transition." This is a `read` finding on the Dockerfile itself, not a claim about the deployed environment's actual tzdata version — that stays under Out of static reach.
|
|
25
25
|
|
|
26
26
|
## Serialisation and boundaries
|
|
27
27
|
|
|
28
|
-
- [ ] Every wire boundary — API response, queue payload, log line, cache key — for date fields: does serialisation preserve the offset (ISO 8601 with `Z`/offset, or an explicit epoch) or silently drop it (a bare `YYYY-MM-DD HH:mm:ss`)? `search_code` the serializer/formatter used at each boundary. A numeric offset alone (`-04:00`) doesn't say which named zone/DST rule produced it — RFC 9557
|
|
28
|
+
- [ ] Every wire boundary — API response, queue payload, log line, cache key — for date fields: does serialisation preserve the offset (ISO 8601 with `Z`/offset, or an explicit epoch) or silently drop it (a bare `YYYY-MM-DD HH:mm:ss`)? `search_code` the serializer/formatter used at each boundary. Every timestamp is required to carry `Z` or a numeric `±HH:MM` offset (G. Klyne, C. Newman, RFC 3339, IETF, 2002, https://www.rfc-editor.org/rfc/rfc3339.html). A numeric offset alone (`-04:00`) doesn't say which named zone/DST rule produced it, since it "makes no claims about the UTC offset of other related timestamps" (IETF, RFC 9557, 2024, https://datatracker.ietf.org/doc/html/rfc9557.html) — RFC 9557 ("Date and Time on the Internet: Timestamps with Additional Information") defines the Internet Extended Date/Time Format (IXDTF, the format `Temporal.ZonedDateTime.toString()` emits), which adds a bracketed zone-name suffix (`-04:00[America/New_York]`) precisely to keep that disambiguated across a wire boundary; its absence isn't a defect on its own, but a codebase reinventing the same suffix ad hoc is a signal to check the two ends actually agree on the convention.
|
|
29
|
+
- [ ] A timestamp parser or wire-format validator that hard-codes the seconds range to `00-59` (JSON Schema `date-time` validators, hand-rolled regexes) rather than RFC 3339's `00-60` — `search_code` for the seconds-range pattern and `Read` it. RFC 3339 permits a seconds value of 60 for leap-second insertion, e.g. `1990-12-31T23:59:60Z` (G. Klyne, C. Newman, RFC 3339, IETF, 2002, https://www.rfc-editor.org/rfc/rfc3339.html). A payload from an upstream source that emits raw (non-smeared) UTC during a leap second fails validation or silently loses the extra second — most providers avoid this by smearing the leap second across a 24-hour window instead of stepping it (Google, official Google Developers documentation, current, https://developers.google.com/time/smear). Refuted if every upstream source actually consumed applies a leap smear rather than a raw step, confirmed via `search_code`/`Read` — the path is then unreachable and the finding drops to Info.
|
|
30
|
+
- [ ] `trace_path` from a producer emitting an RFC 9557 bracketed-zone suffix (`Temporal.ZonedDateTime.toString()`, or hand-built `...Z[America/New_York]`) to a consumer whose parser is strict RFC 3339 (JSON Schema `date-time`, an older date library). The bracket is an extension outside the base RFC 3339 grammar (IETF, RFC 9557, 2024, https://datatracker.ietf.org/doc/html/rfc9557.html; G. Klyne, C. Newman, RFC 3339, IETF, 2002, https://www.rfc-editor.org/rfc/rfc3339.html), so a strict parser on the receiving end can reject the whole string rather than degrade gracefully. Refuted if the consumer is confirmed IXDTF-aware (a current Temporal-based parser, or a pre-strip step removing the suffix) before ingestion — check the parsing library and its version.
|
|
31
|
+
- [ ] A serializer/parser normalizing `-00:00` to the same value as `Z`/`+00:00` — `search_code` offset-parsing/normalization logic and `Read` it. RFC 3339 defines `-00:00` as a distinct convention meaning "UTC, but the true local offset is unknown" (G. Klyne, C. Newman, RFC 3339, IETF, 2002, https://www.rfc-editor.org/rfc/rfc3339.html), a materially different claim than `Z`; collapsing the two discards a deliberate "we don't know the source's zone" signal. Refuted if `search_code` confirms no producer in this codebase or its declared upstreams ever emits `-00:00` — the path is unreachable, drop to Info.
|
|
29
32
|
- [ ] A queue payload or webhook body carrying a naive timestamp string with no documented zone contract between producer and consumer — `trace_path` from producer to consumer to confirm both sides agree, rather than assuming they do.
|
|
30
|
-
- [ ]
|
|
33
|
+
- [ ] `find_callers` on the timestamp accessor/getter identified under Storage and representation above, and `Read` each call site's comparison — an instant compared to a civil datetime, or a stored UTC value compared to a freshly-constructed local `Date` without normalising both sides first (TC39, official proposal-temporal docs, current, https://github.com/tc39/proposal-temporal/blob/main/docs/instant.md).
|
|
31
34
|
- [ ] `now()` (or its language equivalent) called more than once within a single logical operation — `search_code` for repeated `Date.now()`/`time.Now()` calls inside one function or one request. Two calls milliseconds apart can straddle a rounding boundary and disagree, and a "created before it expired" check built from two separate `now()` reads is not atomic.
|
|
32
35
|
|
|
33
36
|
## Clock as a dependency
|
|
34
37
|
|
|
35
38
|
- [ ] `Date.now()`, `new Date()`, or the platform equivalent called directly deep inside business logic rather than through an injected clock/`now` parameter. `find_callers` on the logic function — if none of its callers can supply a fixed time, the logic is untestable for anything time-dependent and every "what happens near midnight / near expiry" case is unverifiable without wall-clock waiting.
|
|
36
|
-
- [ ]
|
|
39
|
+
- [ ] A duration or elapsed-time measurement (`end - start`, a timeout deadline, a rate-limit window) built from two wall-clock reads (`Date.now()`, `time.time()`, `System.currentTimeMillis()`) rather than a monotonic clock (`process.hrtime()`, `time.monotonic()`, `System.nanoTime()`) — `search_code` for the subtraction pattern, then `Read` what consumes the result. A wall clock can step backward (NTP correction, leap second, manual adjustment), producing a negative duration an unguarded consumer was never written to handle — Cloudflare's 2017 leap-second outage traced back to exactly this: a negative interval from a non-monotonic clock reached Go's `rand.Int63n()`, which panics on a negative argument, taking down RRDNS for ~6.75 hours, root-caused to "the belief that time cannot go backwards" (Cloudflare, official Cloudflare blog, post-mortem, 2017, https://blog.cloudflare.com/how-and-why-the-leap-second-affected-cloudflare-dns/). Refuted if the negative-duration path is defensively clamped (e.g. `max(0, diff)`) before use, or the value only feeds a log line rather than control flow.
|
|
40
|
+
- [ ] `find_symbol` the expiry/verify function, then `Read` its comparison for arithmetic: off-by-one at the boundary (`<` vs `<=` against the expiry instant), and which clock performs the check — client-supplied time versus server time. A client clock that is wrong, or deliberately manipulated, must never be the authority for an expiry decision. `security.md` owns the auth-token/session-expiry instance of this check; this module keeps the general clock-arithmetic angle (any expiry or TTL, not only auth).
|
|
37
41
|
- [ ] Cron/schedule expressions read against their documented intent — `search_code` the expression and compare it to what the surrounding comment or config name claims it does. A drifted expression (`0 0 * * 1` labelled "daily") is a silent scope change.
|
|
38
|
-
- [ ] What happens to a missed scheduled run (process was down, deploy in progress): does the job catch up, skip, or run every missed occurrence at once on restart? `find_callees` from the scheduler entry point to see if a catch-up path exists at all.
|
|
42
|
+
- [ ] What happens to a missed scheduled run (process was down, deploy in progress): does the job catch up, skip, or run every missed occurrence at once on restart? `find_callees` from the scheduler entry point to see if a catch-up path exists at all. For a Kubernetes CronJob specifically, whether `.spec.startingDeadlineSeconds` is set — `search_code`/`Read` the manifest. Left unset on a short-interval schedule (e.g. every minute), a multi-hour outage can cross the controller's built-in safety cutoff for accumulated missed schedules, after which it silently stops scheduling further runs with no application-level signal (Kubernetes project, official Kubernetes documentation, CronJobs, current, https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/). Refuted if an external heartbeat/dead-man's-switch monitor already watches for the CronJob's absence of runs, so the silent stop is not actually silent to operators.
|
|
39
43
|
|
|
40
44
|
## Presentation
|
|
41
45
|
|
|
42
46
|
- [ ] User-facing date/time formatting rendered in the server's zone rather than the user's — `search_code` for a formatter call with no zone argument on a value ultimately shown to a user. Cross-reference `i18n.md` for locale-specific format conventions (12h/24h, date order); this module owns whether the *zone* is right, `i18n.md` owns whether the *format* is right.
|
|
43
47
|
|
|
48
|
+
## What browser observation closes
|
|
49
|
+
|
|
50
|
+
Applies only when `browser.md` ran; findings here are `observed` and cite the bundle path with a line or step number.
|
|
51
|
+
|
|
52
|
+
| Artefact | Gap it closes | Observed instance earns |
|
|
53
|
+
|---|---|---|
|
|
54
|
+
| `steps.md` (header: URL, revision, viewport) + `screenshots/` (rendered timestamp) + `network.jsonl` (raw API timestamp for cross-reference) | User-facing timestamp rendered in the server's zone rather than the local zone of the machine running the walker. Refuted if the displayed time is explicitly and correctly labelled as the shared/business zone (e.g. a shared-calendar "9:00 AM EST") rather than presented as the viewer's own local time. | Medium |
|
|
55
|
+
| `screenshots/`/`final-state.md` (rendered countdown/expiry state) cross-referenced against `steps.md`'s per-step monotonic elapsed timestamp | A displayed expiry/countdown still shown as valid/active well past the interval it originally announced, judged from the flow's own elapsed time rather than a captured server-reported expiry value (`network.jsonl` records a response body only on 4xx/5xx, so a 200 API response's expiry field is not in the bundle). Refuted if the UI only re-checks expiry on the next user action and the walk never triggered that action. | Medium |
|
|
56
|
+
| `steps.md` (per-step monotonic elapsed timestamp) + `screenshots/` at two points in one flow | A "time ago"/countdown display that never advances, or jumps discontinuously, across the flow's real elapsed time. Refuted if the flow's real elapsed time was too short for the display to be expected to change at its stated granularity. | Low |
|
|
57
|
+
|
|
44
58
|
## Out of static reach
|
|
45
59
|
|
|
46
60
|
- Whether a DST transition actually reproduces the bug in the deployed environment's real timezone database version.
|
|
47
61
|
- Clock skew between distributed nodes at runtime.
|
|
48
62
|
- Whether a cron scheduler's actual trigger times match the expression under real load (delayed execution, overlapping runs).
|
|
49
63
|
- User-perceived correctness of "relative time" displays ("3 hours ago") as real time elapses.
|
|
64
|
+
- Whether a future leap second will actually be announced and inserted — this module reads today's tz rules, not the Earth's rotation forecast.
|
|
65
|
+
- Whether the production clock source smears or steps a leap second — that is a runtime clock-source property no static probe reads.
|
|
66
|
+
- Whether users in timezones the browser walk never emulated see a correctly zoned timestamp — this module observes one emulated profile, not the real population.
|
|
67
|
+
- A rendered timestamp against an actually-emulated non-local timezone — no tool in `browser.md`'s catalogue emulates a timezone (`chrome-devtools`'s `emulate` covers device and network conditions only); the browser-zone comparison this module can run is limited to the walker machine's own local zone against the server's zone.
|
|
50
68
|
|
|
51
69
|
## Severity guidance
|
|
52
70
|
|
|
53
71
|
| Situation | Severity |
|
|
54
72
|
|---|---|
|
|
55
|
-
| Instant stored as naive local time at a security-relevant boundary (token/session expiry) |
|
|
73
|
+
| Instant stored as naive local time at a security-relevant boundary (token/session expiry) | High |
|
|
56
74
|
| Expiry checked against client-supplied clock | High |
|
|
57
75
|
| Timestamp column type disagrees with what the application treats it as | High |
|
|
58
76
|
| Serialisation drops offset at a cross-service boundary | High |
|
|
77
|
+
| RFC 9557 IXDTF-suffixed timestamp fed to a strict RFC-3339-only consumer, path confirmed via `trace_path` | High |
|
|
78
|
+
| Duration/timeout built from two non-monotonic wall-clock reads with no negative-value guard | High |
|
|
59
79
|
| `addDays`-style arithmetic used across a DST boundary for wall-clock intent | Medium |
|
|
60
80
|
| Ambiguous/nonexistent-hour disambiguation left to an unstated library default | Medium |
|
|
61
81
|
| `now()` called multiple times in one operation with no single source of truth | Medium |
|
|
62
82
|
| Hardcoded clock access preventing time-dependent logic from being tested | Medium |
|
|
63
83
|
| Missed-schedule catch-up behaviour undefined | Medium |
|
|
84
|
+
| Kubernetes CronJob missing `startingDeadlineSeconds` on a short-interval schedule | Medium |
|
|
64
85
|
| User-facing time rendered in server zone instead of user zone | Medium |
|
|
65
86
|
| Base image with no tzdata update mechanism | Low |
|
|
66
87
|
| Week-numbering or month-end drift between two surfaces | Low |
|
|
88
|
+
| Timestamp parser hard-codes the seconds range to `00-59`, rejecting a valid leap-second `:60` | Low |
|
|
89
|
+
| Serializer/parser normalizes `-00:00` to the same value as `Z`/`+00:00` | Low |
|