Vulnerabilities in pkg:golang/github.com/zarf-dev/zarf

PACKAGE
Advisory Identifier: GHSA-pj97-4p9w-gx3q
Advisory Summary

CVE-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.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/zarf-dev/zarf

1 Known Advisory Record(s)

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

CVE Identifier CVE-2026-40090
GHSA Identifier GHSA-pj97-4p9w-gx3q
Severity HIGH
CVSS v3.1 Base Score 7.1
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Github.com/zarf dev/zarf
Package Ecosystem Go
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability Low (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.

github.com/zarf-dev/zarf fixed: 0.74.2
Upgrade github.com/zarf-dev/zarf to 0.74.2
Verify Direct and Transitive Dependencies

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

### 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:** ```go outputPath := filepath.Join(o.outputDir, pkgLayout.Pkg.Metadata.Name) err = pkgLayout.GetSBOM(ctx, outputPath) ``` **Documentation inspection (line 1219):** ```go 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.

CVE-2026-40090 Affected Github.com/zarf dev/zarf Versions

1 component(s)
Fixed Versions:
0.74.2
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?
CVE-2026-40090 is a security vulnerability in Github.com/zarf dev/zarf involving Zarf has a Path Traversal via Malicious Package Metadata.Name — Arbitrary File Write under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Github.com/zarf dev/zarf versions are affected?
Affected versions include releases prior to 0.74.2 across affected packages: github.com/zarf-dev/zarf.
What version fixes CVE-2026-40090?
Upgrading to 0.74.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/zarf-dev/zarf affected?
Yes, github.com/zarf-dev/zarf is affected in releases prior to 0.74.2. Upgrade your dependency to 0.74.2 or later.
What is the CVSS score of CVE-2026-40090?
CVE-2026-40090 has a CVSS v3.1 base score of 7.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L.
What CWE is associated with CVE-2026-40090?
CVE-2026-40090 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (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.).
How can I check Go dependencies for CVE-2026-40090?
Run the dependency tree command: 'inspect dependencies for github.com/zarf-dev/zarf'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}