Handle Fetch does a dubious SecureContext check on a reserved client
Nobody has claimed this yet.
- Dominant language
- Bikeshed
- Stars
- 3.6k
- Forks
- 324
- Avg merge
- 14d 22h
- Merged PRs (30d)
- 1
Description
Handle fetch currently does this at step 12.1:
1. If reservedClient is not null and is an environment settings object, then:
1. If reservedClient is not a secure context, return null.
2. Else:
1. If request’s url is not a potentially trustworthy URL, return null.
It seems a bit dubious to check if a reserved client is a secure context. Until its execution ready a reserved client does not have a creation URL set. (Consider that a redirect could occur before execution ready, etc.)
The secure context check is not completely useless because it will still check if a reserved client iframe's parent is secure or not, but it won't take into account the actual request URL at all.
I think this check should probably be rewritten sa:
1. If request’s url is not a potentially trustworthy URL, return null.
2. If reservedClient is not null and is an environment settings object, then:
1. If reservedClient is not a secure context, return null.
So, always check the request URL, but also ensure the reserved client is not already forced to be insecure.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the Handle fetch algorithm and inspect step 12.1, especially the order of the reservedClient and request URL checks. Update the algorithm so the request URL is checked first while retaining the secure-context check for an environment-settings reserved client; done means the wording matches the proposed ordering.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 70/100