Commit Graph

12 Commits

Author SHA1 Message Date
pewdiepie-archdaemon 7e485919ea Polish email reply and task controls 2026-06-01 23:02:25 +09:00
Jamieson O'Reilly e5ec82475c Fix email-thread HTML injection, attachment path traversal, and missing authz (#475)
Hardens issues found in a security review of the current tree (separate from
the cookbook SSH PR):

- Email thread rendering (static/js/emailLibrary.js): the flat read path runs
  inbound HTML through the allowlist sanitizer, but the two threaded paths
  (_renderTurnsAsBubbles / _renderTurnsFromServer — the default view) injected
  server-parsed `body_html` raw into the DOM. A crafted inbound email could
  inject arbitrary markup (phishing/form/credential-capture/tracking; full XSS
  if a deployment relaxes the script CSP). Now sanitized on all paths.

- Attachment extraction (routes/email_routes.py, routes/email_helpers.py): the
  on-disk extraction dir was `ATTACHMENTS_DIR / f"{folder}_{uid}"` with
  user-controlled folder/uid and no containment, so a folder like `../../tmp`
  could escape ATTACHMENTS_DIR. New attachment_extract_dir() flattens both to a
  single safe segment and asserts containment.

- Diagnostics routes (routes/diagnostics_routes.py): /api/db/stats,
  /api/rag/stats, /api/test/youtube, /api/test-research relied only on the
  global session check (any logged-in user). Now require_admin-gated.

- Defense-in-depth HTML escaping: session HTML export escapes the session name
  (routes/session_routes.py); the MCP OAuth page escapes the reflected Host
  header / server_id (routes/mcp_routes.py).

- Internal-tool token now compared with secrets.compare_digest (constant time)
  in core/middleware.py and app.py.

Adds regression tests in tests/test_security_regressions.py.
2026-06-01 22:20:17 +09:00
pewdiepie-archdaemon 190423211a Polish email tasks and window controls 2026-06-01 20:56:46 +09:00
Afonso Coutinho 23468c3a6b Keep Cc recipients in reply-all
* fix: populate window._myEmailAddress from the active email account

* fix: keep Cc recipients in reply-all when own address is empty or unknown

* test: cover reply-all recipient building (issue #360)
2026-06-01 18:29:22 +09:00
pewdiepie-archdaemon 0d53ded340 Prewarm email list before first open 2026-06-01 14:25:17 +09:00
pewdiepie-archdaemon 4f68041926 Keep email reader height stable while loading 2026-06-01 14:19:07 +09:00
pewdiepie-archdaemon e8e0080ff1 Stabilize email card expansion loading 2026-06-01 13:58:27 +09:00
pewdiepie-archdaemon 3ecdfb4a77 Make email escape close reliable 2026-06-01 13:21:12 +09:00
pewdiepie-archdaemon af78253b65 Revert "Keep email list mounted between opens"
This reverts commit 8579333b62.
2026-06-01 13:20:03 +09:00
pewdiepie-archdaemon 8579333b62 Keep email list mounted between opens 2026-06-01 13:17:58 +09:00
pewdiepie-archdaemon 3f062b952d Prefetch adjacent emails while reading 2026-06-01 13:14:47 +09:00
pewdiepie-archdaemon e5c99a5eee Odysseus v1.0 2026-05-31 23:58:26 +09:00