<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Run-Gemini-Cli GitHub Action — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/run-gemini-cli-github-action/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata — refreshed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Fri, 24 Apr 2026 19:30:01 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/run-gemini-cli-github-action/feed.xml" rel="self" type="application/rss+xml"/><item><title>Gemini CLI Remote Code Execution via Workspace Trust and Tool Allowlisting Bypasses</title><link>https://feed.craftedsignal.io/briefs/2026-04-gemini-cli-rce/</link><pubDate>Fri, 24 Apr 2026 19:30:01 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-04-gemini-cli-rce/</guid><description>Gemini CLI is vulnerable to remote code execution via workspace trust and tool allowlisting bypasses, impacting headless mode and GitHub Actions workflows.</description><content:encoded><![CDATA[<p>Gemini CLI (<code>@google/gemini-cli</code>) versions prior to 0.39.1 and version 0.40.0-preview.2, along with the <code>run-gemini-cli</code> GitHub Action versions prior to 0.1.22, are susceptible to remote code execution due to insecure workspace trust handling and tool allowlisting bypasses. The vulnerability arises from the automatic trust of workspace folders in headless mode, allowing malicious environment variables within the <code>.gemini/</code> directory to be exploited. Furthermore, in <code>--yolo</code> mode, the tool allowlist was previously ignored, enabling prompt injection and code execution via commands like <code>run_shell_command</code>. This poses a risk, especially in CI/CD environments that process untrusted inputs such as pull requests. The patched version 0.39.1 enforces explicit folder trust in headless mode and properly evaluates tool allowlists under <code>--yolo</code>, mitigating these risks. This impacts all Gemini CLI GitHub Actions and requires users to review their workflows.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker submits a malicious pull request to a repository using Gemini CLI in a GitHub Actions workflow.</li>
<li>The workflow, running in headless mode, automatically trusts the workspace folder (versions prior to 0.39.1).</li>
<li>The attacker&rsquo;s pull request includes a crafted <code>.gemini/</code> directory containing malicious environment variables.</li>
<li>Gemini CLI loads the malicious environment variables, leading to code execution.</li>
<li>Alternatively, the attacker injects a malicious prompt leveraging <code>run_shell_command</code> when <code>--yolo</code> is used.</li>
<li>The <code>run_shell_command</code> executes arbitrary commands on the runner due to the bypassed tool allowlist (versions prior to 0.39.1).</li>
<li>The attacker gains control of the CI/CD runner, potentially exfiltrating secrets or injecting malicious code into the deployment pipeline.</li>
<li>Successful exploitation leads to code execution on the CI/CD runner, data exfiltration, or supply chain compromise.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>The vulnerability impacts workflows utilizing Gemini CLI in headless mode, particularly those processing untrusted inputs such as pull requests from external contributors. Successful exploitation can lead to remote code execution on the CI/CD runner, potentially enabling attackers to exfiltrate sensitive information, such as API keys and credentials, or inject malicious code into the application deployment pipeline. This can lead to a supply chain compromise. All Gemini CLI GitHub Actions are affected, requiring users to review and update their workflows.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade <code>@google/gemini-cli</code> to version 0.39.1 or later, or 0.40.0-preview.3 if using a preview version.</li>
<li>Upgrade <code>actions/google-github-actions/run-gemini-cli</code> to version 0.1.22 or later.</li>
<li>For workflows running on trusted inputs, set <code>GEMINI_TRUST_WORKSPACE: 'true'</code> in the GitHub Actions workflow.</li>
<li>For workflows processing untrusted inputs, review the hardening guidance in <a href="https://github.com/google-github-actions/run-gemini-cli">google-github-actions/run-gemini-cli</a> and set the environment variable accordingly.</li>
<li>Review and harden tool allowlists in <code>~/.gemini/settings.json</code> to restrict the commands that can be executed, especially when using the <code>--yolo</code> flag.</li>
</ul>
]]></content:encoded><category domain="severity">critical</category><category domain="type">advisory</category><category>rce</category><category>supply-chain</category><category>github-actions</category></item></channel></rss>