CVE-2026-25121: apko is vulnerable to path traversal in apko dirFS which allows filesystem writes outside base
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.
Fix: Fixed by d8b7887. Merged into release.
Acknowledgements apko thanks Oleh Konko from 1seal for discovering and reporting this issue.
Other sources
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.
— MITRE
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2026-25121?
CVE-2026-25121 is classified as a high severity vulnerability due to the potential for directory traversal and unauthorized access.
How do I fix CVE-2026-25121?
To fix CVE-2026-25121, upgrade to apko version 1.1.0 or later.
What systems are affected by CVE-2026-25121?
CVE-2026-25121 affects versions of apko from 0.14.8 up to 1.1.0.
What kind of attack does CVE-2026-25121 enable?
CVE-2026-25121 enables attackers to create directories or symlinks outside the intended installation root using a malicious APK.
Can CVE-2026-25121 affect my application security?
Yes, CVE-2026-25121 can compromise application security by allowing unauthorized file system access.