Add an API to resolve manifest lists#57
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new API to resolve OCI manifest lists, correctly handling platform and tag matching. However, the implementation lacks safeguards against malicious input, making it vulnerable to infinite recursion (stack overflow) via circular index references and potential memory exhaustion (OOM) when formatting error messages for indexes with a very large number of manifests, both of which can be exploited for Denial of Service. Additionally, my review identified a critical compilation issue related to platform matching logic and a high-severity bug in how nested image indices are resolved. Addressing these points will improve the robustness, correctness, and security of the new API.
0927145 to
8da25ab
Compare
f965e06 to
0baa1cb
Compare
0baa1cb to
a29c579
Compare
a29c579 to
f280162
Compare
Add open_image_this_platform() which resolves a manifest from an OCI directory for the native platform (OS and architecture). This handles manifest lists by peeling them one level to find platform-specific manifests. Returns ResolvedManifest containing: - The resolved manifest and its digest - The source image index and digest if resolution went through a manifest list Assisted-by: OpenCode (claude-opus-4-5) Signed-off-by: Colin Walters <walters@verbum.org>
f280162 to
e9282e1
Compare
|
I condensed the tests a bit more |
|
Hmm, this was merged over red. MSRV is pinned to 1.86 but assuming we're tracking el9 could be bumped to 1.88 which stabilizes this. |
|
Thanks for looking, that issue is partially in #61 I dropped the MSRV check entirely for now in that; but yeah we may need to re-add it at some point for our crates. If we do it needs to be done in a way that uses rust-version (the modern way). |
I wanted this in composefs-rs.