modelbeast/scripts
MODELBEAST 514ec6cdcc Security hardening from adversarial review (5-agent workflow)
Fixed confirmed findings before public exposure:
HIGH:
- upload filename path traversal → store.safe_name() strips to basename
- login rate-limit XFF bypass → key on request.client.host + per-username bucket;
  auth.check_login() burns bcrypt time on unknown users (no enumeration)
- cross-user read access → per-user isolation: guests see/use/download/delete only
  their own assets & jobs (owner sees all); WS job events scoped per-user
MEDIUM:
- unbounded upload read → bounded chunked streaming to the 1GB cap
- asset member path check → Path.is_relative_to boundary + ownership gate
- WS token-in-query-string leak → session-cookie-only WS auth
LOW:
- retry_job bypassed the per-user job cap → cap now checked on retry
- wholesale API-key injection → env_for_operator injects a paid key only to
  operators that declare it (guest local jobs never receive fal/OpenRouter keys)
- session revocation → users.session_epoch, bumped on password change
- int() 500s → 400; net-lane defense-in-depth (guests blocked by requires_env AND
  resources==net, so a mis-tagged paid op is still blocked)
+ public /api/health for serve.sh & proxy; docs/VPS.md; mb MB_TOKEN bearer auth

tests/smoke.sh: 34 checks passing incl. all new hardening.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-13 12:25:13 +10:00
..
install_brush.sh Phase 1 + framework: settings/secrets, queue lanes, job mgmt, inbox, 8 new operators 2026-07-12 21:42:27 +10:00
install_colmap.sh Phase 1 + framework: settings/secrets, queue lanes, job mgmt, inbox, 8 new operators 2026-07-12 21:42:27 +10:00
install_launchagent.sh Headless control: mb CLI, AGENTS.md handover, serve scripts; verified-current image models 2026-07-12 22:38:52 +10:00
install_mflux.sh A/B image-gen: local FLUX (mflux/MLX) + OpenRouter nano-banana operators 2026-07-12 22:31:19 +10:00
install_rmbg.sh bg_remove_local: local RMBG-2.0 background removal on MPS 2026-07-13 01:32:38 +10:00
install_sf3d.sh Phase 1 + framework: settings/secrets, queue lanes, job mgmt, inbox, 8 new operators 2026-07-12 21:42:27 +10:00
install_trellis_mac.sh Phase 1 + framework: settings/secrets, queue lanes, job mgmt, inbox, 8 new operators 2026-07-12 21:42:27 +10:00
serve.sh Security hardening from adversarial review (5-agent workflow) 2026-07-13 12:25:13 +10:00
users.py Auth + dashboard (HANDOFF2 phases 1-2): guests local-only, system snapshot 2026-07-13 12:06:52 +10:00