p PatchFirst

CVE-2021-32751

CVE-2021-32751 · Arbitrary code execution via specially crafted environment variables

CVSS 7.5 · High · EPSS 2.7% · Fix available

Compare with your installed version

Affected products and known fixed versions are public information. Compare them with your installed version.

  • gradleNo fix published
  • gradle Alpine 3.15Update to 7.2-r0
  • gradle Alpine 3.16Update to 7.2-r0
  • gradle Alpine 3.17Update to 7.2-r0
  • and 18 more

Check the installed version:

apk list -I -o gradle

Assess your server’s risks

The free check gives you a rating and a risk summary by technology stack, without signing up. It does not answer whether this particular vulnerability affects you.

Monitoring matches public information against your servers’ software. Detailed findings for your servers include the order of updates.

curl -fsSL https://patchfirst.dev/check.sh | sh
Check your server for free →

Channels carry general technology news; monitoring reports new findings on your servers in your dashboard, through browser notifications, in Telegram or via a webhook.

This page contains facts from public vulnerability sources. Check the original advisory before updating.

Gradle is a build tool with a focus on build automation. In versions prior to 7.2, start scripts generated by the `application` plugin and the `gradlew` script are both vulnerable to arbitrary code execution when an attacker is able to change environment variables for the user running the script. This may impact those who use `gradlew` on Unix-like systems or use the scripts generated by Gradle in thieir application on Unix-like systems. For this vulnerability to be exploitable, an attacker needs to be able to set the value of particular environment variables and have those environment variables be seen by the vulnerable scripts. This issue has been patched in Gradle 7.2 by removing the use of `eval` and requiring the use of the `bash` shell. There are a few workarounds available. For CI/CD systems using the Gradle build tool, one may ensure that untrusted users are unable to change environment variables for the user that executes `gradlew`. If one is unable to upgrade to Gradle 7.2, one may generate a new `gradlew` script with Gradle 7.2 and use it for older versions of Gradle. Fpplications using start scripts generated by Gradle, one may ensure that untrusted users are unable to change environment variables for the user that executes the start script. A vulnerable start script could be manually patched to remove the use of `eval` or the use of environment variables that affect the application's command-line. If the application is simple enough, one may be able to avoid the use of the start scripts by running the application directly with Java command.

Published
Updated

Fixes in distributions

  • SUSE-SU-2023:2203-1 · openSUSE Leap 15.4, SUSE Linux Enterprise Module for Development Tools 15 SP4, SUSE Linux Enterprise Real Time 15 SP3 ·

Stack: system

Affected products and versions

  • gradle

    Versions
    • < 7.2: Affected

    No fix published

  • gradle Alpine 3.15

    Affected ranges
    • ECOSYSTEM: < 7.2-r0

    Update to 7.2-r0

  • gradle Alpine 3.16

    Affected ranges
    • ECOSYSTEM: < 7.2-r0

    Update to 7.2-r0

  • gradle Alpine 3.17

    Affected ranges
    • ECOSYSTEM: < 7.2-r0

    Update to 7.2-r0

  • gradle Alpine 3.18

    Affected ranges
    • ECOSYSTEM: < 7.2-r0

    Update to 7.2-r0

  • gradle Alpine 3.19

    Affected ranges
    • ECOSYSTEM: < 7.2-r0

    Update to 7.2-r0

  • gradle Alpine 3.20

    Affected ranges
    • ECOSYSTEM: < 7.2-r0

    Update to 7.2-r0

  • gradle Alpine 3.21

    Affected ranges
    • ECOSYSTEM: < 7.2-r0

    Update to 7.2-r0

  • gradle Alpine 3.22

    Affected ranges
    • ECOSYSTEM: < 7.2-r0

    Update to 7.2-r0

  • gradle Alpine 3.23

    Affected ranges
    • ECOSYSTEM: < 7.2-r0

    Update to 7.2-r0

  • gradle Alpine 3.24

    Affected ranges
    • ECOSYSTEM: < 7.2-r0

    Update to 7.2-r0

  • gradle Debian 12

    Versions
    • 4.4.1-18
    • 4.4.1-19
    • 4.4.1-20
    • 4.4.1-21
    • 4.4.1-22
    • 4.4.1-23
    All versions (10)
    • 4.5.1-1
    • 4.6-1
    • 4.6-2
    • 4.6-3
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • gradle Debian 13

    Versions
    • 4.4.1-22
    • 4.4.1-23
    • 4.5.1-1
    • 4.6-1
    • 4.6-2
    • 4.6-3
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • gradle Debian 14

    Versions
    • 4.4.1-22
    • 4.4.1-23
    • 4.5.1-1
    • 4.6-1
    • 4.6-2
    • 4.6-3
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • gradle Ubuntu 16.04 LTS

    Versions
    • 2.5-3
    • 2.7-1
    • 2.7-2
    • 2.7-3
    • 2.10-1
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • gradle Ubuntu Pro 18.04 LTS

    Versions
    • 3.2.1-3build2
    • 3.2.1-4
    • 3.2.1-5
    • 3.4.1-4
    • 3.4.1-6
    • 3.4.1-7ubuntu1
    All versions (8)
    • 4.4.1-5ubuntu2~18.04
    • 4.4.1-5ubuntu2~18.04+esm1
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • gradle Ubuntu 20.04 LTS

    Versions
    • 4.4.1-8
    • 4.4.1-9
    • 4.4.1-10
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • gradle Ubuntu 22.04 LTS

    Versions
    • 4.4.1-13
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • gradle Ubuntu 24.04 LTS

    Versions
    • 4.4.1-18
    • 4.4.1-20
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • gradle Ubuntu 25.10

    Versions
    • 4.4.1-22
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • gradle Ubuntu 26.10

    Versions
    • 4.4.1-22ubuntu1
    • 4.4.1-23
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • gradle Ubuntu 26.04 LTS

    Versions
    • 4.4.1-22
    • 4.4.1-22build1
    • 4.4.1-22ubuntu1
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

Original sources

Check your server →