Skip to content

fix(verifier): restrict sigstore bundle path to model_dir - #254

Draft
AdityasagarR123 wants to merge 2 commits into
AOSSIE-Org:mainfrom
AdityasagarR123:fix/sigstore-bundle-path-traversal-238
Draft

AdityasagarR123 wants to merge 2 commits into
AOSSIE-Org:mainfrom
AdityasagarR123:fix/sigstore-bundle-path-traversal-238

Conversation

@AdityasagarR123

Copy link
Copy Markdown
Contributor

Addressed Issues:

Fixes #238

check_sigstore_bundle in src/verifier.py built the signature bundle path from the manifest's signature / sigstore_bundle value without verifying that the resolved path stays inside model_dir. Following the approach in #235, it now resolves model_dir and the declared signature path up front, raising ValueError if the signature path resolves outside model_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: resolve model_dir and the signature path up front, reject anything not is_relative_to(root) with ValueError.
  • tests/test_sigstore_bundle_paths.py: 6 tests covering normal in-directory verification, parent-relative paths (../), absolute paths, the sigstore_bundle manifest key, and symlinks escaping model_dir.

Tests:

  • New tests on main (before the fix): 3 failed (ValueError not raised), 1 passed (normal in-directory signature), 2 skipped (Windows non-admin symlink permissions).
  • With the fix: 4 passed, 2 skipped (on Windows without elevated symlink privileges; fully functional on Linux/macOS).
  • Unit tests: all 14 tests in tests/test_verifier.py:VerifierTests continue to pass.

Screenshots/Recordings:

Not applicable: no UI changes.

Additional Notes:

Draft PR addressing #238, following the approach approved in #235.

AI Usage Disclosure:

  • This PR does not contain AI-generated code at all.
  • This PR contains AI-generated code. I have read the AI Usage Policy and this PR complies with this policy. I have tested the code locally and I am responsible for it.

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

  • My PR addresses a single issue, fixes a single bug or makes a single improvement.
  • My code follows the project's code style and conventions
  • If applicable, I have made corresponding changes or additions to the documentation
  • If applicable, I have made corresponding changes or additions to tests
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contribution Guidelines
  • Once I submit my PR, CodeRabbit AI will automatically review it and I will address CodeRabbit's comments.
  • I have filled this PR template completely and carefully, and I understand that my PR may be closed without review otherwise.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

[BUG]: check_sigstore_bundle allows path traversal outside model directory via manifest signature

1 participant