{"id":"CVE-2026-40090","aliases":["CVE-2026-40090","GHSA-pj97-4p9w-gx3q","GO-2026-5542"],"related":[],"kind":"vulnerability","state":"published","title":"Zarf has a Path Traversal via Malicious Package Metadata.Name — Arbitrary File Write","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Impact\nThis vulnerability impacts users of `zarf package inspect sbom` or `zarf package inspect documentation` on untrusted packages.\n\n### Patches\n#4793, now fixed in version v0.74.2\n\n### Workarounds\nAvoid inspecting unsigned packages\n\n## Description\n\nThe `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. \n\nNeither location sanitizes or validates the package name before using it in the file path.\n\n**SBOM inspection:**\n```go\noutputPath := filepath.Join(o.outputDir, pkgLayout.Pkg.Metadata.Name)\nerr = pkgLayout.GetSBOM(ctx, outputPath)\n```\n\n**Documentation inspection (line 1219):**\n```go\noutputPath := filepath.Join(o.outputDir, fmt.Sprintf(\"%s-documentation\", pkgLayout.Pkg.Metadata.Name))\nreturn pkgLayout.GetDocumentation(ctx, outputPath, o.keys)\n```\n\n`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`.\n\n### CVSS Explainations\n#### Attack Vector\nVerdict: Network\nA malicious package could be published to OCI and inspected directly with `zarf package inspect sbom oci://<bad-package>`\n\n#### Attack Complexity \nVerdict: Low\nIt 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.\n\n#### Privileges Required\nVerdict: None\nThe attacker is relying on the runner of `zarf package inspect sbom|documentation` and needs no other privileges.\n\n#### User Interaction\nVerdict: Required\nThe user must run the inspect command\n\n#### Scope\nVerdict: Unchanged\nThe 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 \n\n#### Confidentiality\nVerdict: None\nThis 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.\n\n#### Integrity\nVerdict: High\nThe 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.\n\n### Availability\nVerdict: Low\nThe vulnerability does not directly target service availability. However, an attacker could overwrite files that cause system disruption.","format":"markdown","source":"ghsa"},{"lang":"en","text":"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.","format":"markdown","source":"go"}],"published":"2026-04-14T22:32:53.000Z","modified":"2026-07-23T17:11:37.884Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L","score":7.1,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L","score":7.1,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L","score":7.1,"rating":"HIGH"}],"cwes":["CWE-22"],"affected":[{"ranges":[{"version":">= 0.23.0, < 0.74.2","status":"affected"}],"vendor":"zarf-dev","product":"zarf","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.23.0","status":"affected","fixed":"0.74.2"}],"ecosystem":"Go","package":"github.com/zarf-dev/zarf","purl":"pkg:golang/github.com/zarf-dev/zarf","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.23.0","status":"affected"}],"ecosystem":"Go","package":"github.com/defenseunicorns/zarf","purl":"pkg:golang/github.com/defenseunicorns/zarf","source":"go"},{"ranges":[{"type":"semver","introduced":"0.37.0","status":"affected","fixed":"0.74.2"}],"ecosystem":"Go","package":"github.com/zarf-dev/zarf","purl":"pkg:golang/github.com/zarf-dev/zarf","source":"go"},{"ranges":[{"status":"affected","introduced":"0.23.0","fixed":"0.74.2"}],"vendor":"lfprojects","product":"zarf","cpe":"cpe:2.3:a:lfprojects:zarf:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/zarf-dev/zarf/security/advisories/GHSA-pj97-4p9w-gx3q","tags":["advisory","patch","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/zarf-dev/zarf/pull/4793","tags":["fix","issue-tracking","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40090","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/zarf-dev/zarf","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-04-15T16:04:08.362Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-40090","url":"https://www.cve.org/CVERecord?id=CVE-2026-40090","licence":"CVE Terms of Use","modified":"2026-04-15T16:13:54.180Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-pj97-4p9w-gx3q","url":"https://github.com/advisories/GHSA-pj97-4p9w-gx3q","licence":"CC-BY-4.0","modified":"2026-07-23T17:11:37.884Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5542","url":"https://pkg.go.dev/vuln/GO-2026-5542","licence":"CC-BY-4.0","modified":"2026-07-23T17:00:24.617Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-40090","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40090","licence":"Public domain","modified":"2026-06-17T10:44:42.457Z"}],"updatedAt":"2026-11-25T22:59:18.814Z","epss":{"score":0.00333,"percentile":0.28587,"date":"2026-12-01T12:00:22.000Z"}}