Skip to content

fix: reject empty models during signing and verification - #662

Merged
mihaimaruseac merged 1 commit into
sigstore:mainfrom
sampras343:fix/reject-empty-model-signing
Sep 4, 2026
Merged

fix: reject empty models during signing and verification#662
mihaimaruseac merged 1 commit into
sigstore:mainfrom
sampras343:fix/reject-empty-model-signing

Conversation

@sampras343

Copy link
Copy Markdown
Contributor

Summary

  • Signing now rejects models with no regular files after applying exclusions, per OMS spec v1.0 §6.1 ("an empty model MUST be rejected") and §5.2.1 ("the resources array MUST contain at least one entry")
  • Shard serialization additionally rejects models containing only zero-byte files, which produce no shards per §6.3.2
  • Verification rejects bundles with an empty resources array, preventing previously-signed empty bundles from passing

Closes #661

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

@sampras343
sampras343 requested review from a team as code owners September 4, 2026 10:27
@sampras343
sampras343 marked this pull request as draft September 4, 2026 10:28
@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@sampras343
sampras343 force-pushed the fix/reject-empty-model-signing branch from f2813ee to 9dfd253 Compare September 4, 2026 10:29
@sampras343
sampras343 marked this pull request as ready for review September 4, 2026 10:32
Comment thread tests/_serialization/file_shard_test.py Outdated
Per OMS spec v1.0 §6.1, a model MUST contain at least one regular file
after exclusions are applied, and §5.2.1 requires the resources array
to contain at least one entry. Previously, signing an empty directory
succeeded and produced a bundle with resources: [], which also passed
verification.

- Signing now rejects models with no regular files after exclusions
- Shard serialization rejects models with only zero-byte files (which
  produce no shards per §6.3.2)
- Verification rejects bundles with an empty resources array
- Updated tests to validate rejection and use appropriate model lists

Signed-off-by: Sachin Sampras M <sampras343@gmail.com>
@sampras343
sampras343 force-pushed the fix/reject-empty-model-signing branch from 9dfd253 to cea01ec Compare September 4, 2026 13:21
@mihaimaruseac
mihaimaruseac merged commit 4a1f8d7 into sigstore:main Sep 4, 2026
52 checks passed
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.

Signing and verifying an empty model directory succeeds instead of being rejected

2 participants