CVE-2026-75598
Gradle Shadow: Zip Slip path traversal in ShadowCopyAction — no independent entry-name sanitization
Description
Summary
ShadowCopyAction in the Shadow plugin does not validate or sanitize ZIP entry names before writing them to the output fat JAR. A malicious upstream dependency containing path traversal sequences (e.g. ../../../../tmp/pwned.txt) in entry names will have those entries reproduced verbatim in the output shadow JAR.
Details
The vulnerability exists because Shadow relies entirely on Gradle's ZipFileTree for entry sanitization rather than implementing its own path validation. This means:
- Users on Gradle < 7.6.2 / 8.x < 8.2.0 are directly exploitable
- The produced shadow JAR becomes a Zip Slip weapon against any downstream consumer using unprotected extraction (raw ZipInputStream, older CI tooling, custom Java unpackers)
- If Shadow ever uses a non-ZipFileTree code path, protection disappears silently
Affected file: src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/internal/ShadowCopyAction.kt
PoC
- Create a malicious JAR with path traversal entry:
import zipfile
with zipfile.ZipFile('evil.jar', 'w') as zf:
zf.writestr('../../../../tmp/zipslip_proof.txt', 'pwned')
- Add as dependency in a shadow project
- Run
gradle shadowJar - Run
unzip -l build/libs/*.jar | grep "\.\." - Traversal entry survives in output JAR
Impact
Any tool extracting the shadow JAR with unprotected extraction is subject to arbitrary file overwrite. Users on older Gradle versions are directly vulnerable at build time.
Affected Maven artifacts (1)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| com.gradleup.shadow » com.gradleup.shadow.gradle.plugin | < 9.6.0 | 9.6.0 |
Blast radius
35% of the dependent artifacts (50) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 474 |
| 2 hops | 4,456 |
| 3 hops | 5 |
Most used dependents
- io.github.mymx2 » dy-gradle-plugin72 usages
- org.openrewrite » rewrite-build-gradle-plugin18 usages
- dev.deftu.gradle » gradle-toolkit13 usages
- dev.suresh.build » project11 usages
- dev.isxander.modstitch » modstitch8 usages
- dev.rnett.kcp-development » compiler-plugin-plugins6 usages
- com.gtnewhorizons » gtnhgradle3 usages
- su.plo.voice.plugin » pv-gradle-plugin3 usages
- me.philippheuer.projectcfg » projectcfg-gradle-plugin2 usages
- com.brightsparklabs » gradle-baseline2 usages
- io.specmatic.gradle » plugin1 usages
- com.falsepattern » fpgradle-plugin1 usages
- me.philippheuer.projectcfg » projectcfg-spring-gradle-plugin1 usages
- com.enhancedprojects » EnhancedSpigot-Gradle1 usages
- dev.projectenhanced » EnhancedSpigot-Gradle1 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/GradleUp/shadow/security/advisories/GHSA-rr8v-fxxf-c986
- Advisoryhttps://nvd.nist.gov/vuln/detail/CVE-2026-75598
- Webhttps://github.com/GradleUp/shadow/commit/0c2744fcc050e34a084f5131d5e167b13c342bfd
- Packagehttps://github.com/GradleUp/shadow
- Webhttps://github.com/GradleUp/shadow/releases/tag/9.6.0
