{"description":"Trending threats, MITRE ATT\u0026CK coverage, and detection metadata — refreshed continuously.","feed_url":"https://feed.craftedsignal.io/tags/cve-2026-42574/","home_page_url":"https://feed.craftedsignal.io/","items":[{"_cs_actors":[],"_cs_cves":[],"_cs_exploited":false,"_cs_products":["apko (\u003c 1.2.5)"],"_cs_severities":["high"],"_cs_tags":["path-traversal","symlink","apko","vulnerability","CVE-2026-42574"],"_cs_type":"advisory","_cs_vendors":["Chainguard"],"content_html":"\u003cp\u003eA path traversal vulnerability exists in apko\u0026rsquo;s \u003ccode\u003eDirFS\u003c/code\u003e component, specifically within the \u003ccode\u003esanitizePath\u003c/code\u003e helper function in versions prior to 1.2.5. The vulnerability allows a malicious \u003ccode\u003e.apk\u003c/code\u003e file to install a \u003ccode\u003eTypeSymlink\u003c/code\u003e tar entry pointing outside the intended build root. Subsequent directory creation or file writing operations could then traverse this symbolic link, leading to unauthorized access and modification of files on the host system. This issue affects users of apko and downstream tools, such as melange, that embed vulnerable versions of the \u003ccode\u003epkg/apk/fs\u003c/code\u003e package. The vulnerability was addressed in apko version 1.2.5 with the introduction of \u003ccode\u003e*os.Root\u003c/code\u003e, which prevents path traversal.\u003c/p\u003e\n\u003ch2 id=\"attack-chain\"\u003eAttack Chain\u003c/h2\u003e\n\u003col\u003e\n\u003cli\u003eAn attacker crafts a malicious \u003ccode\u003e.apk\u003c/code\u003e file containing a \u003ccode\u003eTypeSymlink\u003c/code\u003e tar entry.\u003c/li\u003e\n\u003cli\u003eThe symbolic link\u0026rsquo;s target is set to a path outside the intended build root, potentially targeting sensitive system directories.\u003c/li\u003e\n\u003cli\u003eThe malicious \u003ccode\u003e.apk\u003c/code\u003e is processed using a vulnerable version of apko (prior to 1.2.5) via commands like \u003ccode\u003eapko build-cpio\u003c/code\u003e or through disk-backed consumers such as \u003ccode\u003emelange\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eDuring tar extraction, the vulnerable \u003ccode\u003esanitizePath\u003c/code\u003e function fails to properly resolve or refuse the malicious symlink.\u003c/li\u003e\n\u003cli\u003eA subsequent directory-creation or file-write operation is initiated within the same or a later archive entry.\u003c/li\u003e\n\u003cli\u003eThe file operation traverses the previously created symbolic link, gaining access to the file system location outside the intended build root.\u003c/li\u003e\n\u003cli\u003eThe attacker can then create directories or write files to the compromised location, potentially overwriting critical system files or injecting malicious code.\u003c/li\u003e\n\u003cli\u003eSuccessful exploitation can lead to privilege escalation and persistent compromise of the host system.\u003c/li\u003e\n\u003c/ol\u003e\n\u003ch2 id=\"impact\"\u003eImpact\u003c/h2\u003e\n\u003cp\u003eSuccessful exploitation of this vulnerability allows an attacker to write files to arbitrary locations on the host system. This can lead to privilege escalation if the attacker can overwrite setuid binaries or modify system configuration files. It can also lead to persistent compromise of the system if the attacker injects malicious code into startup scripts or other system files. While the exact number of victims is unknown, any system running a vulnerable version of apko (prior to 1.2.5) or tools embedding vulnerable versions of \u003ccode\u003epkg/apk/fs\u003c/code\u003e, such as melange, is potentially at risk.\u003c/p\u003e\n\u003ch2 id=\"recommendation\"\u003eRecommendation\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eUpgrade apko to version 1.2.5 or later. This version includes a fix that prevents path traversal vulnerabilities as described in the advisory and commit \u003ca href=\"https://github.com/chainguard-dev/apko/commit/f5a96e1299ac81c7ea9441705ec467688086f442\"\u003ef5a96e1\u003c/a\u003e.\u003c/li\u003e\n\u003cli\u003eIf upgrading is not immediately feasible, avoid consuming APKs from untrusted sources. However, note that this does not fully eliminate the risk.\u003c/li\u003e\n\u003cli\u003eMonitor file creation events in sensitive directories for unexpected activity, especially after processing \u003ccode\u003e.apk\u003c/code\u003e files.\u003c/li\u003e\n\u003c/ul\u003e\n","date_modified":"2024-01-02T12:00:00Z","date_published":"2024-01-02T12:00:00Z","id":"/briefs/2024-01-apko-path-traversal/","summary":"A symlink-following path traversal vulnerability exists in apko versions prior to 1.2.5 allowing a malicious .apk file to create a symbolic link pointing outside the build root and subsequently modify files on the host system.","title":"Apko DirFS Symlink Path Traversal Vulnerability","url":"https://feed.craftedsignal.io/briefs/2024-01-apko-path-traversal/"}],"language":"en","title":"CraftedSignal Threat Feed — CVE-2026-42574","version":"https://jsonfeed.org/version/1.1"}