[high] OIDC callback trusts state from the query string when the session is missing #9
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: high
Affects: main (also present on jtk/ebook-management)
File: lib/fuzzy_catalog_web/controllers/oidc_controller.ex:60-69
If the session has no oidc_state, it uses params["state"] with nonce nil, so the state check compares the attacker's value with itself. That's login CSRF: a victim's browser gets logged in as the attacker's account.
Fix: delete the params fallback (and the oidc_session_params fallback); missing session state → 'session expired'. Also stop String.to_atom on session keys (:90).
Found by Nye's audit, 2026-10-18 (static review of main @
1d89af4and jtk/ebook-management @43a849e).