[fuzz] fix bad inputs and config bugs#12504
Conversation
Signed-off-by: Asra Ali <asraa@google.com>
ggreenway
left a comment
There was a problem hiding this comment.
LGTM. @envoyproxy/api-shepherds PTAL.
| // access_log_hint metadata, set the filter to "envoy.common" and the path to | ||
| // "access_log_hint", and the value to "true". | ||
| type.matcher.v3.MetadataMatcher matcher = 1; | ||
| type.matcher.v3.MetadataMatcher matcher = 1 [(validate.rules).message = {required: true}]; |
There was a problem hiding this comment.
Increasing the strictness of protoc-gen-validate annotations. Exceptions may be granted for scenarios in which these stricter conditions model behavior already implied structurally or by documentation.
Assuming this change falls into this exception, because MetadataFilter can be null, @asraa ?
There was a problem hiding this comment.
It might be able to be solved in code too. MetadataFilter only needs an actual MetadataMatcher matcher so that it can have a value, otherwise this line crashes in code
because of
envoy/source/common/common/matchers.cc
Line 34 in b6d1fec
Thinking about this more, it is possible to solve in code by only setting value_matcher_ if there's a matcher, and evaluating the match by preconditioning that there's a value_matcher_.
I think code may be better (at least for now)
There was a problem hiding this comment.
Opted for the code change.
Signed-off-by: Asra Ali <asraa@google.com>
| filter_(filter_config.matcher().filter()) { | ||
|
|
||
| auto& matcher_config = filter_config.matcher(); | ||
| if (filter_config.has_matcher()) { |
There was a problem hiding this comment.
Should we add an explicit test for this case?
There was a problem hiding this comment.
Yes, definitely -- done
Signed-off-by: Asra Ali <asraa@google.com>
Signed-off-by: Asra Ali <asraa@google.com>
Signed-off-by: Asra Ali asraa@google.com
Commit Message:
encodeHeadersin HCM requires that the only 1xx header is a 101 upgradeRisk Level: Low
Testing: Regression tests added
Fixes:
https://oss-fuzz.com/testcase?key=4863844862918656
https://oss-fuzz.com/testcase-detail/5656400764862464
https://oss-fuzz.com/testcase-detail/5631179290836992