Repository navigation
Validate large blob parameters before mutating write state - #797
Merged
Merged
Conversation
ia0
approved these changes
Oct 9, 2026
In LargeBlobState::process_command, an offset == 0 write mutated self.expected_length before checking max_large_blob_array_size() and TRUNCATED_HASH_LEN, and updated self.expected_next_offset = 0 before verifying pin_uv_auth_param and checking that the chunk fits within expected_length. If an offset == 0 request failed validation or authentication while a multi-fragment write was in progress, self.expected_length and/or self.expected_next_offset were overwritten while self.buffer retained the previous write's bytes. In particular, an offset == 0 request with length > max_large_blob_array_size() after an initial valid chunk left self.expected_length set to the oversized length and allowed subsequent chunks at offset > 0 to bypass max_large_blob_array_size(). Validate length, authentication, and chunk bounds before mutating LargeBlobState on offset == 0, and clear the state when the final chunk is processed regardless of whether the hash check succeeds.
kaczmarczyck
force-pushed
the
preserve-large-blob-state-on-error
branch
from
October 9, 2026 16:34
fa86fd0 to
e43cff8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In LargeBlobState::process_command, an offset == 0 write mutated self.expected_length before checking max_large_blob_array_size() and TRUNCATED_HASH_LEN, and updated self.expected_next_offset = 0 before verifying pin_uv_auth_param and checking that the chunk fits within expected_length.
If an offset == 0 request failed validation or authentication while a multi-fragment write was in progress, self.expected_length and/or self.expected_next_offset were overwritten while self.buffer retained the previous write's bytes. In particular, an offset == 0 request with length > max_large_blob_array_size() after an initial valid chunk left self.expected_length set to the oversized length and allowed subsequent chunks at offset > 0 to bypass max_large_blob_array_size().
Validate length, authentication, and chunk bounds before mutating LargeBlobState on offset == 0, and clear the state when the final chunk is processed regardless of whether the hash check succeeds.