Closed mgiuca closed 6 years ago
I think this scenario might be problematic:
{
"scope": "/foo",
"share_target": {
"url_template": "/foo/{text}/"
}
}
If we do validation at parse time, it seems like |url_template| would fall under the scope. However, if a user wants to share ".." the URL will fall out of scope
That's a good point. (Note that other problematic characters such as '/' and '?' are not an issue because we encode the placeholders with the userinfo percent encode set, but '.' and '..' are a problem.)
I was going to suggest that we add U+002E to the encode set, but it turns out that won't help -- "%2e" is considered equivalent to ".". So I'm not sure exactly how we can prevent this: either prevent all placeholders from appearing before the '?' (would be the big hammer approach), or otherwise somehow ban these path segments.
I've closed this and moved the work to a new branch: https://github.com/mgiuca/web-share-target/tree/parse-at-parse-time which will actually parse the URL template as a URL instead of just validating it at load time.
Closes #25
Preview | Diff