MicroFish/frontend
Yo-LRK 8cb92768ae security: harden C1-C4 (debug-RCE, auth, denial-of-wallet, sim deadline)
Closes the four CRITICAL findings from the 2026-06-13 review.

C1 — Werkzeug debug RCE / dev server in prod:
  - FLASK_DEBUG defaults False (kills interactive-debugger network RCE)
  - production runs gunicorn (-w 1 --threads 8) via `npm run start`; Dockerfile
    builds the frontend and serves it with `vite preview` (host 0.0.0.0); gunicorn
    + uv.lock updated
  - Config.validate() now runs inside create_app() so the gunicorn path enforces
    SECRET_KEY (prod) / API_KEY / LLM / ZEP at boot

C2 — zero auth on all /api/* routes:
  - before_request API-key guard (X-API-Key / Bearer), constant-time bytes compare,
    /health + OPTIONS exempt
  - AUTH_ENABLED fail-closed parse (only explicit false/0/no/off disables)
  - frontend axios injects X-API-Key from build-time VITE_API_KEY, wired through
    docker compose build-arg -> Dockerfile ARG -> vite build (+ frontend/.env.example)

C3 — denial-of-wallet (no cost ceiling; OASIS_DEFAULT_MAX_ROUNDS was dead config):
  - OASIS_DEFAULT_MAX_ROUNDS now applied when max_rounds omitted (default 150, covers
    the 144-round demo); hard ceilings OASIS_MAX_ROUNDS_CAP / OASIS_MAX_AGENTS_CAP;
    runner always forwards the clamped rounds to the subprocess

C4 — no simulation deadline; env.step could wedge forever:
  - every env.step (initial / round-loop / interview) wrapped in asyncio.wait_for
    (OASIS_ROUND_TIMEOUT_SEC) across all 3 run scripts; per-loop total-deadline
    (OASIS_RUN_TIMEOUT_SEC); gather(return_exceptions=True) + single-platform
    try/except so one platform's failure can't skip env.close

New env vars documented in .env.example + README security section.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 17:19:05 +07:00
..
public Remove outdated README.md and update favicon in index.html 2025-12-16 20:58:48 +08:00
src security: harden C1-C4 (debug-RCE, auth, denial-of-wallet, sim deadline) 2026-06-13 17:19:05 +07:00
.env.example security: harden C1-C4 (debug-RCE, auth, denial-of-wallet, sim deadline) 2026-06-13 17:19:05 +07:00
.gitignore Add project status report and frontend documentation 2025-12-10 14:49:11 +08:00
index.html fix(i18n): set HTML lang attribute before Vue mounts via inline script 2026-04-02 14:21:09 +08:00
package-lock.json fix(security): upgrade axios, rollup, picomatch to fix 3 high severity vulnerabilities 2026-04-02 15:00:33 +08:00
package.json fix(security): upgrade axios, rollup, picomatch to fix 3 high severity vulnerabilities 2026-04-02 15:00:33 +08:00
vite.config.js security: harden C1-C4 (debug-RCE, auth, denial-of-wallet, sim deadline) 2026-06-13 17:19:05 +07:00