CVE-2026-25121: 
NixOS vulnerability analysis and mitigation

Overview

CVE-2026-25121 is a path traversal vulnerability in Chainguard's apko tool, a utility for building and publishing OCI container images from APK packages. The flaw exists in apko's dirFS filesystem abstraction, allowing an attacker who can supply a malicious APK package to create directories or symlinks outside the intended installation root. It affects apko versions >= 0.14.8 and < 1.1.1 (Go module chainguard.dev/apko). Disclosed on February 3, 2026, by Oleh Konko from 1seal, it carries a CVSS v3.1 base score of 7.5 (High) (GitHub Advisory, GHSA).

Technical details

The root cause is improper path validation (CWE-22, CWE-23) in the MkdirAll, Mkdir, and Symlink methods within pkg/apk/fs/rwosfs.go. These methods use Go's filepath.Join() to construct paths without subsequently verifying that the resolved path remains within the designated base directory, enabling ../ sequences in APK tar headers to escape the filesystem root. An attacker exploits this by crafting a malicious APK package — deliverable via a compromised or typosquatted APK repository — containing tar headers with path traversal sequences (e.g., ../outside/pwned) as directory or symlink names. The fix (commit d8b7887) introduced a sanitizePath helper that validates all path constructions against the base directory and updated the helper to catch edge cases such as sanitizePath("../", "../..") (GitHub Advisory, Fix Commit).

Impact

Successful exploitation allows an attacker to write arbitrary directories, symlinks, or hardlinks to locations outside the intended container image build root on the host filesystem. This primarily impacts integrity (CVSS Integrity: High), as an attacker could plant malicious files or symlinks in sensitive host directories during the image build process, potentially enabling privilege escalation, persistence, or supply chain compromise of built container images. Confidentiality and availability are not directly impacted by this vulnerability (GitHub Advisory).

Exploitability

No public proof-of-concept exploit code or evidence of in-the-wild exploitation has been reported. The EPSS score is approximately 0.025% (7th percentile), indicating a low near-term exploitation probability (GHSA). The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Exploitation requires the ability to supply a malicious APK package to a vulnerable apko build pipeline, which could be achieved through a compromised upstream repository or a typosquatting attack.

Exploitation steps

  1. Identify a target: Locate a CI/CD pipeline or build environment using apko versions >= 0.14.8 and < 1.1.1 that pulls APK packages from a repository the attacker can influence.
  2. Craft a malicious APK: Create a malicious APK package containing a tar archive with entries using path traversal sequences (e.g., ../outside/pwned) as directory names or symlink names in the tar headers.
  3. Deliver the malicious APK: Publish the malicious package to a typosquatted or compromised APK repository, or perform a supply chain attack on a legitimate repository that the target pipeline trusts.
  4. Trigger apko installation: When the target apko build process installs the malicious APK, the vulnerable MkdirAll, Mkdir, or Symlink methods process the traversal paths without validation, writing directories or symlinks outside the intended build root on the host filesystem.
  5. Achieve objective: Leverage the written files or symlinks to plant backdoors, overwrite sensitive host files, or manipulate the resulting container image for downstream supply chain compromise (GitHub Advisory, Fix Commit).

Indicators of compromise

  • File System: Unexpected directories, symlinks, or hardlinks created outside the apko build root directory (e.g., in parent directories of the intended image build sandbox); files with ../ patterns in their originating paths.
  • Logs: Build logs from apko showing installation of APK packages from unfamiliar or newly registered repositories; errors or unexpected success messages during APK file extraction referencing paths outside the base directory.
  • Process: apko processes writing to filesystem paths outside the designated container image build directory during package installation steps.

Mitigation and workarounds

Upgrade apko to version 1.1.1 or later, which contains the fix introduced in commit d8b7887 (GitHub Advisory, Fix Commit). As a compensating control prior to patching, restrict apko build pipelines to only consume APK packages from trusted, verified repositories and implement repository integrity checks (e.g., signature verification). Running apko builds in isolated, sandboxed environments (e.g., containers with restricted filesystem mounts) can also limit the blast radius of a successful exploit.

Community reactions

The vulnerability was discovered and responsibly disclosed by Oleh Konko from security firm 1seal, and the Chainguard team credited multiple contributors for remediation coordination and review (GitHub Advisory). The issue was picked up by standard vulnerability aggregators and Linux security news outlets shortly after disclosure, with no notable broader community controversy or significant social media discussion identified.

Additional resources


Source: This report was generated using AI

Related NixOS vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-116199CRITICAL9.2
  • NixOS logoNixOS
  • cpe:2.3:a:snipeitapp:snipe-it
NoYesOct 25, 2026
CVE-2026-116201HIGH8.7
  • NixOS logoNixOS
  • cpe:2.3:a:snipeitapp:snipe-it
NoYesOct 25, 2026
CVE-2026-116200HIGH8.2
  • NixOS logoNixOS
  • cpe:2.3:a:snipeitapp:snipe-it
NoYesOct 25, 2026
CVE-2026-2270MEDIUM5.9
  • NixOS logoNixOS
  • kubernetes
NoYesOct 26, 2026
CVE-2026-76654MEDIUM5.8
  • NixOS logoNixOS
  • cpe:2.3:a:kubernetes:kubernetes
NoYesOct 26, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management