scope hashing config per verify call to stop ignore-path leak - #650
Merged
mihaimaruseac merged 1 commit intoJul 26, 2026
Merged
Conversation
verifying.Config.verify carried hashing state across models when the config is reused (a pattern the module docstring recommends): - the guessed hashing config was cached on the instance, so a later model was hashed with an earlier model's serialization settings - each signed manifest's ignore paths were added to that shared config via add_ignored_paths and never reset, accumulating across calls - an extra unsigned file placed at a path some earlier model ignored was skipped instead of reported during a later model's verification, so a tampered model verified clean Build the hashing config per call (deepcopy a caller-supplied one, else a fresh guess) and apply the signed ignore paths to that local copy so no state persists across verify() calls. Signed-off-by: Itecz Solution <support@itecz.au>
mihaimaruseac
approved these changes
Jul 26, 2026
Member
|
Thank you and nice bug catch! |
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.
Summary
verifying.Config.verifycarried hashing state across models when the config is reused (the module docstring recommends reusing oneConfigfor many models):add_ignored_pathsand never reset, so they accumulated acrossverify()callsBuild the hashing config per call (deepcopy a caller-supplied one, else a fresh guess) and apply the signed ignore paths to that local copy so nothing persists across calls. The regression test signs one model that ignores a file, then a second model whose signature excludes nothing, and confirms an unsigned file planted at the first model's ignored path is now reported.
Checklist