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

Some slightly wrong Allow-Origin headers are producing load instead of error state, Servo is being lenient in ways URL-comparison is lenient #25174

Open
pshaughn opened this issue Dec 6, 2019 · 2 comments

Comments

@pshaughn
Copy link
Member

pshaughn commented Dec 6, 2019

This is in WPT cors/remote-origin.htm. The client sends a simple cross-origin request encoding in an URL parameter the Allow-Origin header it wants to see from the server, and the server sends a response back with that header.

Specifically, uppercasing HTTP:, adding / to the end, or adding # to the end should make it be an error but doesn't.
These specific points of too-lenient matching suggest the possibility that it's using an URL string comparison instead of a more literal string comparison.

@jdm jdm added the A-network label Dec 9, 2019
@jdm jdm added this to To do in web-platform-test failures via automation Dec 9, 2019
@pshaughn
Copy link
Member Author

pshaughn commented Dec 9, 2019

https://github.com/hyperium/headers/blob/c6be8bab9c9852581bccd03f89cdbe431195ca1c/src/common/origin.rs#L134 seems to be at fault here. Hyper's header code assumes an origin is shaped like an URL, calls an url parser, then gets parts out of the parsed URL, implicitly normalizing away the above-listed cases.

@pshaughn
Copy link
Member Author

pshaughn commented Dec 9, 2019

This seems like a definite error in Hyper, since it's doing other validation work, so I've let them know at hyperium/headers#57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants