CVE-2026-25121
📋 TL;DR
A path traversal vulnerability in apko's dirFS filesystem abstraction allows attackers to create directories or symlinks outside the intended installation root. This affects users building OCI container images with apko versions 0.14.8 through 1.1.0. Attackers can exploit this by supplying malicious APK packages through compromised or typosquatted repositories.
💻 Affected Systems
- apko
📦 What is this software?
Apko by Chainguard
⚠️ Risk & Real-World Impact
Worst Case
Complete container escape leading to host system compromise, arbitrary file/directory creation/modification on host, privilege escalation, and lateral movement within the environment.
Likely Case
Container escape allowing unauthorized file system access on the host, potential for data exfiltration, and disruption of containerized applications.
If Mitigated
Limited impact if container runs with minimal privileges, read-only root filesystem, and proper network segmentation.
🎯 Exploit Status
Exploitation requires attacker to supply malicious APK package during apko build process.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 1.1.1
Vendor Advisory: https://github.com/chainguard-dev/apko/security/advisories/GHSA-5g94-c2wx-8pxw
Restart Required: No
Instructions:
1. Update apko to version 1.1.1 or later using your package manager. 2. Rebuild any container images created with vulnerable apko versions. 3. Verify the fix by checking apko version with 'apko version' command.
🔧 Temporary Workarounds
Use trusted APK repositories only
allOnly use verified, trusted APK repositories during apko builds to prevent malicious package injection.
Run containers with minimal privileges
linuxConfigure containers to run with non-root users, read-only root filesystems, and dropped capabilities.
docker run --read-only --user 1000:1000 --cap-drop=ALL image_name
🧯 If You Can't Patch
- Only build containers from trusted APK repositories with verified packages.
- Implement strict access controls and monitoring for container build pipelines.
🔍 How to Verify
Check if Vulnerable:
Check apko version with 'apko version' command. If version is between 0.14.8 and 1.1.0 inclusive, system is vulnerable.
Check Version:
apko version
Verify Fix Applied:
Run 'apko version' and confirm version is 1.1.1 or higher. Test building a container image with apko to ensure normal operation.
📡 Detection & Monitoring
Log Indicators:
- Unexpected file/directory creation outside container root
- Suspicious symlink creation attempts
- APK package downloads from untrusted sources
Network Indicators:
- Connections to unknown/unverified APK repositories during build process
SIEM Query:
source="apko" AND (event="mkdir" OR event="symlink") AND path NOT STARTS WITH "/root"