h2
h2 copied to clipboard
Handle malformed messages with continuation frames
When a HEADERS
frame is received that is malformed, the stream is reset. However, any continuation frame that is received after that must still be have HPACK decoding performed in order to maintain the hpack state.
It sounds bad to for our connection to grow inconsistent HPACK state. However, is the proper fix important enough for 0.1, or could we give ourselves time and simply return a connection error for now?
It isn't an API breaking change, so technically it isn't a 0.1 hard requirement.
That said, I would be surprised if the real fix is much harder than a temporary fix.
I believe that the solution is to add a new Ignore
variant to this. Read the continuation frame & discard it.
And a test of course.
Digging through, this is a bit more involved, but still not terribly hard. I'll try working on it.
Looking at this, I discovered another potential issue #191.
Also, the analysis of the fix is incorrect.
I'm removing this from the 0.1 milestone. As @seanmonstar pointed out, this is not critical.
I believe that the solution is to add a new
Ignore
variant to this. Read the continuation frame & discard it.
Link with a hash so it doesn't get outdated:
https://github.com/hyperium/h2/blob/04570652b75a2a5176fb296c0c8309a865dc9d79/src/codec/framed_read.rs#L46-L50