`check_origin_from_privileged_client` drops browser signalling intermediate cross-origin iframes

Offen
#276 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 2 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
57/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
rust

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Rust
Sterne
310
Forks
22
Ø Merge
1 T. 15 Std.
Gemergte PRs (30 T.)
13

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus linux-credentials/credentialsd

Alle Issues in linux-credentials/credentialsd

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.