api: ensure HeaderValue keys are non-empty. (#3901)

Some sites where we consume HeaderValue, e.g. in Google gRPC client library metadata, require
non-empty keys as a precondition. This seems a general property; there shouldn't be any use case for
a header key that is empty.

Found with server_fuzz_test under oss-fuzz (issue 9373). As a bonus, also fixed another proto
descriptor crash that occurs with this corpus addition due to missing proto descriptor pool entries
in server_fuzz_test.

Risk level: Low
Testing: New server_fuzz corpus entry.

Signed-off-by: Harvey Tuch <htuch@google.com>

Mirrored from https://github.com/envoyproxy/envoy @ 8ed7c157c4b672763ae74e526e69ef43dda52549
pull/620/head
data-plane-api(CircleCI) 7 years ago
parent 9470c899f0
commit fcd1470c8f
  1. 2
      envoy/api/v2/core/base.proto

@ -133,7 +133,7 @@ enum RequestMethod {
// Header name/value pair.
message HeaderValue {
// Header name.
string key = 1;
string key = 1 [(validate.rules).string.min_bytes = 1];
// Header value.
//

Loading…
Cancel
Save