verify serialized buffer before accessing it in the deserializer - #9395
Open
Nashit-h wants to merge 1 commit into
Open
verify serialized buffer before accessing it in the deserializer#9395Nashit-h wants to merge 1 commit into
Nashit-h wants to merge 1 commit into
Conversation
mcourteaux
approved these changes
Aug 26, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9395 +/- ##
==========================================
+ Coverage 69.89% 69.99% +0.09%
==========================================
Files 261 261
Lines 79362 79368 +6
Branches 19349 19351 +2
==========================================
+ Hits 55474 55554 +80
- Misses 17926 17944 +18
+ Partials 5962 5870 -92 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
deserialize() and deserialize_parameters() in src/Deserialization.cpp call Serialize::GetPipeline(data.data()) and then chase table, vector, and string offsets straight out of the buffer with no structural check, so a malformed .hlpipe reads out of bounds (ASAN reports a heap-buffer-overflow read while walking output_names on a buffer with a corrupted root offset). Run a flatbuffers::Verifier over the data first and reject anything that fails before any accessor runs. Finish() writes no file identifier, so this verifies with VerifyBuffer() rather than the generated VerifyPipelineBuffer, which checks for the 'HLDE' identifier and would reject every valid file; valid pipelines verify and deserialize unchanged.