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`.
Published: 2026-01-29
Score: 8.3 High
EPSS: < 1% Very Low
KEV: No
Impact: Arbitrary code execution via Bash command injection
Action: Patch Immediately
AI Analysis

Impact

The vulnerability resides in the gradle-completion script used for Bash auto‑completion. By injecting a malicious Gradle build file that contains backticks in a task description, a local user who triggers Bash completion (for example, by pressing Tab) can cause the shell to execute arbitrary commands. This leads to total loss of confidentiality, integrity, and availability on the victim’s user account. The flaw satisfies CWE‑78 (OS Command Injection) and CWE‑157 (Invalid Input Predicate).

Affected Systems

Systems that use the Gradle CLI with Bash completion enabled – any user who sources gradle-completion in their .bashrc or .bash_profile – are affected when the script version is 9.3.0 or earlier. The patch first appears in gradle-completion 9.3.1, and the issue does not exist in the newer version or in the Zsh completion mechanism.

Risk and Exploitability

The CVSS base score is 8.3, classifying it as high severity, but the EPSS score is under 1 %, indicating a very low rate of exploitation in the wild. An attacker must have local access to the machine, able to create or modify a Gradle build file in the directory where Bash auto‑completion is invoked. No remote exploitation or network attack is possible. The vulnerability is not in the CISA KEV catalog, further suggesting that active exploitation is unlikely.

Generated by OpenCVE AI on April 18, 2026 at 14:30 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Update the gradle-completion script to version 9.3.1 or newer, which removes the sanitization flaw.
  • As a temporary measure, comment out or delete the line that sources gradle-completion from your .bashrc or .bash_profile, effectively disabling Bash auto‑completion for Gradle until the patch can be applied.
  • Ensure that only trusted users have write access to directories that may contain Gradle build files used with auto‑completion, or otherwise validate build files before they are executed.

Generated by OpenCVE AI on April 18, 2026 at 14:30 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Thu, 12 Mar 2026 19:00:00 +0000

Type Values Removed Values Added
CPEs cpe:2.3:a:gradle:gradle-completion:*:*:*:*:*:gradle:*:*
Metrics cvssV3_1

{'score': 7.8, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H'}


Tue, 10 Feb 2026 15:30:00 +0000


Mon, 02 Feb 2026 17:15:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Fri, 30 Jan 2026 09:00:00 +0000

Type Values Removed Values Added
First Time appeared Gradle
Gradle gradle-completion
Vendors & Products Gradle
Gradle gradle-completion

Thu, 29 Jan 2026 22:00:00 +0000

Type Values Removed Values Added
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`.
Title gradle-completion has a Bash command injection issue
Weaknesses CWE-157
CWE-78
References
Metrics cvssV4_0

{'score': 8.3, 'vector': 'CVSS:4.0/AV:L/AC:L/AT:N/PR:H/UI:A/VC:H/VI:H/VA:H/SC:N/SI:H/SA:N'}


Subscriptions

Gradle Gradle-completion
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-02-10T14:55:17.356Z

Reserved: 2026-01-28T14:50:47.889Z

Link: CVE-2026-25063

cve-icon Vulnrichment

Updated: 2026-02-10T14:55:17.356Z

cve-icon NVD

Status : Analyzed

Published: 2026-01-29T22:15:55.947

Modified: 2026-03-12T18:46:12.247

Link: CVE-2026-25063

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-04-18T14:45:03Z

Weaknesses