CVE-2021-32751
published high CVSS 3.1 · 7.5Arbitrary code execution via specially crafted environment variables
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| gradle | — | gradle< 7.2 | Affected | Not stated | GitHub_M |
| Alpine Linux | edge | gradle | Fixed | 7.2-r0 | Package fix record |
| SUSE / openSUSE | SLE-15-SP3 | gradlex86_64 | Advisory build | 4.4.1-150200.3.10.1 | SUSE-SU-2023:2203-1 |
| Alpine Linux | v3.15 | gradle | Fixed | 7.2-r0 | Package fix record |
| Alpine Linux | v3.16 | gradle | Fixed | 7.2-r0 | Package fix record |
| Alpine Linux | v3.17 | gradle | Fixed | 7.2-r0 | Package fix record |
| Alpine Linux | v3.18 | gradle | Fixed | 7.2-r0 | Package fix record |
| Alpine Linux | v3.19 | gradle | Fixed | 7.2-r0 | Package fix record |
Show 13 more entries
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Alpine Linux | v3.20 | gradle | Fixed | 7.2-r0 | Package fix record |
| Alpine Linux | v3.21 | gradle | Fixed | 7.2-r0 | Package fix record |
| Alpine Linux | v3.22 | gradle | Fixed | 7.2-r0 | Package fix record |
| Alpine Linux | v3.23 | gradle | Fixed | 7.2-r0 | Package fix record |
| Alpine Linux | v3.24 | gradle | Fixed | 7.2-r0 | Package fix record |
| SUSE / openSUSE | SLE-15-SP4 | gradleaarch64 | Advisory build | 4.4.1-150200.3.10.1 | SUSE-SU-2023:2203-1 |
| SUSE / openSUSE | SLE-15-SP4 | gradleppc64le | Advisory build | 4.4.1-150200.3.10.1 | SUSE-SU-2023:2203-1 |
| SUSE / openSUSE | SLE-15-SP4 | gradles390x | Advisory build | 4.4.1-150200.3.10.1 | SUSE-SU-2023:2203-1 |
| SUSE / openSUSE | SLE-15-SP4 | gradlex86_64 | Advisory build | 4.4.1-150200.3.10.1 | SUSE-SU-2023:2203-1 |
| SUSE / openSUSE | openSUSE-Leap-15.4 | gradleaarch64 | Advisory build | 4.4.1-150200.3.10.1 | SUSE-SU-2023:2203-1 |
| SUSE / openSUSE | openSUSE-Leap-15.4 | gradleppc64le | Advisory build | 4.4.1-150200.3.10.1 | SUSE-SU-2023:2203-1 |
| SUSE / openSUSE | openSUSE-Leap-15.4 | gradles390x | Advisory build | 4.4.1-150200.3.10.1 | SUSE-SU-2023:2203-1 |
| SUSE / openSUSE | openSUSE-Leap-15.4 | gradlex86_64 | Advisory build | 4.4.1-150200.3.10.1 | SUSE-SU-2023:2203-1 |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.5 / 10
- Severity
- high
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| gradle | gradle | < 7.2 (affected) | GitHub_M · cna |
Weaknesses
1- CWE-78 CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
References
3Provider assertions
3GitHub_M · cna
Arbitrary code execution via specially crafted environment variables
CISA-ADP · adp
CISA ADP Vulnrichment
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 90b1098beb5a1f6d027c3e8c81ac6ca435ebb226dfe7da6cc5c0a93e19f84b18
- Ingested
- 09 Oct 2026, 16:22:05 UTC
- Source record
- Official CVE record