-
Notifications
You must be signed in to change notification settings - Fork 160
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
"IndexError: index out of range" in _reject_surrounding_whitespace #1257
Comments
Yes - this looks like a valid bug! How long does your fuzzing currently run? If you find multiple such errors I would prefer grouping everything into a single GitHub issue, but if you have a fuzzing strategy based on different frame types or other structured input data, I'd also be happy to see new issues per group et al. |
A few seconds.
I don't have multiple fuzzing strategy yet and does not use complex structures as input data. This is a completely new world for me. |
Quick analysis of the payload you found: The last two bytes don't matter for this IndexError. The hpack blob is I'm not sure if we should consider this a bug in h2 (obviously out-of-bounds reading of an empty headers name), or a decoding error in hpack. @sethmlarson are empty header names even valid in hpack? |
@Kriechi So I couldn't follow a trail from RFC 7540 to RFC 7231 to RFC 7230 but in spirit we know that "HTTP semantics" (RFC 7231) is a high-level capture of the semantics defined in "HTTP/1.1" (RFC 7230) so... yeah, this is the best I've got: From RFC 7230 Section 3.2:
and in the collected ABNF appendix:
so as expected the header name/field should be 1 or more characters so I wouldn't expect an empty name to be valid for HPACK. |
@sethmlarson I agree on the semantic reasoning. Curiously though, our hpack implementation AND the golang implementation AND a popular ruby gem all happily decode this payload into a header with empty name. So right now, I'm leaning towards catching this in h2 by simply filtering out these invalid headers without throwing an error. Any better ideas? |
Hello,
I am working on integrating fuzzer to project
h2
. My goal is to include it in theoss-fuzz
project. I believe that this can be a valuable contribution to the library, the importance of which is becoming more and more higher, among others due to the use byhttpx
- the library which popularity also growing.I identified the first problems and I would like to know if such problems are interesting for your project and your are interested to handle them.
The text was updated successfully, but these errors were encountered: