Vulnerabilities in pkg:golang/github.com/zarf-dev/zarf
PACKAGECVE-2026-40090 is a HIGH (CVSS 7.1) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Github.com/zarf dev/zarf libraries in the Go ecosystem. The issue involves zarf has a path traversal via malicious package metadata.name — arbitrary file write. Remediation is available by upgrading affected packages to version 0.74.2.
pkg:golang/github.com/zarf-dev/zarf
Vulnerability advisories affecting package pkg:golang/github.com/zarf-dev/zarf. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-pj97-4p9w-gx3q | CVE-2026-40090 | HIGH | Zarf has a Path Traversal via Malicious Package Metadata.Name — Arbitrary File Write |
CVE-2026-40090 at a Glance
Security Impact
CVSS: 7.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L).
How to Fix CVE-2026-40090
To remediate this vulnerability, upgrade all affected Github.com/zarf dev/zarf dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/zarf-dev/zarf to 0.74.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/zarf-dev/zarf
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-40090, inspect your project dependencies for Github.com/zarf dev/zarf:
inspect dependencies for github.com/zarf-dev/zarf
Analyze the terminal output to locate any version of Github.com/zarf dev/zarf in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.74.2), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Github.com/zarf dev/zarf, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-40090 Affected Github.com/zarf dev/zarf Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/zarf-dev/zarf
|
Go |
≥ 0.23.0
< 0.74.2
|
0.74.2
|
References
Frequently Asked Questions
What is CVE-2026-40090?
Which Github.com/zarf dev/zarf versions are affected?
What version fixes CVE-2026-40090?
Is github.com/zarf-dev/zarf affected?
What is the CVSS score of CVE-2026-40090?
What CWE is associated with CVE-2026-40090?
How can I check Go dependencies for CVE-2026-40090?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-pj97-4p9w-gx3q",
"modified" : "2026-04-24T20:42:46Z",
"published" : "2026-04-14T22:32:53Z",
"aliases" : [ "CVE-2026-40090" ],
"summary" : "Zarf has a Path Traversal via Malicious Package Metadata.Name — Arbitrary File Write",
"details" : "### 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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/zarf-dev/zarf"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.23.0"
}, {
"fixed" : "0.74.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/zarf-dev/zarf/security/advisories/GHSA-pj97-4p9w-gx3q"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-40090"
}, {
"type" : "WEB",
"url" : "https://github.com/zarf-dev/zarf/pull/4793"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/zarf-dev/zarf"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-04-14T22:32:53Z",
"nvd_published_at" : "2026-04-15T04:17:43Z"
}
}