CVE-2026-25063: CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in gradle gradle-completion
gradle-completion provides Bash and Zsh completion support for Gradle. A command injection vulnerability was found in gradle-completion up to and including 9.3.0 that allows arbitrary code execution when a user triggers Bash tab completion in a project containing a malicious Gradle build file. The `gradle-completion` script for Bash fails to adequately sanitize Gradle task names and task descriptions, allowing command injection via a malicious Gradle build file when the user completes a command in Bash (without them explicitly running any task in the build). For example, given a task description that includes a string between backticks, then that string would be evaluated as a command when presenting the task description in the completion list. While task execution is the core feature of Gradle, this inherent execution may lead to unexpected outcomes. The vulnerability does not affect zsh completion. The first patched version is 9.3.1. As a workaround, it is possible and effective to temporarily disable bash completion for Gradle by removing `gradle-completion` from `.bashrc` or `.bash_profile`.
AI Analysis
Technical Summary
CVE-2026-25063 is an OS command injection vulnerability classified under CWE-78 and CWE-157, affecting the gradle-completion Bash script component of Gradle up to version 9.3.0. Gradle-completion provides shell completion support for Gradle commands, enhancing developer productivity by enabling tab completion of tasks and options. The vulnerability stems from improper neutralization of special elements in task names and descriptions when displayed during Bash tab completion. Specifically, if a Gradle build file contains a task description with a string enclosed in backticks, the Bash completion script evaluates this string as a shell command during tab completion. This leads to arbitrary command execution in the context of the user triggering the completion. The vulnerability does not require the user to explicitly run any Gradle task; merely triggering tab completion in a project with a malicious build file suffices. The flaw is limited to Bash completion and does not impact Zsh. Exploitation requires local access and user interaction (tab completion). The vulnerability was patched in gradle-completion version 9.3.1 by properly sanitizing task names and descriptions to prevent command injection. No known exploits are reported in the wild as of the publication date. The CVSS 4.0 vector indicates local attack vector, low attack complexity, no privileges required beyond local user, user interaction required, and high impact on confidentiality, integrity, and availability. This vulnerability poses a significant risk in development and build environments where Gradle is used with Bash completion enabled.
Potential Impact
For European organizations, this vulnerability poses a substantial risk primarily in software development environments, continuous integration/continuous deployment (CI/CD) pipelines, and developer workstations where Gradle is used with Bash completion enabled. Successful exploitation can lead to arbitrary code execution with the privileges of the user running the shell, potentially allowing attackers to execute malicious commands, escalate privileges, or move laterally within internal networks. This could compromise source code integrity, leak sensitive intellectual property, or disrupt build processes. Organizations relying heavily on Gradle for Java or Android development, especially those with automated build systems that use Bash shells, are particularly vulnerable. The impact extends to any environment where developers or automated systems perform tab completion on Gradle commands. Given the high CVSS score, the vulnerability could facilitate supply chain attacks or insider threats if exploited. However, the requirement for local access and user interaction limits remote exploitation, reducing the risk of widespread automated attacks. Nonetheless, the potential for damage in targeted attacks against critical software development infrastructure in Europe is significant.
Mitigation Recommendations
1. Upgrade gradle-completion to version 9.3.1 or later immediately to apply the official patch that properly sanitizes task names and descriptions. 2. As an interim measure, disable Bash completion for Gradle by removing or commenting out the gradle-completion script invocation in user shell initialization files such as .bashrc or .bash_profile. 3. Educate developers and build engineers about the risks of opening or working in projects with untrusted or unknown Gradle build files, especially when using Bash completion. 4. Implement strict access controls and code review policies to prevent malicious Gradle build files from entering source repositories or build environments. 5. Monitor developer workstations and CI/CD systems for unusual command execution or shell activity that could indicate exploitation attempts. 6. Consider restricting local user permissions and employing endpoint detection and response (EDR) solutions to detect anomalous behavior related to shell command execution. 7. Encourage use of alternative shells like Zsh for Gradle completion, as this vulnerability does not affect Zsh completion scripts. 8. Regularly audit and update development tools and dependencies to minimize exposure to known vulnerabilities.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Poland, Italy, Spain
CVE-2026-25063: CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in gradle gradle-completion
Description
gradle-completion provides Bash and Zsh completion support for Gradle. A command injection vulnerability was found in gradle-completion up to and including 9.3.0 that allows arbitrary code execution when a user triggers Bash tab completion in a project containing a malicious Gradle build file. The `gradle-completion` script for Bash fails to adequately sanitize Gradle task names and task descriptions, allowing command injection via a malicious Gradle build file when the user completes a command in Bash (without them explicitly running any task in the build). For example, given a task description that includes a string between backticks, then that string would be evaluated as a command when presenting the task description in the completion list. While task execution is the core feature of Gradle, this inherent execution may lead to unexpected outcomes. The vulnerability does not affect zsh completion. The first patched version is 9.3.1. As a workaround, it is possible and effective to temporarily disable bash completion for Gradle by removing `gradle-completion` from `.bashrc` or `.bash_profile`.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2026-25063 is an OS command injection vulnerability classified under CWE-78 and CWE-157, affecting the gradle-completion Bash script component of Gradle up to version 9.3.0. Gradle-completion provides shell completion support for Gradle commands, enhancing developer productivity by enabling tab completion of tasks and options. The vulnerability stems from improper neutralization of special elements in task names and descriptions when displayed during Bash tab completion. Specifically, if a Gradle build file contains a task description with a string enclosed in backticks, the Bash completion script evaluates this string as a shell command during tab completion. This leads to arbitrary command execution in the context of the user triggering the completion. The vulnerability does not require the user to explicitly run any Gradle task; merely triggering tab completion in a project with a malicious build file suffices. The flaw is limited to Bash completion and does not impact Zsh. Exploitation requires local access and user interaction (tab completion). The vulnerability was patched in gradle-completion version 9.3.1 by properly sanitizing task names and descriptions to prevent command injection. No known exploits are reported in the wild as of the publication date. The CVSS 4.0 vector indicates local attack vector, low attack complexity, no privileges required beyond local user, user interaction required, and high impact on confidentiality, integrity, and availability. This vulnerability poses a significant risk in development and build environments where Gradle is used with Bash completion enabled.
Potential Impact
For European organizations, this vulnerability poses a substantial risk primarily in software development environments, continuous integration/continuous deployment (CI/CD) pipelines, and developer workstations where Gradle is used with Bash completion enabled. Successful exploitation can lead to arbitrary code execution with the privileges of the user running the shell, potentially allowing attackers to execute malicious commands, escalate privileges, or move laterally within internal networks. This could compromise source code integrity, leak sensitive intellectual property, or disrupt build processes. Organizations relying heavily on Gradle for Java or Android development, especially those with automated build systems that use Bash shells, are particularly vulnerable. The impact extends to any environment where developers or automated systems perform tab completion on Gradle commands. Given the high CVSS score, the vulnerability could facilitate supply chain attacks or insider threats if exploited. However, the requirement for local access and user interaction limits remote exploitation, reducing the risk of widespread automated attacks. Nonetheless, the potential for damage in targeted attacks against critical software development infrastructure in Europe is significant.
Mitigation Recommendations
1. Upgrade gradle-completion to version 9.3.1 or later immediately to apply the official patch that properly sanitizes task names and descriptions. 2. As an interim measure, disable Bash completion for Gradle by removing or commenting out the gradle-completion script invocation in user shell initialization files such as .bashrc or .bash_profile. 3. Educate developers and build engineers about the risks of opening or working in projects with untrusted or unknown Gradle build files, especially when using Bash completion. 4. Implement strict access controls and code review policies to prevent malicious Gradle build files from entering source repositories or build environments. 5. Monitor developer workstations and CI/CD systems for unusual command execution or shell activity that could indicate exploitation attempts. 6. Consider restricting local user permissions and employing endpoint detection and response (EDR) solutions to detect anomalous behavior related to shell command execution. 7. Encourage use of alternative shells like Zsh for Gradle completion, as this vulnerability does not affect Zsh completion scripts. 8. Regularly audit and update development tools and dependencies to minimize exposure to known vulnerabilities.
Affected Countries
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-01-28T14:50:47.889Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 697bd7ddac06320222bd31b6
Added to database: 1/29/2026, 9:57:49 PM
Last enriched: 2/14/2026, 12:01:01 PM
Last updated: 3/25/2026, 2:04:35 AM
Views: 60
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.