Docker Sandboxes Flaw Exposes Sensitive API Keys
A significant security vulnerability, tracked as CVE-2026-136998, has been discovered in Docker Sandboxes, a system designed to run AI coding agents within isolated virtual environments. This critical Docker Sandboxes Flaw allowed a compromised third-party agent kit to exfiltrate sensitive API keys belonging to developers, undermining the core security promise of the sandbox. The vulnerability was identified by Endor Labs researcher Peyton Kennedy and has since been patched by Docker in version 0.55.0.
Table of Contents
The exploitchain hinges on a flaw within the credential approval process. Once a developer grants access to an agent kit, a subsequent update to that kit could, without further prompting, transmit real API keys for services like Anthropic, OpenAI, or GitHub to an attacker-controlled server. This bypasses the intended isolation, turning a security tool into a potential data leak vector.
Exploiting the Consent Mechanism
The fundamental promise of Docker Sandboxes is that raw API keys never enter the isolated agent environment. Developers store keys on the host system, and the sandbox agent uses a placeholder. A proxy on the host then swaps this placeholder with the actual key when making outbound requests. The destination for these keys is typically determined by the agent kit, which is a packaged configuration fetched from a registry or local source.
Since version 0.43.0, released on September 15, 2026, approving a kit’s credential request creates a binding that records the service and approved domains. However, researcher Peyton Kennedy discovered that this recorded list of approved destinations was not being enforced at request time. The proxy only checked for the existence of a binding for the service name, subsequently sending the real key to any domain specified by the current version of the kit, regardless of prior approval.
Kennedy demonstrated this by approving a kit with `api.anthropic.com` as the sole destination. He then updated the kit at the same reference to point to a malicious test server. The next sandbox creation proceeded without any new prompts, and the proxy delivered the dummy key in cleartext to the attacker’s server. This approval persisted even after the sandbox was deleted, and the policy log incorrectly recorded the connection as allowed without noting the key injection.
Technical Architecture and Vulnerability Impact
The Docker Sandboxes Flaw, introduced with the consent system in version 0.43.0, affects all versions prior to 0.55.0 across macOS, Windows, and Linux. This vulnerability impacts thirteen built-in integrations, including major services like Anthropic, OpenAI, GitHub, and Google. Kennedy’s proof-of-concept utilized a dummy Anthropic key to illustrate the exploit’s potential.
The flaw was initially scored 9.3 (Critical) under CVSS 3.1 but was later corrected to 8.2 (High) by adjusting the attack vector to ‘local’, as the malicious kit must be fetched by the developer. Under the newer CVSS 4.0, the score is 6.9 (Medium), with variations depending on whether harm to the provider account is factored into the base score. The attacker requires only a one-time approval and a single modification in the kit’s subsequent version, without needing direct access to the developer’s machine.
A significant consequence is that secrets stored globally with `sbx secret set` are affected. A single compromised token, such as a GitHub token with broad scopes, could grant attackers write access to repositories. This mirrors concerns seen in other breaches, such as the easyDNS AWS Keys Exposed incident, where exposed credentials led to customer data access.
Mitigation and Engineering Trade-offs
The immediate solution for the Docker Sandboxes Flaw is to upgrade to version 0.55.0. The release notes confirm that kit credential injection now strictly enforces approved destinations for API keys and OAuth separately. Bindings without approved destinations are now treated as invalid, effectively closing the vulnerability.
For systems still running older versions or for those who may have granted credentials while vulnerable, Kennedy recommends several mitigation steps. These include reviewing and removing bindings to third-party kits in the `credentials.yaml` file, carefully inspecting kit injection domains and network allowlist entries for every sandbox creation, and pinning kits to fixed commits or maintaining reviewed local copies where possible.
Storing keys per-sandbox using the `–sandbox` flag instead of globally is also advised. Furthermore, rotating provider keys behind any third-party kit that has been updated since the vulnerability was introduced is crucial. This proactive approach helps to limit the potential blast radius of any compromised credentials, similar to the security measures needed after incidents like the Critical RubyGems Registry Flaw.
Field Readiness and Verdict
The vulnerability highlights a recurring challenge in securing AI development tools: ensuring that approval mechanisms are robust and directly tied to the integrity of the artifacts being approved. Kennedy noted that a prompt is only as strong as what its answer is bound to; if the approval is not tied to the inspected artifact, subsequent updates can inherit vulnerabilities.
This is the second vulnerability Kennedy has reported in Docker Sandboxes within a month. The previous flaw, a file-copy vulnerability fixed on November 3, 2026, also demonstrated how failures occurred in the attachment of developer approvals rather than the core virtual machine boundary itself. The fix in 0.55.0 appears to address the immediate threat, but ongoing vigilance in validating AI agent kit integrity remains paramount for developers.
The potential for malicious AI agent kits to exploit such flaws underscores the broader security risks in the AI development ecosystem, as seen in reports like AI Agent Security Flaws where many agents bypass controls. While Docker has acted swiftly to patch this specific Docker Sandboxes Flaw, developers must remain diligent in managing their credentials and vetting the tools they integrate into their workflows.
Source: The Hacker News

