AI Writing Its Own Code? Why a New 'Cloud Security' Hole Was Discovered

Abstract graphic of cloud security layers melting away
AI Summary

Five security vulnerabilities have been identified in Cloudflare's execution engine 'workerd,' confirming risks of user data exposure and unauthorized system control.

Imagine this: You tell your AI assistant, “Summarize the materials for the 3 PM meeting today and email them to the team members.” In the past, AI roles were limited to clicking buttons for you, like ‘summarize’ or ‘send mail’. But now, a world is approaching where AI can open Excel files, summarize content, and write and execute code in real-time to draft emails based on meeting results. This is the look of ‘Agentic AI’ (AI that acts autonomously), which has been gaining significant attention recently.

However, news recently surfaced that a hole has been found in the technical foundation that allows such smart AI to write and execute code directly. It is the story of security vulnerabilities discovered in the core engine of Cloudflare, a cloud computing firm.

Why is this important?

This incident offers a completely new perspective on the relationship between AI and infrastructure security. It is not merely a security issue with the AI model itself, but a problem with the ‘foundational technology’ that safely executes the code generated by the AI. Source 15

This vulnerability was dangerous for two major reasons. First, there was a possibility of ‘confidential information leakage,’ where one customer could secretly snoop on the data of other customers within the system. Second, there was a risk that hackers could escape the ‘Sandbox’ (a safe, isolated space separated from the outside) and seize total control of the cloud server. Source 13 This is undoubtedly chilling news for the millions of developers and companies using Cloudflare’s services. Source 13

AD

In simple terms: The ‘glue’ between AI and infrastructure has melted?

The web services we use are like very sturdy safes. They are designed so that code runs only in rooms strictly separated from the outside for security. Here, Cloudflare uses a runtime (an environment for executing programs) called ‘workerd.’ Source 8

‘Code Mode’ allows AI models to autonomously write TypeScript (a language that enhances JavaScript functionality to enable more complex development) code to perform tasks. Source 1 To use a simple analogy, if the AI is a chef, ‘workerd’ is the ‘kitchen’ provided for the chef to cook safely, and ‘Code Mode’ is the tool that allows the chef to develop their own recipes and cook.

However, the five memory corruption bugs discovered this time were cracks in the ‘infrastructure’ itself, such as the walls or floor of this kitchen. Source 11 Specifically, the problem occurred in the ‘glue’ code composed of native C++ (a programming language with enough performance to control computer hardware directly) that makes up ‘workerd.’ Source 11 Through this crack, hackers could use code created by the chef (AI) to pierce the kitchen wall and snoop on the neighbor’s ingredients (other users’ confidential information) or take over the kitchen entirely.

Current status: Is it safe?

Fortunately, Cloudflare has successfully patched these vulnerabilities in their managed environment. Source 15 Therefore, users of the general services provided by Cloudflare are safe from immediate danger.

However, the story is different for companies or developers who deploy and use the workerd runtime in the form of ‘self-hosting’ (a method of building and operating an environment directly on one’s own server instead of using an external cloud service). They must update to version v1.20260619.1 or higher to ensure safety. Source 15

What will happen in the future?

This incident is an important case study showing how the definition of security should change as the era arrives where AI takes over our tasks. In an environment where AI actively generates and executes code, a new homework assignment remains: we must perfectly protect even the foundational infrastructure where the AI operates. Source 15 Moving forward, while technological innovation is important, the competition to build a ‘sturdy kitchen’ that can safely operate that innovation will likely intensify.

## References

  1. When Agentic Glue Melts: Exploiting Cloudflare Code Mode and…
  2. When Agentic Glue Melts: Exploiting Cloudflare Code Mode and…
  3. When Agentic Glue Melts: Exploiting Cloudflare Code Mode…
  4. When Agentic Glue Melts: Exploiting Cloudflare Code Mode and…
  5. When Agentic Glue Melts: Exploiting Cloudflare Code Mode and…
  6. When Agentic Glue Melts: Exploiting Cloudflare Code Mode and…
  7. Vulnerabilities in Cloudflare workerd Runtime and Code Mode
AD
Test Your Understanding
Q1. How is Cloudflare's 'Code Mode' different from traditional methods?
  • The model performs standardized tool calls
  • The model writes and executes TypeScript code directly
  • It modifies the database directly
Code Mode goes beyond AI models simply calling tools; it allows the AI to write and execute code itself via the TypeScript API.
Q2. What is the core execution environment where this security vulnerability was found?
  • V8 engine
  • workerd runtime
  • Chromium browser
The vulnerabilities were found in the native C++ code of the workerd runtime, which serves as the foundation for both Code Mode and Cloudflare Workers.
Q3. What action should users take now?
  • Stop using the service
  • For self-hosted environments, update to version v1.20260619.1 or higher
  • Change passwords
Cloudflare's managed environment is already patched, but if using self-hosted deployments, you must update to the specified version or higher for safety.
AI Writing Its Own Code? Wh...
0:00