clusev/app/Livewire
boban 9a6c09e488 fix(2fa): close two re-view holes in backup-codes show-once
Stored recovery codes were re-viewable two ways after their one-time
reveal. Both paths are now closed so codes are only viewable/downloadable
right after a fresh generation (enrollment or regenerate).

HOLE 1 — RecoveryCodes::$revealed was a mutable public Livewire prop, so
a crafted /livewire/update could flip it to true and make render() emit
stored codes. Annotated with #[Locked]; Livewire now rejects any
client-side write (set still happens server-side in mount()/regenerate()).

HOLE 2 — two-factor.recovery.download was auth-gated only, so any authed
user could GET it anytime to re-download stored codes. Added a one-time
session grant (2fa.download_grant) put alongside the existing
2fa.codes_fresh wherever codes are freshly generated (TwoFactorSetup,
WebauthnKeys, RecoveryCodes::regenerate); the route now
abort_unless(pull(grant), 403) before streaming — one download per fresh
generation, later direct hits 403.

Tests: lock rejection + download-grant lifecycle (forbidden → granted ok
→ consumed forbidden). Full suite 137 passed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 06:21:45 +02:00
..
Audit feat(audit): configurable retention + scheduled clusev:prune-audit 2026-06-14 23:40:17 +02:00
Auth fix(2fa): close two re-view holes in backup-codes show-once 2026-06-15 06:21:45 +02:00
Concerns feat(ssh): wire real fleet data over SSH (FleetService + live poller) 2026-06-12 21:34:13 +02:00
Files feat(branding): favicons + PWA manifest, and custom branded error pages 2026-06-14 15:27:49 +02:00
Modals fix(2fa): close two re-view holes in backup-codes show-once 2026-06-15 06:21:45 +02:00
Servers fix(ui): set active server at mount only (race-free) 2026-06-14 19:43:24 +02:00
Services fix(services): cap live journal at 200 rows in a scrollable, auto-sticking box 2026-06-14 20:58:48 +02:00
Settings fix(2fa): close two re-view holes in backup-codes show-once 2026-06-15 06:21:45 +02:00
System feat(system): auto-restart sentinel — one-click restart via host watcher (no docker socket) 2026-06-14 23:42:50 +02:00
Versions feat(i18n): bilingual foundation (DE/EN) + localize auth/dashboard/servers/fleet/account 2026-06-13 22:36:16 +02:00
Dashboard.php i18n: complete DE/EN localization (modals, shell, backend) + v0.3.0 2026-06-13 23:27:42 +02:00
ServerSwitcher.php fix(ui): keep the sidebar server-switcher in sync with the viewed server 2026-06-14 19:24:56 +02:00