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

Partition Blob URL revocation by Storage Key #201

Merged
merged 9 commits into from
Dec 4, 2024
Merged

Conversation

recvfrom
Copy link
Contributor

@recvfrom recvfrom commented Oct 25, 2024

Part of the changes discussed in #153 (comment)

This updates URL.revokeObjectURL to not allow revoking a Blob URL except from contexts with the same Storage Key as the one in which the Blob URL was created. A corresponding PR will update the Fetch spec to incorporate similar Storage Key checks into Blob URL fetches.

I considered incorporating the Storage Key checks into the "resolve a blob URL" algorithm instead, but it seemed that this would require an environment settings object to be available as part of https://url.spec.whatwg.org/#url-parsing, and I'm not sure whether that is the case / a change we want.

For normative changes, the following tasks have been completed:

  • Modified Web platform tests (link to pull request)

Implementation commitment:


Preview | Diff

@miketaylr
Copy link
Member

Mind taking a look @mkruisselbrink?

index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated
1. If |entry| is failure, return.
1. Let |blobStorageKey| be the result of [=obtaining a storage key for non-storage purposes=] with |entry|'s [=environment settings object=].
1. Let |currentStorageKey| be the result of [=obtaining a storage key for non-storage purposes=] with the [=current settings object=].
1. If |blobStorageKey| is not [=storage key/equal=] to |currentStorageKey|, return.
1. [=Remove an entry from the Blob URL Store=] for |url|.

Note: This means that rather than throwing some kind of error, attempting to revoke a URL that isn't registered will silently fail.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Might make sense to mention that it's not just URLs that aren't registered that would silently fail, something like (although not sure that's the best way to phrase it):

Suggested change
Note: This means that rather than throwing some kind of error, attempting to revoke a URL that isn't registered will silently fail.
Note: This means that rather than throwing some kind of error, attempting to revoke a URL that isn't registered, or is registered from a different storage key, will silently fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, I updated this (although made it a bit more verbose). WDYT?

@miketaylr
Copy link
Member

I guess we need to update spec-prod (or wait for the update to be propagated?):

  $ bikeshed update
    Bikeshed now requires Python 3.9; you are on 3.8.10.
        If you're seeing this message in your CI run, you are
        likely specifying an old OS; try `ubuntu-latest`.
        If you're seeing this on the command line, see the docs
        for instructions:
        https://speced.github.io/bikeshed/#installing
  Command `bikeshed update` failed with exit code: 1.

w3c/spec-prod#193

@mkruisselbrink
Copy link
Collaborator

I guess we need to update spec-prod (or wait for the update to be propagated?):

  $ bikeshed update
    Bikeshed now requires Python 3.9; you are on 3.8.10.
        If you're seeing this message in your CI run, you are
        likely specifying an old OS; try `ubuntu-latest`.
        If you're seeing this on the command line, see the docs
        for instructions:
        https://speced.github.io/bikeshed/#installing
  Command `bikeshed update` failed with exit code: 1.

w3c/spec-prod#193

I think #204 will fix that.

@recvfrom
Copy link
Contributor Author

Per the feedback here [1], I've updated this PR to also change how the blob URL entry's object member is exposed so that the partitioning checks can be fully contained in the FileAPI. WDYT?

[1] whatwg/fetch#1783 (comment)

index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

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

This looks good to me modulo nits. Would be good if @mkruisselbrink had another look as well.

index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
Copy link
Collaborator

@mkruisselbrink mkruisselbrink left a comment

Choose a reason for hiding this comment

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

looks good to me as well, modulo Anne's nits

index.bs Outdated Show resolved Hide resolved
@mkruisselbrink mkruisselbrink merged commit 77b2086 into w3c:main Dec 4, 2024
2 checks passed
github-actions bot added a commit that referenced this pull request Dec 4, 2024
SHA: 77b2086
Reason: push, by mkruisselbrink

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
annevk pushed a commit to whatwg/html that referenced this pull request Dec 9, 2024
As suggested in whatwg/fetch#1783 (comment), this change updates an existing use of blob URL entry's object so that the "obtain a blob object" algorithm is used instead. This algorithm was added in w3c/FileAPI#201.
annevk pushed a commit to whatwg/fetch that referenced this pull request Dec 9, 2024
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Dec 10, 2024
Associated spec PRs:
 - w3c/FileAPI#201 - Partition Blob URL revocation by Storage Key
 - whatwg/fetch#1783 - Partition Blob URL fetches by Storage Key
 - whatwg/html#10731 - Enforce noopener on cross-top-level-site Blob URLs

Bug: 40057646
Change-Id: I953598ab3f81d5998e8398057739e0428bc23e4b
aarongable pushed a commit to chromium/chromium that referenced this pull request Dec 10, 2024
Associated spec PRs:
 - w3c/FileAPI#201 - Partition Blob URL revocation by Storage Key
 - whatwg/fetch#1783 - Partition Blob URL fetches by Storage Key
 - whatwg/html#10731 - Enforce noopener on cross-top-level-site Blob URLs

Bug: 40057646
Change-Id: I953598ab3f81d5998e8398057739e0428bc23e4b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5967596
Reviewed-by: Steven Bingler <[email protected]>
Commit-Queue: Andrew Williams <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1394563}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Dec 10, 2024
Associated spec PRs:
 - w3c/FileAPI#201 - Partition Blob URL revocation by Storage Key
 - whatwg/fetch#1783 - Partition Blob URL fetches by Storage Key
 - whatwg/html#10731 - Enforce noopener on cross-top-level-site Blob URLs

Bug: 40057646
Change-Id: I953598ab3f81d5998e8398057739e0428bc23e4b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5967596
Reviewed-by: Steven Bingler <[email protected]>
Commit-Queue: Andrew Williams <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1394563}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Dec 11, 2024
Associated spec PRs:
 - w3c/FileAPI#201 - Partition Blob URL revocation by Storage Key
 - whatwg/fetch#1783 - Partition Blob URL fetches by Storage Key
 - whatwg/html#10731 - Enforce noopener on cross-top-level-site Blob URLs

Bug: 40057646
Change-Id: I953598ab3f81d5998e8398057739e0428bc23e4b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5967596
Reviewed-by: Steven Bingler <[email protected]>
Commit-Queue: Andrew Williams <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1394563}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Dec 13, 2024
…PTs permanent, a=testonly

Automatic update from web-platform-tests
[Blob URL] Make tentative partitioning WPTs permanent

Associated spec PRs:
 - w3c/FileAPI#201 - Partition Blob URL revocation by Storage Key
 - whatwg/fetch#1783 - Partition Blob URL fetches by Storage Key
 - whatwg/html#10731 - Enforce noopener on cross-top-level-site Blob URLs

Bug: 40057646
Change-Id: I953598ab3f81d5998e8398057739e0428bc23e4b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5967596
Reviewed-by: Steven Bingler <[email protected]>
Commit-Queue: Andrew Williams <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1394563}

--

wpt-commits: 949cc8c7c7067de75af00d1ba60d6921582f9c5d
wpt-pr: 49629
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this pull request Dec 14, 2024
…PTs permanent, a=testonly

Automatic update from web-platform-tests
[Blob URL] Make tentative partitioning WPTs permanent

Associated spec PRs:
 - w3c/FileAPI#201 - Partition Blob URL revocation by Storage Key
 - whatwg/fetch#1783 - Partition Blob URL fetches by Storage Key
 - whatwg/html#10731 - Enforce noopener on cross-top-level-site Blob URLs

Bug: 40057646
Change-Id: I953598ab3f81d5998e8398057739e0428bc23e4b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5967596
Reviewed-by: Steven Bingler <[email protected]>
Commit-Queue: Andrew Williams <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1394563}

--

wpt-commits: 949cc8c7c7067de75af00d1ba60d6921582f9c5d
wpt-pr: 49629
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Dec 16, 2024
…PTs permanent, a=testonly

Automatic update from web-platform-tests
[Blob URL] Make tentative partitioning WPTs permanent

Associated spec PRs:
 - w3c/FileAPI#201 - Partition Blob URL revocation by Storage Key
 - whatwg/fetch#1783 - Partition Blob URL fetches by Storage Key
 - whatwg/html#10731 - Enforce noopener on cross-top-level-site Blob URLs

Bug: 40057646
Change-Id: I953598ab3f81d5998e8398057739e0428bc23e4b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5967596
Reviewed-by: Steven Bingler <binglerchromium.org>
Commit-Queue: Andrew Williams <awilliachromium.org>
Cr-Commit-Position: refs/heads/main{#1394563}

--

wpt-commits: 949cc8c7c7067de75af00d1ba60d6921582f9c5d
wpt-pr: 49629

UltraBlame original commit: eeba0835a846042567009b99eb22224cfacd0380
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Dec 16, 2024
…PTs permanent, a=testonly

Automatic update from web-platform-tests
[Blob URL] Make tentative partitioning WPTs permanent

Associated spec PRs:
 - w3c/FileAPI#201 - Partition Blob URL revocation by Storage Key
 - whatwg/fetch#1783 - Partition Blob URL fetches by Storage Key
 - whatwg/html#10731 - Enforce noopener on cross-top-level-site Blob URLs

Bug: 40057646
Change-Id: I953598ab3f81d5998e8398057739e0428bc23e4b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5967596
Reviewed-by: Steven Bingler <binglerchromium.org>
Commit-Queue: Andrew Williams <awilliachromium.org>
Cr-Commit-Position: refs/heads/main{#1394563}

--

wpt-commits: 949cc8c7c7067de75af00d1ba60d6921582f9c5d
wpt-pr: 49629

UltraBlame original commit: eeba0835a846042567009b99eb22224cfacd0380
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Dec 16, 2024
…PTs permanent, a=testonly

Automatic update from web-platform-tests
[Blob URL] Make tentative partitioning WPTs permanent

Associated spec PRs:
 - w3c/FileAPI#201 - Partition Blob URL revocation by Storage Key
 - whatwg/fetch#1783 - Partition Blob URL fetches by Storage Key
 - whatwg/html#10731 - Enforce noopener on cross-top-level-site Blob URLs

Bug: 40057646
Change-Id: I953598ab3f81d5998e8398057739e0428bc23e4b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5967596
Reviewed-by: Steven Bingler <binglerchromium.org>
Commit-Queue: Andrew Williams <awilliachromium.org>
Cr-Commit-Position: refs/heads/main{#1394563}

--

wpt-commits: 949cc8c7c7067de75af00d1ba60d6921582f9c5d
wpt-pr: 49629

UltraBlame original commit: eeba0835a846042567009b99eb22224cfacd0380
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.

4 participants