7.1high
Zarf has a Path Traversal via Malicious Package Metadata.Name — Arbitrary File Write
- Severity
- 7.1high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.33% (higher than 28% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-pj97-4p9w-gx3qGO-2026-5542
Description
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| zarf-dev zarf | >= 0.23.0, < 0.74.2 | CVE List |
| github.com/zarf-dev/zarf (Go) | from 0.23.0 before 0.74.2, from 0.37.0 before 0.74.2 | GitHub Advisory Database, Go Vulnerability Database |
| github.com/defenseunicorns/zarf (Go) | from 0.23.0 | Go Vulnerability Database |
| lfprojects zarf | from 0.23.0 before 0.74.2 | NVD |
All scores
| GitHub_M | 7.1high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L |
| GitHub | 7.1high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
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.
GitHub Advisory Database
Impact
This vulnerability impacts users of zarf package inspect sbom or zarf package inspect documentation on untrusted packages.
Patches
#4793, now fixed in version v0.74.2
Workarounds
Avoid inspecting unsigned packages
Description
The package inspect sbom and package inspect documentation subcommands construct output file paths by joining a user-controlled output directory with the package's Metadata.Name field, which is attacker-controlled data read from the package archive. The Metadata.Name field is validated against a regex on create, ^[a-z0-9][a-z0-9\-]*$, however a malicious user could unarchive a package to change the .Metadata.Name field and the files inside the SBOMS.tar. This would lead to arbitrary file write in a location of the attackers choosing.
Neither location sanitizes or validates the package name before using it in the file path.
SBOM inspection:
outputPath := filepath.Join(o.outputDir, pkgLayout.Pkg.Metadata.Name)
err = pkgLayout.GetSBOM(ctx, outputPath)
Documentation inspection (line 1219):
outputPath := filepath.Join(o.outputDir, fmt.Sprintf("%s-documentation", pkgLayout.Pkg.Metadata.Name))
return pkgLayout.GetDocumentation(ctx, outputPath, o.keys)
pkgLayout.Pkg.Metadata.Name is read directly from the untrusted package's zarf.yaml manifest. An attacker can craft a malicious Zarf package where Metadata.Name contains path traversal sequences or root paths such as ../../etc/cron.d/malicious or /home/user/.ssh/authorized_keys.
CVSS Explainations
Attack Vector
Verdict: Network
A malicious package could be published to OCI and inspected directly with zarf package inspect sbom oci://<bad-package>
Attack Complexity
Verdict: Low It is not complicated to make and publish a malicious package. The Attacker only needs to edit the zarf.yaml and sboms.tar then edit the checksums.
Privileges Required
Verdict: None
The attacker is relying on the runner of zarf package inspect sbom|documentation and needs no other privileges.
User Interaction
Verdict: Required The user must run the inspect command
Scope
Verdict: Unchanged The vulnerability operates entirely within the permissions of the user running zarf package inspect. The file write can't escape the privilege boundary of that user
Confidentiality
Verdict: None This is an arbitrary file write vulnerability. The attacker can place or overwrite files on the filesystem but the vulnerability does not provide any mechanism to read or exfiltrate data from the target system.
Integrity
Verdict: High The attacker controls both the file path (via Metadata.Name) and the file content (via the SBOM or documentation files inside the archive). This allows writing attacker-controlled content to arbitrary locations on the filesystem, limited only by the permissions of the user running the inspect command. Realistic exploitation includes writing SSH authorized_keys, cron jobs, or shell profiles.
Availability
Verdict: Low The vulnerability does not directly target service availability. However, an attacker could overwrite files that cause system disruption.
Go Vulnerability Database
A path traversal vulnerability in Zarf allows an attacker to write arbitrary files on the host system by providing a malicious package name in the package metadata. This occurs when Zarf generates SBOM or documentation outputs, or when creating a package, as it fails to properly sanitize the package name before using it in a file path.
References
| https://github.com/zarf-dev/zarf/security/advisories/GHSA-pj97-4p9w-gx3q | advisory, patch, vendor-advisory, web | |
| https://github.com/zarf-dev/zarf/pull/4793 | fix, issue-tracking, patch, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-40090 | advisory | |
| https://github.com/zarf-dev/zarf | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-40090 changed 2026-04-15 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-pj97-4p9w-gx3q changed 2026-07-23 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2026-5542 changed 2026-07-23 | CC-BY-4.0 |
| NVD | CVE-2026-40090 changed 2026-06-17 | Public domain |