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

Unexpected panic for malformed URI with brackets #435

Closed
algesten opened this issue Aug 20, 2020 · 1 comment · Fixed by #445
Closed

Unexpected panic for malformed URI with brackets #435

algesten opened this issue Aug 20, 2020 · 1 comment · Fixed by #445
Labels
A-uri Area: Uri and parts S-bug Severity: bug. Something is wrong!

Comments

@algesten
Copy link

Doing some fuzzing I encountered this:

    let uri = "http://[]@[";
    let uri = uri.parse::<http::Uri>().unwrap(); // is ok
    uri.host(); // panics

The panic is parsing should validate brackets and come from here: https://github.com/hyperium/http/blob/v0.2.1/src/uri/authority.rs#L486

I expect this to surface as an Err and panic on .unwrap().

@seanmonstar seanmonstar added A-uri Area: Uri and parts S-bug Severity: bug. Something is wrong! labels Aug 20, 2020
@seanmonstar
Copy link
Member

Yep, this looks wrong. Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-uri Area: Uri and parts S-bug Severity: bug. Something is wrong!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants