High

Gradle Shadow: Zip Slip path traversal in ShadowCopyAction — no independent entry-name sanitization

  • Disclosed: 09.11.2026
  • Updated: 11.11.2026 10:00

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:

  1. Users on Gradle < 7.6.2 / 8.x < 8.2.0 are directly exploitable
  2. The produced shadow JAR becomes a Zip Slip weapon against any downstream consumer using unprotected extraction (raw ZipInputStream, older CI tooling, custom Java unpackers)
  3. 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

  1. Create a malicious JAR with path traversal entry:
python
import zipfile
with zipfile.ZipFile('evil.jar', 'w') as zf:
    zf.writestr('../../../../tmp/zipslip_proof.txt', 'pwned')
  1. Add as dependency in a shadow project
  2. Run gradle shadowJar
  3. Run unzip -l build/libs/*.jar | grep "\.\."
  4. 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.

What to do

Update com.gradleup.shadow:com.gradleup.shadow.gradle.plugin to version 9.6.0 or later.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Java / Kotlin (Maven) com.gradleup.shadow:com.gradleup.shadow.gradle.plugin < 9.6.0 9.6.0

References

CVSS score 8.1/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H
Weakness (CWE)
CWE-22
Platform
Java / Kotlin (Maven)
Package
com.gradleup.shadow:com.gradleup.shadow.gradle.plugin
Disclosed
09.11.2026
Updated
11.11.2026 10:00

Sources and licenses · Edited or translated by DockRay; source rights and applicable licenses are retained.

OSV / GitHub Advisory Database - GHSA-rr8v-fxxf-c986 - CC BY 4.0

Vulnerability history: com.gradleup.shadow:com.gradleup.shadow.gradle.plugin

All published vulnerabilities of this package (Java / Kotlin (Maven)), newest first. Shows whether this is a one-off slip or a package that needs watching.

This is the only known vulnerability of this package.

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.