Security suites from the 2026-12 audit: static rules, attack probes, per-class tests, gate
- doctor: code-patterns (unescaped HTML/JSON-LD, eval, shell, NEXT_PUBLIC_ secrets, overrideAccess / Local API user, where from the request, redirects and fetches to a request address) and config-dangerous; live-probes runs the safe attack probes on --url - ATTACK_PROBES / runAttackProbes / createProbeContext exported from /doctor; the reference site runs all of them in pnpm e2e:built (both bundlers) plus CSRF and cookie flags; project template iapl-audit/resources/attack-probes.spec.template.ts - test/securityPatterns.test.ts gates every hit against test/security-patterns.allow.json; test/securityClasses.test.ts covers XSS, redirects, pollution, logs, DoS, cache poisoning - pnpm security:gate (pnpm audit --prod, the two suites, optional offline ZAP) in prepublishOnly - audit findings F1, F3, F4, F5 reproduced as expected-to-fail tests/probes; no fix built - docs: security.md threat list + Security suites, doctor.md, AGENT.md, CHANGELOG, skills Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
a416411f01
commit
d2f19095dc
@@ -123,6 +123,9 @@ Turn off: `iapl({ doctor: false })`. Adapt: `iapl({ doctor: { tokenVar: 'MY_TOKE
|
||||
| | `staff-accounts-open` | error (warning for `read`, `readVersions`) | (deep) a staff collection that an account of another, non-staff auth collection may create in, read (also its versions), update, delete from or unlock — it can make itself staff, change a staff password, list the accounts or lift a login lock. The account rules are off (`accounts: false`, `adminOnlyCreate` / `adminOnlyWrite` / `staffOnlyRead: false`) or the project's own rule is wider. Asked with a made-up outside account; a rule that throws counts as closed |
|
||||
| | `turnstile-degraded` | warning / error | (deep) Turnstile is checking forms; while it is not (wrong or missing secret, Cloudflare down) a warning, an error once it has lasted 24 hours (counted from the recorded start to now) |
|
||||
| | `turnstile-env-key` | warning | (deep) the Turnstile secret key is in the panel, not in the deprecated `TURNSTILE_SECRET_KEY` environment variable |
|
||||
| | `code-patterns` | error / warning | the project's own code (`src/`, seeds, migrations, scripts and tests left out where the rule is about requests): `dangerouslySetInnerHTML` / `innerHTML` with a value no sanitizer passed, JSON in a `<script>` without escaping `<` (`code-inner-html`); `eval` / `new Function` / `vm` (`code-eval`); a shell command from a template string (`code-shell`); a `NEXT_PUBLIC_` secret, or a server secret read in a `'use client'` file (`code-public-secret`); `overrideAccess: true` where a request reaches (`code-override-access`); the Local API given a `user` without `overrideAccess: false` — Payload then ignores the user (`code-local-api-user`); a `where` taken from the request (`code-raw-where`); a redirect (`code-open-redirect`) or a server-side `fetch` (`code-ssrf`) to an address from the request. One finding per rule and file. A correct place: `// iapl-security-ok: <why>` on the line or the line above; a file or folder: `iapl-doctor.json` `rules: { "code-override-access": { "files": ["src/lib/admin/**"], "off": true, "reason": "…" } }` (security.md "Security suites") |
|
||||
| | `config-dangerous` | error / warning | `next.config`: `images.dangerouslyAllowSVG` without `images.contentSecurityPolicy` (error), `remotePatterns` hostname `**` / `*`, `serverActions.allowedOrigins` with `*` (error), `productionBrowserSourceMaps: true`; `payload.config`: `cors: '*'`, `debug: true`, GraphQL playground / introspection on in production, `maxDepth` above 20 |
|
||||
| | `live-probes` | error / warning | (live, `--url`) the plugin's attack probes that change nothing: source / env / git files, secrets in the page scripts and public source maps, `x-middleware-subrequest` proxy bypass, open redirects, `X-Forwarded-Host` in redirects and links, Markdown / RSC answers a cache could store as the page, `$ne` operators in a sign-in, anonymous `where` / draft / versions / GraphQL reads, stack traces, unbounded `limit`, `/_next/image` to inner hosts or SVG, headers on every kind of answer, odd methods and an unknown Server Action. Reported as `live-probes:<id>`; the 8 MB-body probe runs only in the Playwright spec (security.md "Security suites") |
|
||||
| | `storage-names` | warning | the visitor cookie the layout sets (`<PageStats visitorCookie>`, default `ipal_vid`) is the one the config makes the cookie scanner declare (`storageNames`, stats.md) |
|
||||
| | `cookie-scanner` | error / warning / info | `cookieScanner` on (with `crawl`, else info); deep: nothing waits for approval (warning) |
|
||||
| mail | `mail-method` | error / info | (deep) the chosen "Sending method" can be used — "Own SMTP server" with server, user name and password, "Microsoft Graph" with the `GRAPH_*` variables; otherwise e-mails are not sent and nothing is sent another way (error). On Postgres / SQLite: the column of `emailMethod` exists — the 1.17.1 migration has run (error). Nobody has chosen yet: the site picks a method from what is filled in until Site integrations is saved (info) |
|
||||
|
||||
Reference in New Issue
Block a user