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

fix: validate the server URL to prevent subtle parsing effects #130

Merged
merged 1 commit into from
Jan 21, 2022

Conversation

cmars
Copy link
Contributor

@cmars cmars commented Jan 21, 2022

Go's net/url.Parse is very permissive. It's easy to pass the same
"host:port" used to configure the listener as the server URL, which gets
mis-interpreted as host://port, when http://host:port was intended.

This adds strict validation to the server URL, preventing this kind of
subtle bug from creating much confusion when the validator then fails to
match any paths and everything 404s.

Go's net/url.Parse is very permissive. It's easy to pass the same
"host:port" used to configure the listener as the server URL, which gets
mis-interpreted as host://port, when http://host:port was intended.

This adds strict validation to the server URL, preventing this kind of
subtle bug from creating much confusion when the validator then fails to
match any paths and everything 404s.
@cmars cmars requested a review from a team as a code owner January 21, 2022 22:29
@cmars cmars requested a review from genslein January 21, 2022 22:29
@cmars cmars merged commit 578991f into snyk:main Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants