Zarf has a Path Traversal via Malicious Package Metadata.Name — Arbitrary File Write
zarf-dev zarf
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| github.com/zarf-dev/zarf Go |
|
|
| github.com/defenseunicorns/zarf Go |
| No fix yet |
zarf-dev zarf
| Product | Affected | Fixed in |
|---|---|---|
| github.com/zarf-dev/zarf Go |
|
|
| github.com/defenseunicorns/zarf Go |
| No fix yet |
Zarf is an Airgap Native Packager Manager for Kubernetes. Versions 0.23.0 through 0.74.1 contain an arbitrary file write vulnerability in the zarf package inspect sbom and zarf package inspect documentation subcommands. These subcommands output file paths are constructed by joining a user-controlled output directory with the package's Metadata.Name field read directly from the untrusted package's zarf.yaml manifest. Although Metadata.Name is validated against a regex on package creation, an attacker can unarchive a package to modify the Metadata.Name field to contain path traversal sequences such as ../../etc/cron.d/malicious or absolute paths like /home/user/.ssh/authorized_keys, along with the corresponding files inside SBOMS.tar. This allows writing attacker-controlled content to arbitrary filesystem locations within the permissions of the user running the inspect command. This issue has been fixed in version 0.74.2.
From the CVE record · GitHub_M
Zarf package inspect sbom and documentation subcommands in versions 0.23.0 through 0.74.1 use a package-controlled name to construct output paths. An attacker who supplies a modified package can cause a user running either inspect command to write attacker-controlled files outside the chosen output directory, wherever that user's filesystem permissions allow.
Engineers using github.com/zarf-dev/zarf versions 0.23.0 through 0.74.1 or github.com/defenseunicorns/zarf versions 0.23.0 and later should check their installations.