Repository navigation
Text index: fix out-of-bounds write in front-coding deserialization - #114155
Conversation
…alization Reject corrupted/malicious dictionary where `lcp` exceeds the previous token or `lcp + data_size` overflows, before the buffer write.
|
Workflow [PR], commit [c0721f4] Summary: ❌
AI ReviewSummaryThis PR hardens front-coded text-index dictionary deserialization by rejecting invalid Final Verdict✅ No new review findings. LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 137/139 (98.56%) · Uncovered code |
Reject first/reconstructed tokens larger than SerializationString::MAX_STRING_SIZE.
…front-coding-lcp-check
Build profile diff (arm_release)No arm_release build profile data for commit c0721f4 - the build was skipped, reused from cache, or predates profile upload. |
…front-coding-lcp-check
| UInt64 first_token_size = 0; | ||
| readVarUInt(first_token_size, istr); | ||
| /// Prevent a corrupt or malicious .dct file from allocating huge amounts of memory | ||
| if (first_token_size > SerializationString::MAX_STRING_SIZE) |
There was a problem hiding this comment.
checkTokenSize throws an exception with TOO_LARGE_STRING_SIZE but we need CORRUPTED_DATA here instead.
| "Corrupted text index dictionary: front-coding token size overflows (lcp = {}, data_size = {})", | ||
| lcp, data_size); | ||
|
|
||
| if (token_size > SerializationString::MAX_STRING_SIZE) |
…t-coding deserialization
Backport #114155 to 26.6: Text index: fix out-of-bounds write in front-coding deserialization
Cherry pick #114155 to 26.5: Text index: fix out-of-bounds write in front-coding deserialization
…t-coding deserialization
Cherry pick #114155 to 26.3: Text index: fix out-of-bounds write in front-coding deserialization
…t-coding deserialization
…t-coding deserialization
Backport #114155 to 26.7: Text index: fix out-of-bounds write in front-coding deserialization
Backport #114155 to 26.5: Text index: fix out-of-bounds write in front-coding deserialization
Backport #114155 to 26.3: Text index: fix out-of-bounds write in front-coding deserialization
Fixes https://github.com/ClickHouse/clickhouse-private/issues/65753.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Reject corrupted/malicious dictionary where
lcpexceeds the previous token orlcp + data_sizeoverflows, before the buffer write.Version info
26.8.1.1320(included in26.8and later)26.7.5.2,26.5.8.13,26.3.21.10