{"id":1208,"date":"2026-07-08T17:35:49","date_gmt":"2026-07-08T17:35:49","guid":{"rendered":"https:\/\/feedsta.ai\/blog\/rogue-agent-dialogflow-cx-code-injection\/"},"modified":"2026-07-19T06:32:54","modified_gmt":"2026-07-19T06:32:54","slug":"rogue-agent-dialogflow-cx-code-injection","status":"publish","type":"post","link":"https:\/\/feedsta.ai\/blog\/rogue-agent-dialogflow-cx-code-injection\/","title":{"rendered":"Rogue Agent: A Code Injection Flaw in Google Dialogflow CX"},"content":{"rendered":"<p>Varonis Threat Labs discovered a critical vulnerability in Google Cloud Platform&#8217;s Dialogflow CX service, Google&#8217;s conversational AI platform for building voice and text chatbots. The team named the discovery &#8220;Rogue Agent,&#8221; and the flaw allowed attackers to inject persistent malicious code into the Dialogflow agent pipeline through the Code Blocks feature, silently exfiltrating conversations and conducting phishing campaigns at scale.<\/p>\n<h2>What the vulnerability targeted<\/h2>\n<p>Dialogflow CX uses Playbooks to structure conversation workflows. Within those Playbooks, Code Blocks let developers embed custom Python logic directly into conversation flows so an agent can process user input, call external APIs, and manipulate data inside a Google-managed Cloud Run service.<\/p>\n<p>All Dialogflow agents that use Code Blocks within the same GCP project effectively share the same Cloud Run execution environment, a service that sits outside the customer&#8217;s direct visibility and runs with public outbound network access by default. That shared, externally managed environment is central to how the attack worked.<\/p>\n<h2>How did the exploit work?<\/h2>\n<p>Starting the exploit required only a single permission: <code>dialogflow.playbooks.update<\/code> on one agent. The shared Cloud Run service that ran Code Block code had public network access, a write-enabled filesystem, and ran under a user with privileges to modify system files.<\/p>\n<p>Researchers found a writable Python file called <code>code_execution_env.py<\/code> that the platform used to execute configured Playbook Code Blocks via Python&#8217;s <code>exec()<\/code> function. Because the configured Code Block was simply appended to internal system code before being passed to <code>exec()<\/code>, and because injected Code Blocks ran in the same scope, attackers could reference variables that exposed the full conversation history and session-level parameters. They could also call internal functions such as <code>respond()<\/code> to force the agent to return attacker-supplied strings, making those strings appear to come from the underlying model.<\/p>\n<p>The exploit chain was straightforward:<\/p>\n<ul>\n<li>An attacker configured a Code Block that downloaded a modified <code>code_execution_env.py<\/code> from an attacker-controlled public storage bucket and overwrote the original file inside the Cloud Run container.<\/li>\n<li>The modified file intercepted every execution before calling <code>exec()<\/code>, exfiltrated conversation data to an attacker-controlled server, and used <code>respond()<\/code> to inject phishing prompts disguised as legitimate reauthentication requests.<\/li>\n<li>After execution, the attacker restored the original Code Block configuration so the Dialogflow console UI looked normal, while malicious logic persisted invisibly in the Cloud Run environment.<\/li>\n<\/ul>\n<p>Cloud Logging did not record the file overwrite or the injected logic, making detection extremely difficult. From a single foothold on one agent, an attacker could effectively compromise other agents in the same project by leveraging the shared execution environment.<\/p>\n<h2>What additional weaknesses were found?<\/h2>\n<p>Alongside the code injection flaw, the researchers identified two related issues that widened the impact.<\/p>\n<h3>VPC Service Controls bypass<\/h3>\n<p>Code Blocks ran inside a Google-managed Cloud Run service with unrestricted outbound internet access, effectively placing that environment outside the project&#8217;s VPC-SC perimeter. Using preinstalled libraries such as urllib, the team established a bidirectional channel from the execution environment to an external server and bypassed VPC-SC entirely, enabling data exfiltration and a potential command-and-control channel even on agents protected by perimeter controls.<\/p>\n<h3>Credential exposure via IMDS<\/h3>\n<p>The Instance Metadata Service was reachable from within the Cloud Run environment. Querying IMDS returned access tokens belonging to a Google-managed service account. While the tokens belonged to a low-privileged account, the team noted that code execution environments should never have access to IMDS, since that violates isolation principles and creates systemic risk if the service account were ever granted additional rights.<\/p>\n<h2>When was it disclosed and fixed?<\/h2>\n<p>Varonis first reported the vulnerability to Google in November 2025. Google issued an initial security update in April 2026 and fully resolved the issue in June 2026. All affected components have since been remediated. Varonis and Google are not aware of any exploitation in the wild before the patch release. Before the patch, any GCP organization using Dialogflow CX agents with Playbook Code Blocks was potentially at risk.<\/p>\n<h2>How could organizations detect and respond?<\/h2>\n<p>Because the overwrite occurred in a Google-managed Cloud Run environment outside the customer&#8217;s direct visibility, detection had to rely on adjacent signals. Varonis recommended several steps for organizations to confirm they were not affected.<\/p>\n<ul>\n<li>If DATA_WRITE Audit Logs for the Dialogflow API are enabled, review successful past events and correlate them with indicators such as rare API access by a user, unusual IP addresses, and atypical access times.<\/li>\n<li>Run a Cloud Logging query against <code>protoPayload.status.message<\/code> for failed user requests, since messages in that field can surface exceptions thrown by malicious Code Blocks.<\/li>\n<li>Manually review each agent&#8217;s Code Block configuration under Playbooks in the Dialogflow CX console and confirm that every configured Code Block is whitelisted and approved.<\/li>\n<\/ul>\n<p>Google and Varonis also advised auditing Dialogflow CX configurations for suspicious Playbook updates and analyzing past playbook update actions.<\/p>\n<h2>Why does this matter?<\/h2>\n<p>Dialogflow agents support customer support systems, financial services bots, healthcare assistants, and enterprise workflows that handle personally identifiable information, payment details, and confidential business data. A flaw that let attackers silently hijack sessions, inject phishing prompts, and exfiltrate conversations represented a serious breach of trust for any organization relying on the platform.<\/p>\n<p>Rogue Agent is the latest in a series of AI-related threats Varonis has responsibly disclosed through work with cloud providers, including Reprompt in Microsoft Copilot Personal and SearchLeak in Microsoft Copilot Enterprise. The research underlines that cloud services such as Dialogflow are deeply integrated with other GCP components, that security features are not always properly implemented, and that defenders need visibility and controls across every layer rather than relying on the perimeter alone.<\/p>\n<h2>FAQ<\/h2>\n<h3>What is Rogue Agent?<\/h3>\n<p>Rogue Agent is the name Varonis Threat Labs gave to a critical code injection vulnerability in Google Cloud Platform&#8217;s Dialogflow CX service that let attackers inject persistent malicious code through the Code Blocks feature, silently exfiltrating conversations and running phishing campaigns at scale.<\/p>\n<h3>What permission did an attacker need to exploit the flaw?<\/h3>\n<p>An attacker needed only the <code>dialogflow.playbooks.update<\/code> permission on a single Dialogflow agent within a GCP project to begin the exploit, because Code Blocks ran in a shared Cloud Run environment that could compromise other agents in the same project.<\/p>\n<h3>When did Google fix the vulnerability?<\/h3>\n<p>Google issued an initial security update in April 2026 after Varonis reported the issue in November 2025, and fully resolved the issue in June 2026. Varonis and Google are not aware of any exploitation in the wild before the patch.<\/p>\n<p><script type=\"application\/ld+json\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"headline\":\"Rogue Agent: A Code Injection Flaw in Google Dialogflow CX\",\"description\":\"Varonis Threat Labs found a code injection flaw, dubbed Rogue Agent, in Google Dialogflow CX that let attackers exfiltrate chats and run phishing at scale.\",\"datePublished\":\"2026-07-19T06:32:53.561Z\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Feedsta\"}},{\"@type\":\"FAQPage\",\"mainEntity\":[{\"@type\":\"Question\",\"name\":\"What is Rogue Agent?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Rogue Agent is the name Varonis Threat Labs gave to a critical code injection vulnerability in Google Cloud Platform's Dialogflow CX service that let attackers inject persistent malicious code through the Code Blocks feature, silently exfiltrating conversations and running phishing campaigns at scale.\"}},{\"@type\":\"Question\",\"name\":\"What permission did an attacker need to exploit the flaw?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"An attacker needed only the dialogflow.playbooks.update permission on a single Dialogflow agent within a GCP project to begin the exploit, because Code Blocks ran in a shared Cloud Run environment that could compromise other agents in the same project.\"}},{\"@type\":\"Question\",\"name\":\"When did Google fix the vulnerability?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Google issued an initial security update in April 2026 after Varonis reported the issue in November 2025, and fully resolved the issue in June 2026. Varonis and Google are not aware of any exploitation in the wild before the patch.\"}}]}]}<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Varonis Threat Labs found a code injection flaw, dubbed Rogue Agent, in Google Dialogflow CX that let attackers exfiltrate chats and run phishing at scale.<\/p>\n","protected":false},"author":1,"featured_media":1207,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"","rank_math_description":"","rank_math_focus_keyword":"","rank_math_canonical_url":"","rank_math_facebook_title":"","rank_math_facebook_description":"","rank_math_twitter_title":"","rank_math_twitter_description":"","rank_math_robots":[],"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1208","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai-news"],"_links":{"self":[{"href":"https:\/\/feedsta.ai\/blog\/wp-json\/wp\/v2\/posts\/1208","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/feedsta.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/feedsta.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/feedsta.ai\/blog\/wp-json\/wp\/v2\/comments?post=1208"}],"version-history":[{"count":2,"href":"https:\/\/feedsta.ai\/blog\/wp-json\/wp\/v2\/posts\/1208\/revisions"}],"predecessor-version":[{"id":1358,"href":"https:\/\/feedsta.ai\/blog\/wp-json\/wp\/v2\/posts\/1208\/revisions\/1358"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/feedsta.ai\/blog\/wp-json\/wp\/v2\/media\/1207"}],"wp:attachment":[{"href":"https:\/\/feedsta.ai\/blog\/wp-json\/wp\/v2\/media?parent=1208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/feedsta.ai\/blog\/wp-json\/wp\/v2\/categories?post=1208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/feedsta.ai\/blog\/wp-json\/wp\/v2\/tags?post=1208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}