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

URL.RevokeBlobURL is not strict enough about blob urls #24290

Closed
jdm opened this issue Sep 25, 2019 · 9 comments
Closed

URL.RevokeBlobURL is not strict enough about blob urls #24290

jdm opened this issue Sep 25, 2019 · 9 comments

Comments

@jdm
Copy link
Member

@jdm jdm commented Sep 25, 2019

Spec: https://w3c.github.io/FileAPI/#dfn-revokeObjectURL

Code:

  • components/script/dom/url.rs
  • components/net_traits/blob_url_store.rs

Test:

  • ./mach test-wpt tests/wpt/web-platform-tests/FileAPI/url/url-with-xhr.any.js
  • ./mach test-wpt tests/wpt/web-platform-tests/FileAPI/url/url-with-fetch.any.js

There are a couple problems:

  • we don't do any same-origin check against the blob being revoked
  • the parse_blob_url helper strips off any extra parts of the URL being revoked, whereas https://w3c.github.io/FileAPI/#removeTheEntry serializes the entire url
@SiddharthaMishra
Copy link
Contributor

@SiddharthaMishra SiddharthaMishra commented Sep 28, 2019

I'd like to work on this

@Asalle
Copy link

@Asalle Asalle commented Oct 6, 2019

@SiddharthaMishra are you working on this? Otherwise, i'd like to start with it.

@SiddharthaMishra
Copy link
Contributor

@SiddharthaMishra SiddharthaMishra commented Oct 6, 2019

Yeah. Sorry about delaying this, I'll finish up ASAP.

@Asalle
Copy link

@Asalle Asalle commented Oct 6, 2019

@SiddharthaMishra can you assign it to yourself then?

@CYBAI CYBAI added the C-assigned label Oct 6, 2019
@SiddharthaMishra
Copy link
Contributor

@SiddharthaMishra SiddharthaMishra commented Oct 6, 2019

@highfive: assign me

@highfive
Copy link

@highfive highfive commented Oct 6, 2019

It looks like this has already been assigned to someone. I'll leave the decision to a core contributor.

@SiddharthaMishra
Copy link
Contributor

@SiddharthaMishra SiddharthaMishra commented Oct 9, 2019

@jdm, since our blob URL store has keys which are UUIDs instead of the entire urls as in the standard, does it make sense to serialize the entire URL? Should the behavior of the URL store hashmap be changed to accept the entire urls as keys?

@jdm
Copy link
Member Author

@jdm jdm commented Oct 10, 2019

@SiddharthaMishra I think the RevokeBlobURL message should be changed to accept a Url value instead of an id and an origin. The code that processes the message can parse the blob url and ignore it if there's any fragment or query string present.

@shnmorimoto
Copy link
Contributor

@shnmorimoto shnmorimoto commented Nov 5, 2019

@SiddharthaMishra Are you working on this? May I work on this?

@shnmorimoto shnmorimoto mentioned this issue Nov 7, 2019
3 of 5 tasks complete
bors-servo added a commit that referenced this issue Nov 7, 2019
Fix revoke blob url

<!-- Please describe your changes on the following line: -->

fix #24290

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #24290 (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
bors-servo added a commit that referenced this issue Nov 19, 2019
Fix revoke blob url

<!-- Please describe your changes on the following line: -->

fix #24290

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #24290 (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

6 participants
You can’t perform that action at this time.