低危 gradle gradle os命令中使用的特殊元素转义处理不恰当(os命令注入)
CVE编号
CVE-2021-32751利用情况
暂无补丁情况
官方补丁披露时间
2021-07-21漏洞描述
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.解决建议
建议您更新当前系统或软件至最新版,完成漏洞的修复。
参考链接 |
|
---|---|
https://github.com/gradle/gradle/security/advisories/GHSA-6j2p-252f-7mw8 | |
https://medium.com/dot-debug/the-perils-of-bash-eval-cc5f9e309cae | |
https://mywiki.wooledge.org/BashFAQ/048 |
受影响软件情况
# | 类型 | 厂商 | 产品 | 版本 | 影响面 | ||||
1 | |||||||||
---|---|---|---|---|---|---|---|---|---|
运行在以下环境 | |||||||||
应用 | gradle | gradle | * | Up to (excluding) 7.2 | |||||
运行在以下环境 | |||||||||
系统 | alpine_3.15 | gradle | * | Up to (excluding) 7.2-r0 | |||||
运行在以下环境 | |||||||||
系统 | alpine_3.16 | gradle | * | Up to (excluding) 7.2-r0 | |||||
运行在以下环境 | |||||||||
系统 | alpine_3.17 | gradle | * | Up to (excluding) 7.2-r0 | |||||
运行在以下环境 | |||||||||
系统 | alpine_3.18 | gradle | * | Up to (excluding) 7.2-r0 | |||||
运行在以下环境 | |||||||||
系统 | alpine_edge | gradle | * | Up to (excluding) 7.2-r0 | |||||
运行在以下环境 | |||||||||
系统 | debian_10 | gradle | * | Up to (including) 4.4.1-6 | |||||
运行在以下环境 | |||||||||
系统 | debian_11 | gradle | * | Up to (including) 4.4.1-13 | |||||
运行在以下环境 | |||||||||
系统 | debian_12 | gradle | * | Up to (including) 4.4.1-18 | |||||
运行在以下环境 | |||||||||
系统 | debian_9 | gradle | * | Up to (including) 3.2.1-1 | |||||
运行在以下环境 | |||||||||
系统 | debian_sid | gradle | * | Up to (including) 4.4.1-20 | |||||
运行在以下环境 | |||||||||
系统 | opensuse_Leap_15.4 | gradle | * | Up to (excluding) 4.4.1-150200.3.10.1 | |||||
- 攻击路径 远程
- 攻击复杂度 容易
- 权限要求 无需权限
- 影响范围 有限影响
- EXP成熟度 未验证
- 补丁情况 官方补丁
- 数据保密性 无影响
- 数据完整性 无影响
- 服务器危害 无影响
- 全网数量 N/A
CWE-ID | 漏洞类型 |
CWE-78 | OS命令中使用的特殊元素转义处理不恰当(OS命令注入) |
Exp相关链接

版权声明
本站原创文章转载请注明文章出处及链接,谢谢合作!
评论