`check_origin_from_privileged_client` drops browser signalling intermediate cross-origin iframes

Aperta
#276 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
57/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Start in credentialsd/src/gateway/mod.rs at check_origin_from_privileged_client, especially the logic around lines 393–396, and trace how origin and topOrigin become client data fields. Compare the intended A → B → A behavior with the WebAuthn discussion linked in the issue. Done means intermediate cross-origin framing is represented as crossOrigin: true while preserving topOrigin: A; add or update focused tests for that case.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

credentialsd's request API has two fields to indicate the origin of a request: origin (L1) and topOrigin (L3+):

https://github.com/linux-credentials/credentialsd/blob/a2613f3942ac21725268f36d3e175093d6bec67d/credentialsd/src/gateway/dbus.rs#L71-L78

https://github.com/linux-credentials/credentialsd/blob/a2613f3942ac21725268f36d3e175093d6bec67d/credentialsd/src/gateway/dbus.rs#L343-L345

It does not have a way to explicitly set the crossOrigin field (L2), but this could be inferred in an L3+ client by topOrigin being set.

However, check_origin_from_privileged_client always treats a request with origin: A, topOrigin: A as being a same-origin request (origin: A, crossOrigin: false, topOrigin: unset):

https://github.com/linux-credentials/credentialsd/blob/a2613f3942ac21725268f36d3e175093d6bec67d/credentialsd/src/gateway/mod.rs#L393-L396

These values could also indicate a cross-origin request with (unknown) cross-origin intermediate iframes (eg: a chain of A -> B -> A should be reported as origin: A, crossOrigin: true, topOrigin: A).

This incorrect assumption drops the signal from the browser that there is an intermediate cross-origin ancestor involved, and it will look like a same-origin request with an explicit crossOrigin: false like an L2+ client (ie: RPs can't rely on crossOrigin being set to exclude an L1 client).

This isn't a security risk for an RP, because it needs to explicitly opt-in to allowing WebAuthn to be used from iframes, and it could mitigate risks of framing by unexpected origins by setting a content security policy. If an RP has a HTML injection vulnerability that allows attacker to insert an arbitrary iframe (with extra allow parameter), then they probably have much bigger problems and an attacker doesn't gain anything out of using this bug. :)

However, an RP which expects collected client data of origin: A, crossOrigin: true, topOrigin: A (particularly if using the limited verification algorithm) may reject the request. These sorts can cause all sorts of weird issues that are extremely difficult for a client or browser to debug, as the check is on the RP's side.

Lingua principale
Rust
Stelle
310
Fork
22
Merge medio
1g 15h
PR unite (30g)
13

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di linux-credentials/credentialsd

Tutte le issue di linux-credentials/credentialsd

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.