Skip to content

Commit

Permalink
fuzz: fix h10 codec validation (envoyproxy#29924)
Browse files Browse the repository at this point in the history
Signed-off-by: Adi Suissa-Peleg <[email protected]>
  • Loading branch information
adisuissa authored Oct 3, 2023
1 parent 99f7178 commit 9f8b7ea
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
33 changes: 33 additions & 0 deletions test/common/http/codec_impl_corpus/h10_empty_hostname

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions test/common/http/codec_impl_fuzz_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ Http1Settings fromHttp1Settings(const test::common::http::Http1ServerSettings& s
h1_settings.accept_http_10_ = settings.accept_http_10();
h1_settings.default_host_for_http_10_ = settings.default_host_for_http_10();

// If the server accepts a HTTP/1.0 then the default host must be valid.
if (h1_settings.accept_http_10_ &&
!HeaderUtility::authorityIsValid(h1_settings.default_host_for_http_10_)) {
throw EnvoyException("Invalid Http1ServerSettings, HTTP/1.0 is enabled and "
"'default_host_for_http_10' has invalid hostname, skipping test.");
}
return h1_settings;
}

Expand Down

0 comments on commit 9f8b7ea

Please sign in to comment.