Command Injection Affecting @google/gemini-cli package, versions <0.39.1>=0.40.0-preview.2 <0.40.0-preview.3


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Command Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-GOOGLEGEMINICLI-16301693
  • published27 Apr 2026
  • disclosed24 Apr 2026
  • creditDan Lisichkin, Elad Meged

Introduced: 24 Apr 2026

New CVE NOT AVAILABLE CWE-77  (opens in a new tab)
CWE-78  (opens in a new tab)

How to fix?

Upgrade @google/gemini-cli to version 0.39.1, 0.40.0-preview.3 or higher.

Overview

@google/gemini-cli is a Gemini CLI

Affected versions of this package are vulnerable to Command Injection via the processing of untrusted workspace folders in headless mode and the handling of tool allowlisting under --yolo mode. An attacker can execute arbitrary code by submitting malicious content or environment variables in untrusted directories or by exploiting insufficiently restricted shell command execution.

CVSS Base Scores

version 4.0
version 3.1