Fedora Account System
Red Hat Associate
Red Hat Customer
A path traversal flaw was found in the v1 engine of oc-mirror. The unarchive() function in v1/pkg/cli/mirror/publish.go computes the output path for each tar entry as filepath.Join(dest, header.Name), with the only check being that the entry name starts with the "catalogs" prefix. filepath.Join cleans the path but does not prevent escapes, so a mirror-archive containing an entry named catalogs/../../<path> causes oc-mirror --v1 --from to write a file with attacker-chosen content and mode at an arbitrary location outside the destination directory on the importing host, which can lead to code execution by overwriting an executed file. The path validation helper introduced for the catalog image extraction paths is not applied to this function.