Skip to content
Heist/ feed
Back to feed
High

gradle — security advisory

Type: advisorySources: OSVAdvisory ID: DEBIAN-CVE-2021-32751

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

Products
gradle
Affected versions
4.4.1-18, 4.4.1-19, 4.4.1-20, 4.4.1-21, 4.4.1-22, 4.4.1-23, 4.5.1-1, 4.6-1, 4.6-2, 4.6-3
Fixed versions
Not specified
CVEs
CVE-2021-32751
Confirmed fixed CVEs
Not specified
Updated in this feed
28 Oct 2026, 11:09 UTC · Revision 1

Source evidence

DEBIAN-CVE-2021-32751

core-osv · Original source

Published 20 Jul 2021, 23:15 UTC

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

osv:DEBIAN-CVE-2021-32751

gradle

Fixed versions: Not specified

gradle

Fixed versions: Not specified

gradle

Fixed versions: Not specified

Complete source record
{
  "id": "8b008cbc33cb9c1df690839d8cb2b6be21707f5370003b8bc848fe0b7f6927ec",
  "url": "https://osv.dev/vulnerability/DEBIAN-CVE-2021-32751",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "DEBIAN-CVE-2021-32751",
    "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 ",
    "evidence": "osv:DEBIAN-CVE-2021-32751",
    "products": [
      {
        "name": {
          "value": "gradle",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "4.4.1-18",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "4.4.1-19",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "4.4.1-20",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "4.4.1-21",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "4.4.1-22",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "4.4.1-23",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "4.5.1-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "4.6-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "4.6-2",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "4.6-3",
            "evidence": "/affected/0/versions"
          }
        ]
      },
      {
        "name": {
          "value": "gradle",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "4.4.1-22",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "4.4.1-23",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "4.5.1-1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "4.6-1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "4.6-2",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "4.6-3",
            "evidence": "/affected/1/versions"
          }
        ]
      },
      {
        "name": {
          "value": "gradle",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "4.4.1-22",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "4.4.1-23",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "4.5.1-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "4.6-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "4.6-2",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "4.6-3",
            "evidence": "/affected/2/versions"
          }
        ]
      }
    ],
    "severity": "high",
    "structured": {
      "id": "DEBIAN-CVE-2021-32751",
      "aliases": [
        "DEBIAN-CVE-2021-32751"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "gradle",
            "purl": "pkg:deb/debian/gradle?arch=source&distro=bookworm",
            "ecosystem": "Debian:12"
          },
          "versions": [
            "4.4.1-18",
            "4.4.1-19",
            "4.4.1-20",
            "4.4.1-21",
            "4.4.1-22",
            "4.4.1-23",
            "4.5.1-1",
            "4.6-1",
            "4.6-2",
            "4.6-3"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2021-32751.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "gradle",
            "purl": "pkg:deb/debian/gradle?arch=source&distro=trixie",
            "ecosystem": "Debian:13"
          },
          "versions": [
            "4.4.1-22",
            "4.4.1-23",
            "4.5.1-1",
            "4.6-1",
            "4.6-2",
            "4.6-3"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2021-32751.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "gradle",
            "purl": "pkg:deb/debian/gradle?arch=source&distro=forky",
            "ecosystem": "Debian:14"
          },
          "versions": [
            "4.4.1-22",
            "4.4.1-23",
            "4.5.1-1",
            "4.6-1",
            "4.6-2",
            "4.6-3"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2021-32751.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        }
      ],
      "modified": "2026-10-09T10:00:56.987270204Z",
      "provider": "osv",
      "upstream": [
        "CVE-2021-32751"
      ],
      "references": [
        "https://security-tracker.debian.org/tracker/CVE-2021-32751"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2021-32751",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 111738,
  "published_at": "2021-07-20T23:15:37.743+00:00"
}