CVE-2021-32751
No exploitation reported by the sources we read.
- Published2021-07-20
- Fixed in7.2
- WeaknessCWE-78
Am I affected?
Debian, Ubuntu or Red Hat sometimes backport a fix without changing the upstream version number: such a version reads « to verify », never « affected ».With a domain, we read the version its public headers and pages expose. A distribution build can carry the fix under an older number.
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.
Timeline
dates in UTC- 2021-07-2023:15CVE publishedNVD
Versions per branch
NVD · OSV| Branch | Affected | Fixed in | Source |
|---|---|---|---|
| 7.2 | < 7.2 | 7.2 | NVD |
| Branch | Affected | Fixed in | Source |
|---|---|---|---|
| 7.2 | < 7.2.0 | 7.2.0 | OSV |
as publishedRanges as NVD and OSV publish them; a distribution’s build can be fixed under an older number.
Distribution builds and vendor advisories
Packages from OSV.dev and products from the vendors' CSAF advisories.
version not verifiedVersions not verified: read as OSV.dev and the vendors publish them, not checked against each vendor's release list.
Packages
- eco-java-gradleChainguardall versions · no fixed version listedand 188 other packages
- gradleUbuntu:Pro:18.04:LTSall versions · no fixed version listed
- gradleUbuntu:26.10all versions · no fixed version listed
- gradleUbuntu:26.04:LTSall versions · no fixed version listed
- gradleUbuntu:25.10all versions · no fixed version listed
- gradleUbuntu:24.04:LTSall versions · no fixed version listed
- gradleUbuntu:22.04:LTSall versions · no fixed version listed
- gradleUbuntu:20.04:LTSall versions · no fixed version listed
18 more package ranges on OSV.dev
Vendor advisories
gradle: Arbitrary code execution via specially crafted environment variables
gradle as a component of Red Hat JBoss Enterprise Application Platform 6 · rh-maven36-byte-buddy-agent as a component of Red Hat Software Collections · rh-maven36-byte-buddy-javadoc as a component of Red Hat Software Collections · +3 more
Fix
- Update Gradle to 7.2
- Workaround from the vendor Red Hat Product Security CVE-2021-32751 · 6 productsCI/CD systems using the Gradle build tool - You are not vulnerable if untrusted users are unable to change environment variables for the user that executes gradlew. - If you are unable to upgrade to Gradle 7.2, you can generate a new gradlew script with Gradle 7.2 and use it for older versions of G…
- No fix planned, says the vendor Red Hat Product Security CVE-2021-32751 · 1 productOut of support scope
- No fix planned, says the vendor Red Hat Product Security CVE-2021-32751 · 5 productsWill not fix
Detection
- Nuclei template
- none so far ProjectDiscovery
- Exploit-DB
- no entry Exploit-DB
- Proof of concept
- PoC-in-GitHubno public repository identifiedread 2026-11-08
- Metasploit modules
- none listed Metasploit Framework
Sources
- CISA-ADPSSVC decisionnone2026-10-08
- CNACVSS 3.17.5known since 2026-10-23
- NVDCVSS 3.17.5read 2026-10-23
- NVDCVSS 2.08.5read 2026-10-23
- CNAweakness (CWE)CWE-78known since 2026-10-23
- NVDweakness (CWE)CWE-78read 2026-10-23
- FIRST EPSSEPSS score2.7 %2026-11-08
- OSVaffected packages—
- GitHub Advisoriesadvisory—
Identifiers
- BIT-gradle-2021-32751same flawBitnami · Apache-2.0
- CGA-236p-jf96-g59msame flawChainguard · CC-BY-NC-ND-4.0
- CGA-249v-2mgg-q2qhsame flawChainguard · CC-BY-NC-ND-4.0
- CGA-24f7-jhr4-j489same flawChainguard · CC-BY-NC-ND-4.0
- CGA-24p4-pxxx-m63xsame flawChainguard · CC-BY-NC-ND-4.0
- CGA-2577-hg2m-g964same flawChainguard · CC-BY-NC-ND-4.0
- CGA-267w-xvvj-rpgqsame flawChainguard · CC-BY-NC-ND-4.0
- CGA-26g7-pv3c-vf96same flawChainguard · CC-BY-NC-ND-4.0
- CGA-27pg-7h8c-c3xpsame flawChainguard · CC-BY-NC-ND-4.0
- CGA-2929-ppff-3m24same flawChainguard · CC-BY-NC-ND-4.0
- CGA-2975-cm25-h3gvsame flawChainguard · CC-BY-NC-ND-4.0
- CGA-2f3m-prq8-25pgsame flawChainguard · CC-BY-NC-ND-4.0
- CGA-2f89-ww87-958vsame flawChainguard · CC-BY-NC-ND-4.0
- CGA-2fjj-jh9m-cw65same flawChainguard · CC-BY-NC-ND-4.0
- CGA-2frf-9x9g-jxr7same flawChainguard · CC-BY-NC-ND-4.0
- CGA-2g27-6432-gf6fsame flawChainguard · CC-BY-NC-ND-4.0
- CGA-2h47-h8gm-f6qxsame flawChainguard · CC-BY-NC-ND-4.0
- CGA-2h9w-5cjq-cgqxsame flawChainguard · CC-BY-NC-ND-4.0
- CGA-2j83-7xqp-7fmcsame flawChainguard · CC-BY-NC-ND-4.0
- CGA-2j88-p72g-qx7psame flawChainguard · CC-BY-NC-ND-4.0
- CGA-2jx7-gh5g-772gsame flawChainguard · CC-BY-NC-ND-4.0
- CGA-2pfp-3x65-hcwfsame flawChainguard · CC-BY-NC-ND-4.0
- CGA-2phr-fmg3-2pp8same flawChainguard · CC-BY-NC-ND-4.0
- CGA-2vwj-pcw5-vjr8same flawChainguard · CC-BY-NC-ND-4.0
- CGA-3223-h3r9-gj7rsame flawChainguard · CC-BY-NC-ND-4.0
- CGA-32cr-96qm-pvqhsame flawChainguard · CC-BY-NC-ND-4.0
- CGA-34vg-w73h-x4gqsame flawChainguard · CC-BY-NC-ND-4.0
- CGA-34xh-hpgf-g9wrsame flawChainguard · CC-BY-NC-ND-4.0
- CGA-3654-h2mh-7p4fsame flawChainguard · CC-BY-NC-ND-4.0
- CGA-37pp-vjh4-8748same flawChainguard · CC-BY-NC-ND-4.0
- CGA-37rw-mq43-wmfhsame flawChainguard · CC-BY-NC-ND-4.0
- CGA-382c-8gvf-5p5gsame flawChainguard · CC-BY-NC-ND-4.0
- CGA-39jj-g5m2-5ghvsame flawChainguard · CC-BY-NC-ND-4.0
- CGA-3g7j-7266-3jr6same flawChainguard · CC-BY-NC-ND-4.0
- CGA-3grm-rp5x-47c4same flawChainguard · CC-BY-NC-ND-4.0
- CGA-3h5w-65gc-98m4same flawChainguard · CC-BY-NC-ND-4.0
- CGA-3hf2-7wgc-r962same flawChainguard · CC-BY-NC-ND-4.0
- CGA-3jvq-gxgv-gqjcsame flawChainguard · CC-BY-NC-ND-4.0
- CGA-3mfp-4gcw-ghf7same flawChainguard · CC-BY-NC-ND-4.0
- CGA-3px9-g7qp-3g7hsame flawChainguard · CC-BY-NC-ND-4.0
- CGA-3qx2-mq78-whp3same flawChainguard · CC-BY-NC-ND-4.0
- CGA-3r2m-9r8g-wp75same flawChainguard · CC-BY-NC-ND-4.0
- CGA-3wcw-hwrp-43m7same flawChainguard · CC-BY-NC-ND-4.0
- CGA-3x6h-257q-c3m6same flawChainguard · CC-BY-NC-ND-4.0
- CGA-3x7c-w327-h392same flawChainguard · CC-BY-NC-ND-4.0
- CGA-3xf2-cw3p-g2c5same flawChainguard · CC-BY-NC-ND-4.0
- CGA-3xmf-px42-x39psame flawChainguard · CC-BY-NC-ND-4.0
- CGA-4259-4h2c-7rwxsame flawChainguard · CC-BY-NC-ND-4.0
- CGA-42fx-8pwh-3gr8same flawChainguard · CC-BY-NC-ND-4.0
- CGA-42mm-rwx2-3qjvsame flawChainguard · CC-BY-NC-ND-4.0
Technical details
- CVSS v3 Vector
- CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
- Published
- 2021-07-20
- Last Modified
- 2026-10-08
- NVD status
- Modified
- GitHub Advisory
- GHSA-6j2p-252f-7mw8
Frequently asked questions
What is CVE-2021-32751?
Is CVE-2021-32751 actively exploited?
What is the CVSS score for CVE-2021-32751?
Running gradle? Hear about its next vulnerability
Surveillance reads the versions in your stack — a domain, a lockfile or a list — checks each CVE against the ranges its sources publish, and alerts you when one you run is exploited or enters CISA KEV. A version it cannot read stays « version not verified ».
No credit card required · No monthly cap on website lookups · 250 API requests/month
Go further
- Following what attackers exploit right now? The CISA KEV additions of the month, with their patch deadlines.
- Running this software? Vulnerability monitoring alerts you to new vulnerabilities in your products.
Related vulnerabilities
Same product first, then the same vendor advisory and the same publication week.
Sources for this record
- CVE Program · CVE Program Terms of Use
- FIRST EPSS · EPSS terms of use (free use, attribution requested)
- GitHub Advisory Database · CC-BY-4.0 · GHSA-6j2p-252f-7mw8
- NVD · Public domain (17 U.S.C. § 105) for NVD-authored data; third-party content under its own terms
- OSV.dev · Per record, as its publisher states it: each row carries the label in sourceLicense when one is served
- Red Hat Product Security (CSAF and VEX) · CC-BY-4.0
- CISA Vulnrichment · CC0-1.0