Follow-up hardening after the account-adoption gate (GHSA-vf58 / 2.6.0)
I maintainer di solito rispondono entro 5 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- javascript
- Ambito
- authentication, backend, security
Direzione di ricerca
L’issue non indica alcun file; inizia separando i sei filoni di hardening e leggendo la risoluzione delle sessioni nel core, il middleware delle richieste del plugin, onLogin/getUserInfo e l’integration harness descritto in #230. Conferma quale filone non è ancora assegnato, poiché il lavoro sulla hook-provenance ha già una prima PR. Il lavoro è concluso quando il comportamento selezionato è coperto da test, inclusi i casi rilevanti di fail-closed o authenticated-source.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Follow-up hardening after the account-adoption gate (2.6.0 / GHSA-vf58-5v5f-mvpm)
2.6.0 shipped the account-adoption gate: a new OAuth login adopts an existing hdb_user only when the claim is a verified email from an authenticated source (a JWKS-signature-verified OIDC id token with a validated issuer, or GitHub's authenticated email fetch). This issue tracks the hardening deliberately deferred from that release.
1. Durably neutralize pre-existing (pre-gate) sessions — incl. the operations API
The gate governs new logins. Sessions established before upgrading persist (Harper does not expire sessions by default) and may still hold a raw claim as their identity. The operations API resolves a session cookie to an hdb_user role in Harper core, on a listener the plugin's request middleware never wraps — so a plugin-level request-time check can't reach it, and a plugin-level startup sweep is only best-effort (fail-open on storage errors; a mixed-version rolling-upgrade window). The interim mitigation is documented (operator clears system.hdb_session fleet-wide on upgrade).
Proposed durable fix: a session provenance epoch in core — a marker/epoch that core's session resolution checks, so pre-gate sessions fail closed uniformly on both the app-server and operations-API paths without a per-plugin sweep. Everyone re-logs in once (same cost as clearing sessions), but fail-closed. Decision to settle: targeted plugin sweep vs. a core session epoch.
2. Expose authenticated-source provenance to onLogin hooks
A hook that returns { user } is authoritative and bypasses the gate. Today the plugin strips its provenance determination before calling onLogin, so a hook can only see oauthUser.emailVerified — which an unsigned UserInfo body can assert (email_verified: true). Expose the plugin's authenticated-source signal (and ideally validated issuer + subject) on the hook's oauthUser so hook-based deployments can gate correctly, and update the hook docs/examples to use it. (2.6.0 already corrected the docs to warn against trusting bare emailVerified.) A first PR for this is open.
3. Bind accounts by stable identity, not verified email (OIDC §5.7)
Adoption keys on the verified email matching the username and never consults (iss, sub) / a provider's stable user id. A reassigned email lets a new holder inherit the prior holder's role. Use verified email to locate a candidate account, then require a stable-identity match or confirmation for the initial binding. Accepted for 2.6.0 as email-keyed adoption; this is the follow-up.
4. Provider compatibility: explicit-endpoint configs become issuer-less
An Okta (or generic) custom-auth-server config with explicit endpoints leaves issuer empty → JWKS verifies but issuerValidated is false → hookless logins that previously adopted are denied. Derive or require the issuer for JWKS-enabled providers, and fail fast at startup with an actionable error rather than silently denying at login.
5. Smaller items
- Reject UserInfo
sub!= id-tokensubon the fetchEmail path (OIDC Core §5.3.2/§5.3.4). - Storage-error availability: a transient
hdb_userread error is treated fail-closed as "account exists" → the login is denied. Secure but an availability hit; quarantining (roleless) on a read error is equally secure and more available. - Config-reload deeper hardening: apply the escape-hatch setting independently of the fallible provider config (or fail it closed on a reload error), so a snapshot that both disables the hatch and errors cannot leave it on. (2.6.0 fixed the drop-of-final-snapshot case.)
_emailProvenancelabel:getUserInfostampssigned-oidceven on the no-JWKS fallback (signatureVerified === false). Not exploitable today (the gate re-checks the flags), but the label overstates its own contract for any future consumer.
6. End-to-end integration coverage
Prove the positive path end-to-end (a signature-verified JWKS OIDC token adopts an existing account and inherits its role) and the allowUnverifiedClaimInheritance escape hatch, against a real Harper instance — the current suite proves only denial/quarantine. This also needs a harness that can disable the loopback auth bypass so an operations-API denial (403) of a neutralized session is executable. Tracked in #230.
- Lingua principale
- JavaScript
- Stelle
- 1
- Fork
- 3
- Merge medio
- 3g 8h
- PR unite (30g)
- 11
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di HarperFast/oauth
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
HarperFast/oauth#243 ·
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
HarperFast/oauth#207 ·
I maintainer di solito rispondono entro 5 giorni
-
Provider-type check in the 2.7.0 evidence path is case-sensitive while preset resolution is notAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 76/100
HarperFast/oauth#242 ·
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
HarperFast/oauth#240 ·
I maintainer di solito rispondono entro 5 giorni
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 68/100
HarperFast/oauth#230 · 1 commento ·
I maintainer di solito rispondono entro 5 giorni
Tutte le issue di HarperFast/oauth
Issue simili
-
Add google analyticsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
NCAR/music-box-interactive#628 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
remotion-dev/remotion#11847 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
phoenixframework/phoenix_live_view#4456 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
AllTheMods/ATM-10#4436 ·
I maintainer di solito rispondono entro 5 giorni