Repository navigation
fix(verifier): restrict sigstore bundle path to model_dir - #254
Draft
AdityasagarR123 wants to merge 2 commits into
Draft
AdityasagarR123 wants to merge 2 commits into
AdityasagarR123 wants to merge 2 commits into
Conversation
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Addressed Issues:
Fixes #238
check_sigstore_bundleinsrc/verifier.pybuilt the signature bundle path from the manifest'ssignature/sigstore_bundlevalue without verifying that the resolved path stays insidemodel_dir. Following the approach in #235, it now resolvesmodel_dirand the declared signature path up front, raisingValueErrorif the signature path resolves outsidemodel_dir(including parent directory traversal sequences, absolute paths, and escaping symlinks). Fallback-discovered signature paths are also verified to ensure symlinks cannot escape the model root.Changes (2 files, +128/-7):
src/verifier.py: resolvemodel_dirand the signature path up front, reject anything notis_relative_to(root)withValueError.tests/test_sigstore_bundle_paths.py: 6 tests covering normal in-directory verification, parent-relative paths (../), absolute paths, thesigstore_bundlemanifest key, and symlinks escapingmodel_dir.Tests:
tests/test_verifier.py:VerifierTestscontinue to pass.Screenshots/Recordings:
Not applicable: no UI changes.
Additional Notes:
Draft PR addressing #238, following the approach approved in #235.
AI Usage Disclosure:
I have used the following AI models and tools: Antigravity (Google DeepMind), for drafting the fix and tests; I reviewed and tested them locally.
Checklist