Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the topOrigin field to the limited clientData verification algorithm #2123

Closed
wants to merge 1 commit into from

Conversation

agl
Copy link
Contributor

@agl agl commented Aug 16, 2024

I was asked to to the PR for this issue, without looking at the submitted PR, in order to avoid IPR issues that would arise from a change by a non-member.

The topOrigin field was added the the CollectedClientData, and the serialization algorithm, but not the verification algorithm. This PR addresses that.

Fixes #2102

The following tasks have been completed:

  • Modified Web platform tests (link) (Doesn't actually check this bit of the text due to complexity of setting up the iframes, but adds a test for this serialization in general, which was the bigger existing omission.)

Implementation commitment:

(Omitting due to minor nature of the change.)

Documentation and checks

  • Affects privacy
  • Affects security
  • Updated explainer

Preview | Diff

…rithm.

I was asked to to the PR for this issue, without looking at the
submitted PR, in order to avoid IPR issues that would arise from a
change by a non-member.

The `topOrigin` field was added the the CollectedClientData, and the
serialization algorithm, but not the verification algorithm. This PR
addresses that.

Fixes #2102
1. A boolean, |crossOrigin|, that is true if, and only if, the request should have been performed within a cross-origin <{iframe}>.
1. A string or null value, |expectedTopOrigin|, which contains the expected [=top-level origin=] for a cross-origin request, or else a null value to indicate that request must not have been performed in a cross-origin <{iframe}>.

Note: a non-null value for |expectedTopOrigin| will cause all {{CollectedClientData}} structures generated by previous versions of this specification to be rejected as previous versions did not serialize the [=top-level origin=].
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe indent this to make it part of the preceding list item?

Suggested change
Note: a non-null value for |expectedTopOrigin| will cause all {{CollectedClientData}} structures generated by previous versions of this specification to be rejected as previous versions did not serialize the [=top-level origin=].
Note: a non-null value for |expectedTopOrigin| will cause all {{CollectedClientData}} structures generated by previous versions of this specification to be rejected as previous versions did not serialize the [=top-level origin=].

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also: with this procedure, there is no way to validate a client data with "crossOrigin":true but without a "topOrigin". I would like to just reference the L2 verification procedure as a fallback, but that won't actually work: this L3 procedure would reject an incorrect "topOrigin", but the fallback would accept that incorrect "topOrigin" since that attribute is ignored in the L2 procedure.

In additions to #2104 I addressed this by adding a Boolean requireTopOrigin parameter and making some verification steps conditional on that, i.e.:

1. Append 0x2c2263726f73734f726967696e223a (`,"crossOrigin":`) to |expected|.
1. If |expectedTopOrigin| is null:
    1. Append 0x66616c7365 (`false`) to |expected|.
1. Else:
    1. Append 0x74727565 (`true`) to |expected|.
    1. If |requireTopOrigin| is true
        or if 0x2c22746f704f726967696e223a (`,"topOrigin":`) is a prefix
        of the substring of |clientDataJSON| beginning at the offset equal to the length of |expected|:
        1. Append 0x2c22746f704f726967696e223a (`,"topOrigin":`) to |expected|.
        1. Append [=CCDToString=](|expectedTopOrigin|) to |expected|.

What do you think, is this worth addressing?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I very much think this is worth addressing. While the algorithm is more complex, it would be nice if the limited verification algorithm were backwards compatible when possible.

@zacknewman
Copy link
Contributor

zacknewman commented Aug 19, 2024

I was told that a PR would be accepted which is why I submitted #2104. I don't know what an "IPR" is; but if it is inappropriate for me to send PRs, then I apologize and will refrain from doing so in the future.

Edit

DuckDuckGo says "IPR" is intellectual property. I would be more than happy to sign something that waives any intellectual property rights that would otherwise be associated with my contributions whether in comment or PR form. My only goal is make the spec consistent and rigorous enough that one can implement it with little ambiguity—my formal education is in pure math, so it can be difficult for me when technical documentation is not quite as "precise" as I wish.

@agl
Copy link
Contributor Author

agl commented Aug 28, 2024

The chair asked me to write a version of this without looking at the other PR for IPR reasons. It seems that the IPR issues are resolvable so closing this PR.

@agl agl closed this Aug 28, 2024
@emlun emlun deleted the toporigin branch October 7, 2024 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add topOrigin to the limited verification algorithm
3 participants