Repository navigation
Description
Severity: HIGH, regression since 0.10.0a1 (present on 0.10.0a2; absent on 0.9.12 with the same reflex-enterprise 0.9.7a4 wheel). Independently confirmed, including a race-free form. Security-relevant flow; release blocker for the reflex + reflex-enterprise pair. Enterprise side tracked in reflex-dev/reflex-enterprise#261.
What happens
With reflex-enterprise OIDC auth: sign in as alice in tab 1 on a protected page, log out (end session) in tab 2, then fire a protected event in tab 1 — the event is accepted as alice and a reload still shows alice, although the browser has no _oidc_* cookies left. Tab 1 logged out: a2 dev Redis 1/6, a2 prod Redis 3/6, a1 5/11, 0.9.12 6/6. Race-free form: tab 1 navigates to another site, the user logs out normally in tab 2, tab 1 presses Back → fully signed in on a1/a2 (0/3 logged out), signed out on 0.9.12 (3/3). A brand-new tab correctly lands on /login, so exposure is the same browser.
Deterministic probe: a tab that boots with a stale latest_access_token_hash_ls value in localStorage is corrected by the backend 0/3 on a2 and a1 vs 3/3 on 0.9.12; the same stale hash arriving through a live storage event (no reload) is corrected on every version.
Why
0.9.12's boot sends hydrate + update_vars_internal + on_load_internal; the update_vars_internal delta goes through get_delta, which enterprise's OIDCAuthState.get_delta overrides to reconcile the token hash (reflex_enterprise/auth/oidc/state.py _handle_latest_access_token_hash_ls_in_delta). Since #7064 the single hydrate_and_load (reflex/state.py ~L2338-2389) runs _apply_client_storage_vars (~L2367) and then self._clean() (~L2368) before building the delta (dict() ~L2375, _get_resolved_delta() ~L2379), so the browser's client-storage values never reach a get_delta override; the reply echoes the stale hash back with is_hydrated: False. update_vars_internal is still sent on client-side navigation and on storage events, which is why those paths work.
Core-only confirmation without enterprise: a state overriding get_delta (via the private rx.state._override_base_method) sees both the boot value and the navigation value on 0.9.12, only the navigation value on a2. #7064 describes the boot change as non-breaking and does not mention get_delta overrides. In the enterprise wheel only OIDCAuthState.get_delta depends on this; enforcement.install_delta_filter wraps both get_delta and dict and still works.
Suggested fix
Give hydrate_and_load the same observable contract as 0.9.12's hydrate + update_vars_internal for client-storage vars: the values applied at boot must be part of what get_delta sees (or run through the same path update_vars_internal uses), without reintroducing the two bugs #7460 fixed (no write-back of defaults on first load; computed-var writes during hydration still delivered) and without re-sending every substate. Alternative (needs a design): an explicit boot-time hook for client-storage reconciliation that enterprise moves to.
Repro and evidence
- Verifier's minimal OIDC app + driver (
vdrv.py xtab|stale|away), per-tab websocket/localStorage/cookie-sync capture, and the core-onlycoregd_app: ent_auth/verification/NOTES.md. - Explorer probes
xtab_probe.py,stale_hash_probe.pyand event timelines: ent_auth/NOTES.md. - Finding N-032 in FINDINGS.md.
Activity
linear-code commentedon Oct 7, 2026
ENG-13137
Pass boot-time client storage through get_delta overrides (reflex-dev…