MicroFish/frontend
Yo-LRK ed840c7a00 security: H5 traceback gate + MED tier (upload sniff, path validation, CSP)
H5 (traceback leak, completing the prior log-level fix): new app/utils/security.py
safe_traceback() logs the full stack server-side and returns it to clients only when
FLASK_DEBUG; all 53 traceback.format_exc() in api/{graph,report,simulation}.py now call
it (import traceback removed).

Upload content sniff: upload_content_ok() magic-byte check — pdf must start %PDF-,
txt/md/markdown rejected if they contain NUL bytes (BOM-prefixed UTF-16/32/8 text
allowed). Wired into the graph.py upload loop so a renamed binary can't pass the
extension whitelist.

Path validation: validate_id() (^[A-Za-z0-9_-]{1,64}$) blocks traversal before every
id->filesystem sink — ProjectManager._get_project_dir, SimulationManager._get_simulation_dir,
ReportManager._get_report_folder + the two Report*Logger __init__, and a new
SimulationRunner._run_dir() that all RUN_STATE_DIR joins route through.

CSP / security headers: CSP <meta> in index.html, vite preview.headers
(X-Frame-Options/nosniff/Referrer-Policy + CSP frame-ancestors), and a Flask
after_request that sets the same headers on API responses.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 18:00:28 +07:00
..
public Remove outdated README.md and update favicon in index.html 2025-12-16 20:58:48 +08:00
src security: address HIGH findings (stored XSS, wildcard CORS, prod log leak) 2026-06-13 17:32:36 +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 security: H5 traceback gate + MED tier (upload sniff, path validation, CSP) 2026-06-13 18:00:28 +07:00
package-lock.json security: address HIGH findings (stored XSS, wildcard CORS, prod log leak) 2026-06-13 17:32:36 +07:00
package.json security: address HIGH findings (stored XSS, wildcard CORS, prod log leak) 2026-06-13 17:32:36 +07:00
vite.config.js security: H5 traceback gate + MED tier (upload sniff, path validation, CSP) 2026-06-13 18:00:28 +07:00