Skip to content

Commit e6c57fa

Browse files
authored
[fuzz] fix filter crashes from OSS fuzz (envoyproxy#12152)
* fix filter fuzzer crash from OSS fuzz by checking for non-implemented proto fields This will raise an exception that will be caught and abort the test run when an unimplemented oneof field is hit by the fuzzer Signed-off-by: Sam Flattery <[email protected]>
1 parent b250fed commit e6c57fa

File tree

7 files changed

+25
-0
lines changed

7 files changed

+25
-0
lines changed

api/envoy/config/tap/v3/common.proto

+1
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ message OutputSink {
231231

232232
// [#not-implemented-hide:]
233233
// GrpcService to stream data to. The format argument must be PROTO_BINARY.
234+
// [#comment: TODO(samflattery): remove cleanup in uber_per_filter.cc once implemented]
234235
StreamingGrpcSink streaming_grpc = 4;
235236
}
236237
}

api/envoy/config/tap/v4alpha/common.proto

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generated_api_shadow/envoy/config/tap/v3/common.proto

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generated_api_shadow/envoy/config/tap/v4alpha/common.proto

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/extensions/filters/http/common/fuzz/filter_corpus/clusterfuzz-testcase-minimized-filter_fuzz_test-5635252589690880

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/extensions/filters/http/common/fuzz/uber_per_filter.cc

+13
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,19 @@ void cleanTapConfig(Protobuf::Message* message) {
103103
config.mutable_common_config()->mutable_static_config()->mutable_match_config()->set_any_match(
104104
true);
105105
}
106+
// TODO(samflattery): remove once StreamingGrpcSink is implemented
107+
else if (config.common_config().config_type_case() ==
108+
envoy::extensions::common::tap::v3::CommonExtensionConfig::ConfigTypeCase::
109+
kStaticConfig &&
110+
config.common_config()
111+
.static_config()
112+
.output_config()
113+
.sinks(0)
114+
.output_sink_type_case() ==
115+
envoy::config::tap::v3::OutputSink::OutputSinkTypeCase::kStreamingGrpc) {
116+
// will be caught in UberFilterFuzzer::fuzz
117+
throw EnvoyException("received input with not implemented output_sink_type StreamingGrpcSink");
118+
}
106119
}
107120

108121
void UberFilterFuzzer::cleanFuzzedConfig(absl::string_view filter_name,

tools/spelling/spelling_dictionary.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1111,6 +1111,7 @@ tuples
11111111
typedef
11121112
typeid
11131113
typesafe
1114+
uber
11141115
ucontext
11151116
udpa
11161117
uint

0 commit comments

Comments
 (0)