fix: validate digest-addressed manifest uploads - #8
Open
KAJdev wants to merge 1 commit into
Open
Conversation
jebenexer
approved these changes
Jul 30, 2026
jebenexer
left a comment
There was a problem hiding this comment.
LGTM — validation is placed correctly (after digest computation, before any JSON parse or R2 write), returns a proper OCI DIGEST_INVALID error, and the test verifies both the rejection and that neither the forged nor the real digest gets written to R2.
Two non-blocking notes:
- Case sensitivity: comparison is case-sensitive against a
sha256:prefix. Worth a quick test with an uppercase-hex digest to confirm/document that it's rejected as malformed rather than silently normalized — but rejecting is the safe default either way. - Direct-upload path bypass (pre-existing, not introduced here):
finishUpload'sstate.directpath (r2.ts ~834-861) trusts the client-provided digest when R2 checksum metadata is missing, which is a separate integrity gap from what this PR fixes. Filing a follow-up ticket for that rather than blocking this PR on it.
Approving — this closes a real digest-spoofing gap for the standard upload path.
|
Filed the direct-upload bypass follow-up as SLS-468: https://linear.app/runpod/issue/SLS-468/serverless-registry-direct-upload-path-trusts-client-digest-when-r2 |
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.
Validates digest-addressed manifest uploads against the SHA-256 computed from the request body before any manifest object is written. Mismatches return the OCI-compatible
DIGEST_INVALIDclient error, preserving the integrity guarantee of digest-pinned pulls.Addresses SLS-305.