CVE-2021-32751

HighCVSS 7.5/10Last modified Oct 8, 2026

Description

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.

Metrics

CVSS 3.1 7.5/10CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H

Weakness enumeration

Affected software

VendorProductVersions
gradlegradle< 7.2

References

Timeline

Published
Jul 20, 2021
Last modified
Oct 8, 2026
NVD status
Modified

Related CVEs from 2021

CVE-2021-327524.9Ether Logs is a package that allows one to check one's logs in the Craft 3 utilities section. A vulnerability was found in versions prior toCVE-2021-327536.5EdgeX Foundry is an open source project for building a common open framework for internet-of-things edge computing. A vulnerability exists iCVE-2021-327545.3FlowDroid is a data flow analysis tool. FlowDroid versions prior to 2.9.0 contained an XML external entity (XXE) vulnerability that allowed CVE-2021-327554.3Wire is a collaboration platform. wire-ios-transport handles authentication of requests, network failures, and retries for the iOS implementCVE-2021-327568.8ManageIQ is an open-source management platform. In versions prior to jansa-4, kasparov-2, and lasker-1, there is a flaw in the MiqExpressionCVE-2021-327587.2OpenMage Magento LTS is an alternative to the Magento CE official releases. Prior to versions 19.4.15 and 20.0.11, layout XML enabled admin CVE-2021-327597.2OpenMage magento-lts is an alternative to the Magento CE official releases. Due to missing sanitation in data flow in versions prior to 19.4CVE-2021-327606.3containerd is a container runtime. A bug was found in containerd versions prior to 1.4.8 and 1.5.4 where pulling and extracting a specially-CVE-2021-327617.5Redis is an in-memory database that persists on disk. A vulnerability involving out-of-bounds read and integer overflow to buffer overflow eCVE-2021-327628.8Redis is an open source, in-memory database that persists on disk. The redis-cli command line tool and redis-sentinel service may be vulneraCVE-2021-327636.5OpenProject is open-source, web-based project management software. In versions prior to 11.3.3, the `MessagesController` class of OpenProjecCVE-2021-327645.4Discourse is an open-source discussion platform. In Discourse versions 2.7.5 and prior, parsing and rendering of YouTube Oneboxes can be sus
CVE-2021-32751: High severity, CVSS 7.5 | Vulnix