-
Notifications
You must be signed in to change notification settings - Fork 29
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
extended version of std::net::parser
does not include CVE fix
#32
Comments
std::net::parser
does include CVE fixstd::net::parser
does not include CVE fix
Oops, I wrote a test and it looks like the ipnet parser already doesn't allow octal or hex format. |
Sorry I missed the original notification about this last week. Thanks for spotting this and working on it. I’m also a bit surprised it doesn’t have the same problem since it was copied from the std lib (but it was long ago) :) |
Yeah, that's interesting. I have a theory:
That might mean that |
Ah, so it would seem. Looks like the parser in std has had quite a few other changes too. Is this something you'd still like to submit a PR for? I'm happy to merge a fix. There's no rush. |
It looks like the copied and extended version of the
std::net::parser
module in the ipnet parser doesn't include this recent CVE fix to the standard library that disallows the use of octal format in IPv4 strings: rust-lang/rust#83652.From the PR to rust-lang/rust:
If I understand correctly, similarly to
std::net::parser
, it's not that a leading zero would cause the string to be interpreted as an octal literal in ipnet's parser, as the parser specifies the radix as 10 here; however, it would be good to fully disallow leading-zero octal format in an IPv4 string as suggested in the above RFC, since it's invalid in the strict format.Would it make sense to apply that change to ipnet? I'm happy to put together a PR.
The text was updated successfully, but these errors were encountered: