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

Should we escape \ in non-special non-opaque paths? #675

Open
TimothyGu opened this issue Nov 30, 2021 · 2 comments
Open

Should we escape \ in non-special non-opaque paths? #675

TimothyGu opened this issue Nov 30, 2021 · 2 comments
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest

Comments

@TimothyGu
Copy link
Member

Pros:

  • Matches RFC 3986 and Go
  • Might reduce path traversal vulnerabilities, for implementations that allow switching URLs from non-special to special schemes (i.e., all browsers)

Cons:

  • Doesn't match any browser (though to be fair, Chrome and Firefox don't actually support non-opaque paths in non-special URLs, and Safari implements the current spec)

Originally suggested by @karwa in #651 (comment).

@annevk
Copy link
Member

annevk commented Nov 30, 2021

I think a lot of these proposals would be easier to do once Chrome has proper non-special URL support. For better or worse they're in the best position to judge what changes can be made.

@alwinb
Copy link
Contributor

alwinb commented Jan 25, 2022

In any case. From the perspective of relative URLs, this is a good thing to do. The standard does not currently support parsing or serialising those, so decisions are often not checked against their implications for relative URLs either.

This means that it is left up to implementors of URL manipulation libraries to define a customised version of WHATWG URL normalisation that avoids reparse bugs for relative URLs and avoids as much ambiguity around scheme dependent parsing behaviour as possible.

Of course, the interpretation of \ being scheme dependent means that tools that produce relative, scheme-less URLs would better escape such occurrences, even if that does not agree with the normalisation as specified in the WHATWG standard. On the plus side, URLs with occurrences of \ are invalid, so I guess that isn’t so bad.

@annevk annevk added addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest labels Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest
Development

No branches or pull requests

3 participants