MicroFish/backend/app
Yo-LRK 392a971270 security: gate unexpected-error detail to clients (residual low)
Follow-up to the traceback gate: client-facing exception detail is now gated too.

- safe_error(e) (app/utils/security.py): returns the exception string only when
  FLASK_DEBUG, otherwise a generic message. Full detail stays in server logs.
- All catch-all `except Exception` handlers in api/{graph,report,simulation}.py now
  return safe_error(e) instead of str(e); same for the persisted error fields
  (project.error / state.error / task fail messages). Typed `except ValueError`
  validation handlers (404/400) keep str(e) — those are intentional, actionable
  user messages that echo only user-supplied ids.
- graph_builder no longer puts a full traceback into the task error (logs it
  server-side with exc_info, surfaces safe_error to the client); the batch-failure
  progress message is gated too.
- README documents the CSP connect-src ↔ VITE_API_BASE_URL coupling.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 18:23:03 +07:00
..
api security: gate unexpected-error detail to clients (residual low) 2026-06-13 18:23:03 +07:00
models security: H5 traceback gate + MED tier (upload sniff, path validation, CSP) 2026-06-13 18:00:28 +07:00
services security: gate unexpected-error detail to clients (residual low) 2026-06-13 18:23:03 +07:00
utils security: gate unexpected-error detail to clients (residual low) 2026-06-13 18:23:03 +07:00
__init__.py security: H5 traceback gate + MED tier (upload sniff, path validation, CSP) 2026-06-13 18:00:28 +07:00
config.py security: address HIGH findings (stored XSS, wildcard CORS, prod log leak) 2026-06-13 17:32:36 +07:00