<?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>Gemini-Cli — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/gemini-cli/</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/gemini-cli/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><item><title>GenAI Process Connection to Unusual Domain on macOS</title><link>https://feed.craftedsignal.io/briefs/2024-05-genai-unusual-domain/</link><pubDate>Thu, 02 May 2024 14:22:30 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-05-genai-unusual-domain/</guid><description>This rule detects GenAI tools on macOS connecting to unusual domains, potentially indicating command and control activity, data exfiltration, or malicious payload retrieval following compromise via prompt injection, malicious MCP servers, or poisoned plugins.</description><content:encoded><![CDATA[<p>This threat brief addresses the risk of GenAI tools on macOS connecting to unusual domains, which may indicate a compromised state. Attackers can exploit GenAI tools through prompt injection, malicious MCP (Model Context Protocol) servers, or poisoned plugins to establish command-and-control (C2) channels or exfiltrate sensitive data. Given the network access capabilities of AI agents, adversaries may manipulate them to beacon to external servers, download malicious payloads, or transmit harvested credentials and documents. The Elastic detection rule <code>9050506c-df6d-4bdf-bc82-fcad0ef1e8c1</code> focuses on identifying such anomalous network connections originating from a predefined list of GenAI processes, excluding known legitimate domains. The rule has been actively maintained since its creation on December 4, 2025, with its latest update on April 29, 2026.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Adversary compromises a GenAI tool on a macOS system through prompt injection, malicious MCP servers, or poisoned plugins.</li>
<li>The compromised GenAI tool is configured to connect to an attacker-controlled domain for C2.</li>
<li>The GenAI process initiates a network connection attempt to the unusual domain using standard web protocols (HTTP/HTTPS).</li>
<li>The macOS system&rsquo;s network stack resolves the attacker&rsquo;s domain to its corresponding IP address.</li>
<li>The GenAI process sends data to the attacker-controlled domain, potentially including sensitive information.</li>
<li>The attacker uses the C2 channel to send commands to the compromised GenAI tool.</li>
<li>The GenAI tool executes the commands, potentially leading to further compromise or data exfiltration.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Compromised GenAI tools can lead to data exfiltration, unauthorized access to sensitive information, and the establishment of persistent C2 channels within an organization&rsquo;s network. The impact ranges from the loss of intellectual property and customer data to the potential disruption of business operations. The risk is amplified if the GenAI tool has access to internal systems or sensitive data stores, allowing attackers to pivot and escalate their attacks.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the Sigma rule &ldquo;GenAI Process Connecting to Unusual Domain&rdquo; to your SIEM and tune for your environment (see rule below).</li>
<li>Enable process creation and network connection logging on macOS endpoints to collect the data required for the Sigma rule.</li>
<li>Investigate any alerts generated by the Sigma rule to determine the legitimacy of the domain and the GenAI process&rsquo;s behavior.</li>
<li>Block any identified malicious domains at the network level (see query in the provided source).</li>
<li>Review the GenAI tool&rsquo;s configuration for unauthorized MCP servers, plugins, or extensions that initiated the connection.</li>
<li>Regularly update the list of allowed domains in the Sigma rule&rsquo;s filter to account for legitimate updates to GenAI tool infrastructure.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>genai</category><category>command and control</category><category>macos</category><category>network connection</category></item></channel></rss>