`check_origin_from_privileged_client` drops browser signalling intermediate cross-origin iframes

Ouverte
#276 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 2 jours

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
57/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
rust

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.

Langage dominant
Rust
Étoiles
310
Forks
22
Merge moyen
1 j 15 h
PR mergées (30 j)
13

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de linux-credentials/credentialsd

Toutes les issues de linux-credentials/credentialsd

Issues similaires

Plus d'issues Rust

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.