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.
The vulnerability exists because Shadow relies entirely on Gradle's ZipFileTree for entry sanitization rather than implementing its own path validation. This means:
Affected file: src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/internal/ShadowCopyAction.kt
import zipfile
with zipfile.ZipFile('evil.jar', 'w') as zf:
zf.writestr('../../../../tmp/zipslip_proof.txt', 'pwned')
gradle shadowJarunzip -l build/libs/*.jar | grep "\.\."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.
{
"cwe_ids": [
"CWE-22"
],
"github_reviewed": true,
"github_reviewed_at": "2026-11-09T21:48:13Z",
"nvd_published_at": "2026-11-06T18:18:18Z",
"severity": "HIGH"
}