Improve snapshot/oci validation#1668
Merged
Merged
Conversation
ludfjig
requested review from
andreiltd,
danbugs,
dblnz,
devigned,
jprendes,
jsturtevant,
simongdavies,
squillace and
syntactically
as code owners
July 20, 2026 20:24
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens validation when loading OCI snapshot layouts and snapshot config metadata in hyperlight_host, reducing the chance of accepting malformed images or unsafe artifact files.
Changes:
- Validate OCI
index.jsonand manifestschemaVersion/mediaTypemore strictly during load, with clearer error text. - Harden artifact file handling by rejecting non-regular files (e.g., FIFOs) when opening blobs.
- Strengthen snapshot config validation (
pt_sizepresence/nonzero, entrypoint bounds within code region, stack alignment) and add/extend regression tests.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/hyperlight_host/src/sandbox/snapshot/file/mod.rs |
Adds OCI index/manifest schema and media-type validation and improves media-type error formatting. |
src/hyperlight_host/src/sandbox/snapshot/file/fsutil.rs |
Prevents opening non-regular blob paths (and avoids FIFO blocking on Unix) plus adds a FIFO rejection test. |
src/hyperlight_host/src/sandbox/snapshot/file/config.rs |
Makes snapshot layout validation stricter (required pt_size, code-region entrypoint bounds, alignment checks). |
src/hyperlight_host/src/sandbox/snapshot/file_tests.rs |
Adds regression tests covering the new validation behavior and edge cases. |
CHANGELOG.md |
Notes the user-visible behavior change: stricter snapshot/OCI validation and non-regular file rejection. |
andreiltd
previously approved these changes
Jul 21, 2026
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
ludfjig
force-pushed
the
harden-oci-snapshot-loading
branch
from
July 21, 2026 16:57
1ee43b1 to
8e13a04
Compare
jsturtevant
approved these changes
Jul 21, 2026
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.
Just come misc improvements