CVE-2021-32751

Description

A flaw was found in Gradle, which allows a remote, authenticated attacker to execute arbitrary code on the system caused by a flaw in start and gradlew. By sending specially crafted environment variables, an attacker can execute arbitrary code on the system.

Statement

To exploit this vulnerability, 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 requirement makes this CVE of a Moderate impact.

Mitigation

CI/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 Gradle.

Applications using start scripts generated by Gradle
- You are not vulnerable if untrusted users are unable to change environment variables for the user that executes the start script.
- If you are unsure, the 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, you may be able to avoid the use of the start scripts by running the application directly with the Java command.

Common Vulnerability Scoring System (CVSS) Score Details

Info alert:Important note

CVSS scores for open source components depend on vendor-specific factors (e.g. version or build chain). Therefore, Red Hat's score and impact rating can be different from NVD and other vendors. Red Hat remains the authoritative CVE Naming Authority (CNA) source for its products and services (see Red Hat classifications).

The following CVSS metrics and score provided are preliminary and subject to review.

CVSS v3 Score Breakdown

Red HatNVDcve.org
Base Score7.5N/AN/A
Attack VectorNetworkN/AN/A
Attack ComplexityHighN/AN/A
Privileges RequiredLowN/AN/A
User InteractionNoneN/AN/A
ScopeUnchangedN/AN/A
ConfidentialityHighN/AN/A
Integrity ImpactHighN/AN/A
Availability ImpactHighN/AN/A

Vector

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

Understanding the Weakness (CWE)

Confidentiality,Integrity,Availability,Non-Repudiation

Technical Impact: Execute Unauthorized Code or Commands; DoS: Crash, Exit, or Restart; Read Files or Directories; Modify Files or Directories; Read Application Data; Modify Application Data; Hide Activities

Attackers could execute unauthorized operating system commands, which could then be used to disable the product, or read and modify data for which the attacker does not have permissions to access directly. Since the targeted application is directly executing the commands instead of the attacker, any malicious activities may appear to come from the application or the application's owner.

Frequently Asked Questions

Want to get errata notifications? Sign up here.