Skip to content

scope hashing config per verify call to stop ignore-path leak - #650

Merged
mihaimaruseac merged 1 commit into
sigstore:mainfrom
Support-itecz:verify-config-isolation
Jul 26, 2026
Merged

scope hashing config per verify call to stop ignore-path leak#650
mihaimaruseac merged 1 commit into
sigstore:mainfrom
Support-itecz:verify-config-isolation

Conversation

@Support-itecz

Copy link
Copy Markdown
Contributor

Summary

verifying.Config.verify carried hashing state across models when the config is reused (the module docstring recommends reusing one Config for many models):

  • 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, so they accumulated across verify() 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 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
  • All commits are signed-off, using DCO
  • All new code has docstrings and type annotations
  • All new code is covered by tests. Aim for at least 90% coverage. CI is configured to highlight lines not covered by tests.
  • Public facing changes are paired with documentation changes
  • Release note has been added to CHANGELOG.md if needed

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>
@Support-itecz
Support-itecz requested review from a team as code owners July 18, 2026 09:13
@mihaimaruseac
mihaimaruseac merged commit 6208d21 into sigstore:main Jul 26, 2026
52 checks passed
@mihaimaruseac

Copy link
Copy Markdown
Member

Thank you and nice bug catch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants