CVE-2026-20613
Swift vulnerability analysis and mitigation

Overview

CVE-2026-20613 is a path traversal vulnerability in Apple's containerization and container Swift packages that allows a maliciously crafted archive to extract files into arbitrary user-writable locations on the system. The flaw resides in the ArchiveReader.extractContents() function, which performs no pathname validation before extracting archive members. Affected versions include containerization ≤ 0.20.1 and container ≤ 0.7.1 (Swift packages). The advisory was published on January 22, 2026. The CVSS v3.1 base score is 7.8 (High), while the GitHub Advisory Database assigns a CVSS v4 score of 1.9 (Low), reflecting the constrained local attack surface (GitHub Advisory, Apple Containerization Advisory).

Technical details

The root cause is CWE-22 (Improper Limitation of a Pathname to a Restricted Directory — Path Traversal). The vulnerable code in Sources/ContainerizationArchive/Reader.swift (line ~180) constructs the extraction target path by directly appending the archive entry's path to the destination directory URL (directory.appending(path: p)) without sanitizing or validating relative path components such as ../. An attacker crafts a tar archive containing entries with paths like ../../../../../../../tmp/pwned.txt; when a user loads this archive via cctl image load or container image load, the file is written to the traversed location. A working proof-of-concept Python script (make-evil-tar.py) is publicly available in the advisory (GitHub Advisory, Apple Containerization Advisory).

Impact

Successful exploitation allows an attacker to write arbitrary files to any location on the filesystem that is writable by the current user, potentially overwriting configuration files, shell initialization scripts, or other user-owned resources. The advisory explicitly notes this is not a privilege escalation — files can only be written to already user-writable locations — limiting the blast radius to the current user's permission scope. However, overwriting files such as ~/.bashrc, ~/.zshrc, SSH authorized keys, or application configuration files could enable persistent code execution or credential theft in the context of the affected user (GitHub Advisory, Apple Containerization Advisory).

Exploitability

A public proof-of-concept script (make-evil-tar.py) is included directly in the GitHub Security Advisory, demonstrating the ease of crafting a malicious archive. Exploitation requires user interaction — the victim must load a malicious archive image using cctl image load or container image load. There is no evidence of in-the-wild exploitation or threat actor attribution at this time. The EPSS score is approximately 0.006% (0.000060), indicating a very low probability of exploitation in the near term. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog (GitHub Advisory, Feedly).

Exploitation steps

  1. Craft a malicious archive: Use the published PoC script or manually create a tar archive containing an entry with a path-traversal filename (e.g., ../../../../../../../tmp/pwned.txt) and arbitrary file content.
import tarfile, io, time
with tarfile.open('evil.tar', 'w') as tar:
    info = tarfile.TarInfo(name='../../../../../../../../../../../tmp/pwned.txt')
    payload = b'pwned\n'
    info.size = len(payload)
    info.mtime = int(time.time())
    info.mode = 0o644
    tar.addfile(info, io.BytesIO(payload))
  1. Deliver the archive: Distribute the malicious evil.tar to the target user via social engineering, a compromised registry, or a supply chain attack, disguising it as a legitimate container image archive.
  2. Trigger extraction: Convince the victim to load the archive using cctl images load -i evil.tar (containerization project) or the equivalent container image load command.
  3. File written to traversed path: The ArchiveReader.extractContents() function appends the unvalidated path from the archive entry directly to the extraction directory, causing the file to be written to the attacker-specified location (e.g., /tmp/pwned.txt or a more sensitive user-writable path).
  4. Achieve objective: Depending on the chosen target path, the attacker can overwrite shell initialization files (~/.bashrc, ~/.zshrc), SSH authorized keys (~/.ssh/authorized_keys), or application configs to achieve persistent code execution or unauthorized access in the user's context (GitHub Advisory, Apple Containerization Advisory).

Indicators of compromise

  • File System: Unexpected files appearing in user home directories or other user-writable locations (e.g., /tmp/, ~/.ssh/, ~/.config/) shortly after a cctl image load or container image load operation; modifications to shell initialization files (~/.bashrc, ~/.zshrc, ~/.profile) with unexpected content.
  • Logs: System or application logs showing cctl or container processes writing files outside the expected extraction directory (e.g., /var/folders/... or a designated image staging area); file access audit logs (if enabled via auditd or macOS Unified Logging) recording writes to unexpected paths by the cctl or container process.
  • Process: Invocation of cctl images load or container image load with externally sourced or untrusted archive files; unexpected child processes or scripts executing from user home directories shortly after image load operations (GitHub Advisory).

Mitigation and workarounds

Apple has released patched versions addressing this vulnerability: containerization 0.21.0 and container 0.8.0. Users should upgrade to these versions immediately. The fix (commit 3e93416) adds pathname validation to ArchiveReader.extractContents() to prevent path traversal. As a workaround prior to upgrading, users should avoid loading container image archives from untrusted or unverified sources. Projects that depend on the containerization library and use the extractContent() function directly should also audit their usage and upgrade the dependency (GitHub Advisory, Apple Containerization Advisory).

Community reactions

The vulnerability was credited to researcher "LLfam" and published by maintainer "madrob" on January 22, 2026. Brief social media activity was observed on Bluesky shortly after disclosure. Red Hat also tracked the CVE via their security advisory system. No significant broader media coverage or notable researcher commentary beyond the official advisory has been identified (Apple Containerization Advisory, Red Hat CVE).

Additional resources


SourceThis report was generated using AI

Related Swift vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-28975MEDIUM6.9
  • Swift logoSwift
  • SwiftNIOExtras
NoYesJun 12, 2026
CVE-2026-47121MEDIUM6.1
  • Swift logoSwift
  • sparkle
NoYesJul 21, 2026
CVE-2026-64785MEDIUM5.3
  • Swift logoSwift
  • swift-nio-http2
NoYesJul 23, 2026
CVE-2026-28898MEDIUM5.3
  • Swift logoSwift
  • SwiftNIOHPACK
NoYesJun 25, 2026
CVE-2026-47122MEDIUM4.2
  • Swift logoSwift
  • sparkle
NoNoJul 21, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management