# Attack plan How `im` (first), `in` and `iz` are attacked after each build step. Every finding becomes a fix commit plus, when cheap, one regression test. Attacks run only against local instances on `127.0.0.1` with scratch data. ## 1. im: authentication - Login: username enumeration by message, status, timing (unknown vs wrong password vs disabled); throttle bypass (case/whitespace variants of the email, IPv6 /64 rotation, `X-Forwarded-For` spoofing without a trusted proxy); throttle memory growth with random keys. - Pre-CSRF: login without the cookie/field, with mismatched values, cross-site form post. - 2FA: skip `/login/2fa` by going to `/` with the pending cookie; tamper/replay the pending cookie; reuse a TOTP step; brute force within the window; recovery code reuse and race (two parallel submissions). - Sessions: fixation (does login rotate the token?), cookie flags, logout really deletes, revoked session still works on live streams, `max_sessions` race. - Password reset / invite / email change: token reuse, parallel redemption race, expired token, token for another user, enumeration through `/forgot`, links leaking into logs or redirects, email change to a taken address at confirm time, confirm only one half. - Setup: `/setup` after the first user exists; two parallel setups. ## 2. im: OIDC - `/authorize`: open redirect via `redirect_uri` (prefix, case, trailing slash, userinfo `@`, encoded chars, fragments), missing/plain PKCE, `response_type` other than `code`, scope injection, `state`/`nonce` echo injection (XSS in error page), unknown/disabled client. - `/token`: code reuse (must revoke the family), code for another client, wrong `redirect_uri`, wrong verifier, expired code, client auth with the wrong secret, both basic and post at once, oversized bodies. - Refresh: reuse of a rotated token (family revocation), refresh after logout/disable, refresh for another client. - Client credentials: scopes beyond `allowed_scopes`, `audience` not a family key, disabled client. - JWT: `alg: none`, alg confusion, unknown `kid`, expired, `aud` array tricks, signature of another key, retired key still accepted after 7 days. - `/userinfo`, `/introspect`, `/revoke`: token of another client, revoked tokens. - Back-channel: does every session end reach every client; is the outbox retried; does a failure block logout. - `/logout`: `post_logout_redirect_uri` not registered (open redirect), missing `id_token_hint`. ## 3. im: machine APIs - Directory/photo/family without a token, with a user access token instead of a client token, with the wrong audience or scope, with an expired token. - Stream: cursor from the future, negative, huge; resync path; connection exhaustion. - Photo: path traversal in `{sub}`, huge upload, polyglot image (HTML/SVG in a PNG), content-type served. ## 4. im: web - CSRF on every POST (missing, wrong, other session's token). - Authorization: every admin route as a member and as anonymous (expect 404); last-admin demotion/disable; self-disable; IDOR on sessions/apps revoke (another user's id). - XSS: names, emails, client names, service names, user agents, audit data rendered everywhere (including the admin pages and mails); CSP effectiveness. - Headers on every response type (pages, JSON, SSE, assets, errors). - Input limits: very long names, emails, passwords (argon2 cost DoS), huge forms, unicode tricks (homoglyph emails, RTL override in names, NUL bytes). - `safe_next` bypasses on every `next` parameter. - Live: streams leak other users' data or keep running after sign-out. ## 5. Operational - Kill the process mid-write; restart; integrity check. Disk full during photo upload. - Backup → restore → compare. Restore refuses a tampered set. - Config: unknown keys, missing file, bad values, secret files with loose permissions. - Concurrency: 50 parallel logins, 20 parallel token exchanges with one code, SQLite busy errors surfacing as 500s. ## 6. in and iz The same web, CSRF, authz, XSS and header checks, plus: path traversal in names and blob keys, quota races with parallel uploads, chunk index/size abuse, Range header abuse, share-link password brute force, grant leakage through folder moves, trashed items reachable by grantees or links, service object namespace escape, iz role escalation, viewer writes, cross-task IDOR on attachments/comments, mail header injection via names and subjects, rule loops, reminder spam, zip bombs in sheet/slides viewers, SVG/HTML served inline.