mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
QUIC/decrypt_crypto: Limit payload_length to 10k
Given we dynamically allocate memory for decryption, employ a limit that is unlikely to be hit, but allows for large payloads produced by the fuzzer or jumbo frames.
This commit is contained in:
parent
15511e0fb5
commit
f10832d110
1 changed files with 5 additions and 0 deletions
|
@ -158,6 +158,11 @@ hilti::rt::Bytes decrypt(const std::vector<uint8_t>& client_key, const hilti::rt
|
|||
throw hilti::rt::RuntimeError(hilti::rt::fmt("payload too small %ld < %ld", payload_length,
|
||||
decryptInfo.packet_number_length + AEAD_TAG_LENGTH));
|
||||
|
||||
// Bail on large payloads, somewhat arbitrarily. 10k allows for Jumbo frames
|
||||
// and sometimes the fuzzer produces packets up to that size as well.
|
||||
if ( payload_length > 10000 )
|
||||
throw hilti::rt::RuntimeError(hilti::rt::fmt("payload_length too large %ld", payload_length));
|
||||
|
||||
const uint8_t* encrypted_payload = data_as_uint8(all_data) + decryptInfo.unprotected_header.size();
|
||||
|
||||
int encrypted_payload_size = payload_length - decryptInfo.packet_number_length - AEAD_TAG_LENGTH;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue