Skip to content

Commit

Permalink
Check HelloRetryRequest cipher consistency earlier.
Browse files Browse the repository at this point in the history
CVE-2023-23759

Co-authored-by: Facebook Community Bot <6422482+facebook-github-bot@users.noreply.github.com>

Differential Revision: D42508182
  • Loading branch information
facebook-github-bot committed Jan 20, 2023
1 parent 0d3da69 commit 8d36498
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions fizz/server/ServerProtocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1214,6 +1214,12 @@ EventHandler<ServerTypes, StateEnum::ExpectingClientHello, Event::ClientHello>::

auto cipher = negotiateCipher(chlo, state.context()->getSupportedCiphers());

if (state.cipher().has_value() && cipher != *state.cipher()) {
throw FizzException(
"cipher mismatch with previous negotiation",
AlertDescription::illegal_parameter);
}

verifyCookieState(cookieState, *version, cipher);

auto resStateResult = getResumptionState(
Expand Down Expand Up @@ -1284,12 +1290,6 @@ EventHandler<ServerTypes, StateEnum::ExpectingClientHello, Event::ClientHello>::
std::move(state.handshakeContext()),
version);

if (state.cipher().has_value() && cipher != *state.cipher()) {
throw FizzException(
"cipher mismatch with previous negotiation",
AlertDescription::illegal_parameter);
}

auto alpn = negotiateAlpn(chlo, folly::none, *state.context());

auto clockSkew = getClockSkew(
Expand Down

0 comments on commit 8d36498

Please sign in to comment.