Commit Graph

4 Commits

Author SHA1 Message Date
b2b3774dea T16.4: security_check skips the D18 refresh check where D18 is absent
Wave 16 rebuilt on main (feat/wave-16-on-main, 2026-10-06) so it can
ship without wave 11 and T13.1. main has no sliding refresh, so the one
D18 check now runs only when auth.maybe_refresh_token exists; on main
it instead proves a valid token near its expiry is still accepted.
security_check 36/36 on this branch; smoke 27/27.
2026-10-06 13:28:22 -07:00
c0b736e503 T16.3: D20 one SOP per project
- A SOP posted with no id lands on sop__<project_id>, the id pushSOP
  has always used. Creating (or moving in) a SOP under any other id on
  a project is refused with 400.
- While a project has a complete SOP, writing another complete one
  needs Project Admin (the existing rule only checked the posted row).
- New project_baseline_sop(): canonical row when complete, else the
  latest complete (pre-D20 rows). Used by /api/sops/latest with
  complete=true&project_id, project_summary, project_sop_team and
  project_qa_group, so a rogue row made before the fix cannot stay
  the baseline or the mail routing.
- Existing rows under other ids stay and keep their old rules.

Security review SEC-02 (a project_user took over the baseline and the
PM/CM/QA mail routing with one POST).

security_check.py: 36/36 with D19-D21. Against da1325c: 7 D20 checks
fail (the findings). Smoke test 27/27; seed_demo writes the canonical
id.

(cherry picked from commit 7bd5ab104d)
2026-10-06 13:27:48 -07:00
f4d74879cc T16.2: D19 uploaded files download safely
New server/files_http.py; get_wp_file uses it.
- PDF and raster images (png, jpeg, gif, webp, bmp, avif) open inline,
  as before; Cache-Control unchanged for the offline drawing cache.
- Every other type, SVG included, downloads as an attachment with
  Content-Security-Policy: sandbox; default-src 'none'.
- SVG uploads stay accepted (decided 2026-10-02: accept, download only).
- Content-Disposition: ASCII fallback + RFC 5987 filename*, control
  characters and quotes replaced. nosniff from the API too.

Security review SEC-01 (stored XSS through an SVG drawing) and SEC-15e
(non-Latin-1 names gave 500; CR/LF reached the header).

security_check.py D19: 20/20 total with D21. Against da1325c: 6 fails
(the findings); every inline/cache/access check passes on both.

(cherry picked from commit 14ecb75c88)
2026-10-06 13:27:48 -07:00
d962ab2381 T16.1: D21 session decode fails closed; PyJWT 2.15.1
decode_token treats any decode failure, and any cookie over 4096 chars,
as not signed in, and requires exp and sub. PyJWT 2.13.0 -> 2.15.1
(pip-audit: 13 advisories -> none).

Security review SEC-07: a crafted 1.6 KB cookie with no account gave
500 + stack trace; now 401.

New tests/security_check.py (no browser): D21 section 6/6. Against
da1325c with PyJWT 2.13.0 it fails 3 checks (crafted cookie 500,
token with no exp accepted, old pin) - the findings. The over-long
cookie and the two still-works checks pass on both.
Smoke test 27/27.

(cherry picked from commit 01ce7e941c)
2026-10-06 13:27:47 -07:00