December 2, 2026

Critical Security Flaw in Docker Sandboxes Exposed API Keys to Third-Party Agent Kits

In an era where artificial intelligence coding agents are becoming increasingly integrated into the software development lifecycle, the security of the environments that host these agents has become a paramount concern. Docker, a leader in containerization and virtualization technology, recently moved to address a significant security vulnerability in its Docker Sandboxes product. The flaw, identified as CVE-2026-136998, created a pathway for malicious third-party agent kits to exfiltrate highly sensitive API keys, including those for OpenAI, Anthropic, and GitHub, which the sandbox was specifically designed to protect.

Docker Sandboxes were engineered to provide an isolated virtual machine (VM) environment where AI-driven coding agents could operate without posing a risk to the developer’s host system. By running these agents inside a hardened VM, Docker aimed to allow developers to leverage the power of LLM-based automation while maintaining a strict boundary between untrusted code and the developer’s primary workspace. However, research conducted by Peyton Kennedy of Endor Labs revealed that a flaw in the product’s authorization logic effectively neutralized this boundary for sensitive credentials.

The vulnerability stems from a breakdown in how Docker Sandboxes manage and validate the destinations for API requests. At the heart of the product’s security model is a promise of credential isolation: raw API keys are never supposed to enter the sandbox itself. Instead, a developer stores their secrets on the host machine using a specific command, such as "sbx secret set." When an agent operating within the virtual machine needs to make an external request—for instance, to an LLM provider—it uses a placeholder header. A specialized proxy residing on the host machine is then responsible for intercepting that request and swapping the placeholder with the actual, sensitive API key before the request leaves the host for the internet.

This mechanism is designed to ensure that even if an AI agent is compromised or behaves maliciously, it never has direct access to the developer’s underlying credentials. The decision of which external domains are permitted to receive these injected keys is governed by the "kit," a packaged configuration that defines the agent’s behavior and requirements. These kits can be fetched from a registry, a Git repository, or a local directory.

Docker Sandboxes Flaw Lets Malicious AI Agent Kit Updates Steal Developers' API Keys

The security failure began with the introduction of a new consent system in version 0.43.0, released in mid-September. This system was intended to give developers more granular control by requiring them to approve a kit’s request for credentials. Upon approval, the system was supposed to create a "binding" that recorded both the service being accessed and the specific domains the developer had authorized.

However, Kennedy’s technical analysis discovered that while the system recorded these approved domains, it failed to actually consult that list when a request was being processed. When the host-side proxy received a request from the sandbox, it only checked whether a binding existed for the service name. If a binding was found, the proxy would proceed to inject the real API key and forward it to whatever domain the current version of the kit specified, regardless of whether that domain had been part of the developer’s original approval.

Kennedy demonstrated the severity of this "bait and switch" vulnerability through a controlled experiment. He created a kit that initially requested access to a legitimate endpoint, such as api.anthropic.com. Once the developer granted approval for this trusted destination, Kennedy updated the kit at the same reference point to point toward a test server under his control. Because the system did not re-verify the destination against the original approval, and because the approval persisted even after a sandbox was deleted, the proxy automatically delivered a dummy API key to the malicious server in cleartext.

The attack requires only a single initial approval from the developer. Once that trust is established, a subsequent update to the kit’s configuration can redirect traffic and steal credentials without triggering any new prompts or warnings. Furthermore, Kennedy found that the product’s policy logs offered no indication of foul play; the logs recorded the connections as "allowed" but failed to mention that a sensitive key had been injected into the traffic sent to an unauthorized domain. A malicious kit could even go a step further by adding its own command-and-control server to the sandbox’s network allowlist without any user intervention.

The implications of such a leak are profound, as the damage follows the stolen key. Secrets stored within the Docker Sandbox environment are often global by default, meaning a compromised key is likely the same one used by every sandbox instance on that developer’s machine. The theft of a GitHub token, for example, could grant an attacker write access to a developer’s private repositories, potentially leading to supply chain attacks or the injection of malicious code into legitimate projects.

Docker Sandboxes Flaw Lets Malicious AI Agent Kit Updates Steal Developers' API Keys

The vulnerability affects Docker Sandboxes on macOS, Windows, and Linux for all versions released between 0.43.0 and 0.55.0. It impacts thirteen built-in integrations that utilize the key-injection path, including major AI providers like Google, OpenAI, and Anthropic. Kennedy initially assigned the flaw a CVSS 3.1 score of 9.3, categorizing it as "Critical." However, after further review, the score was adjusted to 8.2 ("High") because the attack vector was classified as "local." This classification reflects that a developer must actively fetch and run a malicious kit, rather than an attacker reaching the system over a network. Under the newer CVSS 4.0 standard, the scores are slightly lower, with Kennedy rating it at 6.9 and the vendor rating it at 5.6, both falling into the "Medium" severity category. The discrepancy in these scores often hinges on whether the potential harm to the provider accounts associated with the stolen keys is factored into the base assessment.

Docker responded to the report by releasing version 0.55.0, which includes a comprehensive fix for the logic error. According to the official release notes, the updated version now strictly enforces the destinations approved for API keys and OAuth credentials separately. If a binding exists but contains no approved destinations for a specific request, the system will treat the binding as missing and deny the injection of the secret.

Despite the fix, Kennedy suggested further enhancements to the product’s security architecture. He recommended that Docker tie user approvals to a specific content digest of the kit, ensuring that any modification to the kit would invalidate the previous approval and force a new prompt. He also urged the vendor to ensure that every instance of key injection is explicitly recorded in the policy logs to provide better auditability. While the latest release addresses the core destination enforcement issue, it did not explicitly implement these additional suggestions.

This discovery marks the second significant vulnerability Kennedy has identified in Docker Sandboxes within a single month. Both issues were reported to Docker on September 21. The first vulnerability involved a file-copy flaw that could allow an AI agent to bypass directory restrictions and access files on the host machine that it was not authorized to see. That issue was patched in early November.

Reflecting on the nature of these vulnerabilities, Kennedy noted that in both instances, the primary virtual machine boundary remained intact. The failures occurred not in the isolation technology itself, but in the management and authorization layers that connect the host to the guest environment. "A prompt is only as strong as what its answer is bound to," Kennedy wrote in his analysis. "If the approval is not tied to the artifact that was inspected, the next update inherits it."

Docker Sandboxes Flaw Lets Malicious AI Agent Kit Updates Steal Developers' API Keys

For developers and organizations currently using Docker Sandboxes, the primary recommendation is an immediate upgrade to version 0.55.0 or later. For those who may have granted credentials to third-party kits while running vulnerable versions, a thorough audit of active secrets and a rotation of any potentially exposed API keys is highly advised.

The incident serves as a critical reminder of the complexities involved in securing AI-automated workflows. As developers increasingly rely on third-party "kits" and agents to handle sensitive coding tasks, the systems designed to protect them must ensure that user consent is not just a one-time gate, but a continuous and verifiable contract between the user and the software. As the ecosystem for AI development tools continues to expand, the scrutiny of these isolation boundaries will remain a vital component of maintaining a secure software supply chain.