Read the docs
TI-2021-12419 Aliases CVE-2021-32751

Arbitrary code execution via specially crafted environment variables

Priority MEDIUM 46CWE-78Published · Updated

Key facts

Attack vector
Network
Privileges required
Low
User interaction
None
Attack complexity
High
Impact type
Code execution
Confidentiality · integrity · availability
High · High · High
Fix status
Partial Red Hat: 2 without a fix

Attack profile from CVSS 3.1 · CNA. Fix status from CNA and Red Hat. Impact type from CWE-78.

Summary

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.

Why it matters now

Exploitation None reported CISA SSVC · not in CISA KEV
EPSS 0.02709 86th percentileScored 2026-11-07
Public exploit Yes 3 exploit referencesTagged by NVD
Fix Partial gradle (gradle): 7.2Red Hat: 2 without a fix

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
None
Automatable
Yes
Technical impact
Total

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
gradlegradlebefore 7.27.2Patch availableCNA
  • gradle Vendorgradle Affected before 7.2 Fixed in 7.2 Patch available CNA

CPE configurations NVD · 1

CPEVersionsRoleVendor
cpe:2.3:a:gradle:gradle:*:*:*:*:*:*:*:*before 7.2Vulnerablegradle
  • cpe:2.3:a:gradle:gradle:*:*:*:*:*:*:*:* Versions before 7.2 Vulnerable ·gradle

Remediation

  • Fix · CNA gradle (gradle) Fixed in 7.2

Vendor assessments

Red Hat

Red Hat rating: Moderate. Red Hat's page for this CVE →

ProductStatusPlan or fix
Red Hat JBoss Enterprise Application Platform 6AffectedNo fix planned: Out of support scope
Red Hat Software CollectionsAffectedNo fix planned: Will not fix
Not affected: 2 products
  • Red Hat JBoss Enterprise Application Platform 7
  • Red Hat JBoss Enterprise Application Platform Expansion Pack

Timeline

  1. 2026-10-02 Threatist record created from CVE-2021-32751
  2. 2026-10-08 CISA SSVC decision points changed
  3. 2026-10-09 Priority changed: LOW → MEDIUM

References

  • TI-2016-05320 ObjectSocketWrapper.java in Gradle 2.12 allows remote attackers to execute arbitrary code… CVSS 3.0CRITICAL 9.8
  • TI-2020-09639 Injection in Apache Ant CVSS 3.1HIGH 7.5
  • TI-2019-11237 The HTTP client in Gradle before 5.6 sends authentication credentials originally destined… CVSS 3.1CRITICAL 9.8
  • TI-2023-11286 Gradle usage of long IDs for PGP keys opens potential for collision attacks CVSS 3.1CRITICAL 9.8
  • TI-2021-10141 Local privilege escalation through system temporary directory CVSS 3.1HIGH 8.8
  • TI-2022-07682 Dependency verification bypass in Gradle CVSS 3.1HIGH 7.5
See all 22 →

Sources