{"answers":{"affected":"1 open source package ship an affected version, including gradle. It affects 1 product.","exploited":"There is no known exploitation of CVE-2021-32751 in the wild and no public exploit code.","fix":"Upgrade gradle to 7.2.0 or later.","what":"CVE-2021-32751 is a high-severity command injection vulnerability in gradle, published on 20 Jul 2021. Any signed-in user can exploit it over the network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2021-32751 and fix it if it is affected.\n\nWhat it is: CVE-2021-32751 is a high-severity command injection vulnerability in gradle, published on 20 Jul 2021. Any signed-in user can exploit it over the network, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2021-32751 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- gradle (Bitnami): affected all versions; fixed in 7.2.0\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2021-32751/ (Markdown: https://insights.sbomify.com/CVE-2021-32751/index.md)","id":"CVE-2021-32751","markdown":"https://insights.sbomify.com/CVE-2021-32751/index.md","name":"CVE-2021-32751","record":{"aliases":["BIT-gradle-2021-32751","CLEANSTART-2026-BD83881","CLEANSTART-2026-KX40162","DEBIAN-CVE-2021-32751","GHSA-6j2p-252f-7mw8","SUSE-SU-2023:2203-1","UBUNTU-CVE-2021-32751"],"analysis":{"component_type":"developer_tool","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":false,"product_category":"Gradle build tool","requires_auth":"low_privilege","summary":"Attackers can execute arbitrary code by manipulating environment variables in Gradle start scripts, affecting developers using Unix-like systems.","user_interaction":"not_required","vuln_class":"command_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"gradle","vendor":"gradle"}],"cvss":{"score":7.5,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-78","name":"Improper Neutralization of Special Elements used in an OS Command"}],"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.","ecosystems":["Bitnami","SUSE:Linux Enterprise Module for Development Tools 15 SP4","SUSE:Linux Enterprise Real Time 15 SP3","openSUSE:Leap 15.4"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Arbitrary code execution via specially crafted environment variables","id":"CVE-2021-32751","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Bitnami","product":null,"products":[],"type":"command_injection","year":"2021"},"n_packages":4,"n_references":3,"next":{"headline":"Files or Directories Accessible to External Parties in ether/logs","id":"CVE-2021-32752"},"packages":[{"ecosystem":"Bitnami","fixed":["7.2.0"],"introduced":["0"],"last_affected":[],"package":"gradle","purl":"pkg:bitnami/gradle","source":"BIT-gradle-2021-32751"},{"ecosystem":"SUSE:Linux Enterprise Module for Development Tools 15 SP4","fixed":["4.4.1-150200.3.10.1"],"introduced":["0"],"last_affected":[],"package":"gradle","purl":"pkg:rpm/suse/gradle\u0026distro=SUSE%20Linux%20Enterprise%20Module%20for%20Development%20Tools%2015%20SP4","source":"SUSE-SU-2023:2203-1"},{"ecosystem":"SUSE:Linux Enterprise Real Time 15 SP3","fixed":["4.4.1-150200.3.10.1"],"introduced":["0"],"last_affected":[],"package":"gradle","purl":"pkg:rpm/suse/gradle\u0026distro=SUSE%20Linux%20Enterprise%20Real%20Time%2015%20SP3","source":"SUSE-SU-2023:2203-1"},{"ecosystem":"openSUSE:Leap 15.4","fixed":["4.4.1-150200.3.10.1"],"introduced":["0"],"last_affected":[],"package":"gradle","purl":"pkg:rpm/opensuse/gradle\u0026distro=openSUSE%20Leap%2015.4","source":"SUSE-SU-2023:2203-1"}],"prev":{"headline":"De-anonymization via message","id":"CVE-2021-32750"},"products":["gradle"],"published":"2021-07-20","related":[{"cvss_score":9.8,"headline":"Information disclosure in n/a","id":"CVE-2019-15052","kev_date_added":null,"published":"2019-08-14"},{"cvss_score":9.8,"headline":"Deserialization in n/a","id":"CVE-2016-6199","kev_date_added":null,"published":"2017-02-07"},{"cvss_score":8.8,"headline":"Local privilege escalation through system temporary directory","id":"CVE-2021-29428","kev_date_added":null,"published":"2021-04-13"},{"cvss_score":8.6,"headline":"Gradle fails to disable repositories which can expose builds to malicious artifacts","id":"CVE-2026-22816","kev_date_added":null,"published":"2026-01-16"},{"cvss_score":8.6,"headline":"Gradle's failure to disable repositories failing to answer can expose builds to malicious artifacts","id":"CVE-2026-22865","kev_date_added":null,"published":"2026-01-16"},{"cvss_score":8.1,"headline":"Deserialization in n/a","id":"CVE-2021-41588","kev_date_added":null,"published":"2021-09-24"},{"cvss_score":8,"headline":"Repository content filters do not work in Settings pluginManagement","id":"CVE-2021-29427","kev_date_added":null,"published":"2021-04-13"}],"sources":[{"class":"attribution","licence":"Apache-2.0","name":"Bitnami","prefix":"BIT"},{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"SUSE","prefix":"SUSE"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"yes","exploitation":"none","technical_impact":"total"},"state":"PUBLISHED","updated":"2026-10-08","vendors":["gradle"]},"summary":"Attackers can execute arbitrary code by manipulating environment variables in Gradle start scripts, affecting developers using Unix-like systems.","url":"https://insights.sbomify.com/CVE-2021-32751/"}