/

CVE-2026-20613

Severity:

HIGH RISK

(7.8)

Path Traversal in Container ArchiveReader.extractContents

CVE-2026-20613

Analyzed

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Write

Severity:

HIGH RISK

(7.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A path traversal flaw in ArchiveReader.extractContents(), used by cctl image load and container image load, allows archive entries to be extracted without validating their pathnames.

If an attacker supplies a crafted archive with malicious relative paths, files can be written to arbitrary user-writable locations on the host, potentially overwriting or planting files in sensitive directories.

Affected context

This vulnerability arises in environments where container images or archives are imported using cctl image load or similar container image load workflows.

The affected function, ArchiveReader.extractContents(), trusts the pathnames inside the archive and writes them directly to the filesystem without normalization or restriction.

The risk is most pronounced when archives originate from untrusted or semi-trusted sources, or when automated tooling imports images without manual inspection.

Exploit preconditions

  • Attack surface: Archive or container image loading functionality (e.g., cctl image load, container image load).
  • Required access: Ability to supply or influence the archive/image being loaded, such as publishing a crafted image, providing an archive file, or man-in-the-middle of a distribution channel.
  • Trigger point: Execution of the archive extraction routine, where ArchiveReader.extractContents() processes member paths from the archive.
  • Why exploitation is possible: Member filenames from the archive are not normalized or validated, so path components like ../ or absolute/relative paths are honored, allowing extraction outside the intended target directory into any user-writable path.

Why this happens

The core issue is a missing validation and normalization step for archive entry paths before writing them to the filesystem.

ArchiveReader.extractContents() treats archive member names as trustworthy and directly concatenates them with the output directory, without preventing directory traversal constructs, absolute paths, or other unsafe patterns.

This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, where user-controlled path data can escape the intended extraction root and affect arbitrary paths within the scope of the running user's privileges.

Potential impact

  • Overwriting existing files in user-writable locations, potentially altering configuration or runtime behavior.
  • Planting new files in directories that are later executed or read by other processes, enabling local code or script execution in certain configurations.
  • Tampering with application or user data, causing integrity loss or data corruption.
  • Facilitating follow-on attacks if extracted files are consumed by other components that assume they are trustworthy.

General mitigation guidance

Effective mitigation focuses on constraining where files can be written during archive extraction and reducing trust in archive metadata:

  • Normalize and sanitize archive member paths before extraction, rejecting entries that resolve outside the intended extraction root or contain path traversal tokens (e.g., ../, absolute paths).
  • Enforce a strict extraction root and resolve the final destination path using canonical path resolution, aborting extraction if it escapes the designated directory.
  • Implement allowlists for permissible paths or directory prefixes when handling archives from untrusted sources.
  • Run archive processing components with least privilege, ensuring that the executing user has access only to a minimal set of directories.
  • Treat externally sourced container images and archives as untrusted input, incorporating validation into the loading pipeline rather than assuming publisher correctness.

How teams detect issues like this

Organizations can detect and manage this class of issue through a combination of code-level and operational controls:

  • Static analysis rules that flag uses of archive extraction APIs where member paths are written without normalization or checks against a fixed root directory.
  • Code review checklists that explicitly call out archive and file extraction logic, requiring reviewers to verify path sanitization and canonicalization.
  • Security tests or fuzzing that feed crafted archives with nested directories, ../ segments, and absolute paths to confirm that extraction is constrained.
  • Policy enforcement in CI/CD pipelines that scans for custom archive-handling implementations and requires adherence to approved helper utilities or frameworks that implement safe extraction by default.

Sources

SourceLink
github.comgithub.com/apple/containerization/security/advisories/GHSA-cq3j-qj2h-6rv3

Frequently asked

questions

It can be, depending on how archives or container images are sourced. If an attacker can deliver a crafted image or archive to an automated loading process, they may trigger the vulnerability without interactive local access.

The attacker must be able to supply or modify the archive or container image being processed. This could be via a compromised registry, a malicious image distribution channel, or any workflow where untrusted archives are imported.

The most robust fix is to normalize and validate every archive member path before extraction, ensuring it cannot escape a designated extraction root and rejecting any entries containing traversal or absolute path components.

Treat archive metadata as untrusted, adopt well-vetted archive extraction helpers that enforce directory confinement by default, add static analysis and code review checks around file-system operations, and run archive-processing services with minimal filesystem privileges.

Find out what's already
exploitable in your codebase.