Advisory Database
  • Advisories
  • Dependency Scanning
  1. golang
  2. ›
  3. chainguard.dev/apko
  4. ›
  5. CVE-2026-42574

CVE-2026-42574: apko dirFS has a symlink-following path traversal that allows multiple entry points to escape the build root

May 4, 2026

A crafted .apk could install a TypeSymlink tar entry whose target pointed outside the build root, and a subsequent directory-creation or file-write entry in the same or later archive could traverse that symlink to reach host paths the build user could write to. The root cause was the sanitizePath helper in pkg/apk/fs/rwosfs.go, which rejected only lexical .. traversal and did not resolve or refuse symlinks. Every disk-backed DirFS method that handed its caller-supplied path to a symlink-following stdlib call — ReadFile, WriteFile, Chmod, Chown, Chtimes, MkdirAll, Mkdir, and Mknod — was affected. The reachable primitive from a malicious APK during tar extraction is the MkdirAll / Mkdir / WriteFile chain via apko build-cpio and disk-backed consumers such as melange; the remaining sinks are reachable by direct callers of the pkg/apk/fs package. The in-memory tarfs install path used by apko build, apko publish, and apko build-minirootfs is not affected.

References

  • github.com/advisories/GHSA-qq3r-w4hj-gjp6
  • github.com/chainguard-dev/apko
  • github.com/chainguard-dev/apko/commit/f5a96e1299ac81c7ea9441705ec467688086f442
  • github.com/chainguard-dev/apko/pull/2187
  • github.com/chainguard-dev/apko/releases/tag/v1.2.5
  • github.com/chainguard-dev/apko/security/advisories/GHSA-qq3r-w4hj-gjp6
  • nvd.nist.gov/vuln/detail/CVE-2026-42574

Code Behaviors & Features

Detect and mitigate CVE-2026-42574 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 0.14.8 before 1.2.5

Fixed versions

  • 1.2.5

Solution

Upgrade to version 1.2.5 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Learn more about CVSS

Weakness

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
  • CWE-59: Improper Link Resolution Before File Access ('Link Following')

Source file

go/chainguard.dev/apko/CVE-2026-42574.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 09 May 2026 12:18:06 +0000.