http1 204 response with body fails codec assertion#11922
Conversation
Signed-off-by: Adi Suissa-Peleg <adip@google.com>
|
/cc @asraa @yanavlasov This should be ok as long as upstreams are trusted. |
…20200706 Signed-off-by: Adi Suissa-Peleg <adip@google.com>
|
upstream are not trusted |
|
Well upstreams are mostly trusted, but we want to move in a direction they aren't. I think it'd be good to fuzz invalid 204-with-body if we can. Thoughts @asraa ? |
|
Agreed, we've been having offline discussion about this. Adi tested what happens to 204-with-bodies, and it looks like in integration tests (opt mode, so no assert failure) their bodies are rightfully dropped. The direction I suggest leaning towards is avoiding the ASSERT failure, which seems like the wrong thing. It's not an invariant -- and 204s with bodies should maybe just end their encode after encodeHeaders anyway. |
|
Yes, we should not ASSERT on wire data. And yes, we should fuzz it. Is it possible to modify fuzz test to specify presence of the body in corpus? In this way the extra if will not be needed. |
Signed-off-by: Adi Suissa-Peleg <adip@google.com>
|
Thanks for all the comments. Just to recap: |
The PR description seems to be out of date. It also does not follow the PR creation template which calls for: Commit Message: For an explanation of how to fill out the fields, please see the relevant section |
|
Thanks @antoniovicente! |
Signed-off-by: Adi Suissa-Peleg <adip@google.com>
…20200706 Signed-off-by: Adi Suissa-Peleg <adip@google.com>
|
@lizan @alyssawilk @yanavlasov - other comments? |
Removing the codec assert checking that a 204 response must be called with end_stream set to true. The spec states that a 204 response cannot contain a body, and Envoy removes the body from the response. Risk Level: Low Testing: Added integration test, and 2 fuzz test examples added Fixes oss-fuzz bug: 23853 Signed-off-by: Adi Suissa-Peleg <adip@google.com> Signed-off-by: scheler <santosh.cheler@appdynamics.com>
Removing the codec assert checking that a 204 response must be called with
end_streamset to true.The spec states that a 204 response cannot contain a body, and Envoy removes the body from the response.
Also added an integration test, and fuzz test examples that used to fail the assertion.
Risk Level: Low
Testing: new integration test, and 2 fuzz test examples added
Docs Changes: None
Release Notes: None
Fixes oss-fuzz bug: 23853
Signed-off-by: Adi Suissa-Peleg adip@google.com