HERMES-GIELIE/tests
Nathan Esquenazi 3c95502979 fix(auth): harden password_hash handling in settings API
Three security issues found during review:

1. password_hash exposed via GET /api/settings
   load_settings() returned all fields including the stored hash.
   Fix: strip password_hash from the response in routes.py.

2. password_hash directly settable via POST /api/settings
   'password_hash' was in _SETTINGS_ALLOWED_KEYS, so an attacker
   could POST {password_hash: 'X'} to hijack auth without knowing
   the current password.
   Fix: exclude password_hash from _SETTINGS_ALLOWED_KEYS.
   (Use _set_password for the legitimate hash-and-store path.)

3. Security headers missing from /api/auth/login and /api/auth/logout
   These endpoints built their responses manually (bypassing j()),
   so they omitted X-Content-Type-Options etc.
   Fix: call _security_headers() before end_headers() on both.

Tests updated: renamed test to assert key absent (not just None),
added new test verifying direct password_hash POST is blocked.
2026-04-03 06:21:04 -07:00
..
__init__.py Hermes WebUI v0.1.0 — initial public release 2026-03-30 20:40:19 -07:00
conftest.py Hermes WebUI v0.1.0 — initial public release 2026-03-30 20:40:19 -07:00
test_regressions.py Hermes Web UI — Sprints 11-14: multi-provider models, settings, session QoL, alerts, polish 2026-03-31 07:02:47 +00:00
test_sprint1.py Hermes Web UI — Sprints 11-14: multi-provider models, settings, session QoL, alerts, polish 2026-03-31 07:02:47 +00:00
test_sprint2.py Hermes WebUI v0.1.0 — initial public release 2026-03-30 20:40:19 -07:00
test_sprint3.py Hermes WebUI v0.1.0 — initial public release 2026-03-30 20:40:19 -07:00
test_sprint4.py Hermes WebUI v0.1.0 — initial public release 2026-03-30 20:40:19 -07:00
test_sprint5.py Hermes WebUI v0.1.0 — initial public release 2026-03-30 20:40:19 -07:00
test_sprint6.py Hermes WebUI v0.1.0 — initial public release 2026-03-30 20:40:19 -07:00
test_sprint7.py Hermes WebUI v0.1.0 — initial public release 2026-03-30 20:40:19 -07:00
test_sprint8.py Hermes WebUI v0.1.0 — initial public release 2026-03-30 20:40:19 -07:00
test_sprint9.py Hermes WebUI v0.1.0 — initial public release 2026-03-30 20:40:19 -07:00
test_sprint10.py Hermes WebUI v0.1.0 — initial public release 2026-03-30 20:40:19 -07:00
test_sprint11.py Hermes Web UI — Sprints 11-14: multi-provider models, settings, session QoL, alerts, polish 2026-03-31 07:02:47 +00:00
test_sprint12.py Hermes Web UI — Sprints 11-14: multi-provider models, settings, session QoL, alerts, polish 2026-03-31 07:02:47 +00:00
test_sprint13.py Hermes Web UI — Sprints 11-14: multi-provider models, settings, session QoL, alerts, polish 2026-03-31 07:02:47 +00:00
test_sprint14.py Hermes Web UI — Sprints 11-14: multi-provider models, settings, session QoL, alerts, polish 2026-03-31 07:02:47 +00:00
test_sprint15.py feat: Sprint 15 — session projects, code copy button, tool card toggle 2026-04-02 00:11:49 -07:00
test_sprint16.py feat: safe HTML rendering in AI responses + active session gold style + Sprint 16 tests 2026-04-03 00:27:43 +00:00
test_sprint17.py feat: Sprint 17 -- workspace breadcrumbs, slash commands, send key setting 2026-04-03 04:13:38 -07:00
test_sprint19.py fix(auth): harden password_hash handling in settings API 2026-04-03 06:21:04 -07:00