Skip to main content
CybersecurityHacking

Docker Sandbox Flaw Exposes API Keys to Malicious AI Agent Kits

Virtual machine setup on a lab bench with laptop and cables, screen blurred.
"a prompt is only as strong as what its answer is bound to. If the approval is not tied to the artifact that was inspected, the next update inherits it," Endor Labs researcher Peyton Kennedy wrote after demonstrating a flaw that let a later kit update siphon API keys out of Docker Sandboxes.

How Docker Sandboxes' credential proxy was supposed to work

Docker Sandboxes isolates AI coding agents inside virtual machines and promises that raw API keys never enter the sandbox. A developer stores a key on the host with sbx secret set; the agent inside the virtual machine sends requests with a placeholder header; and a host-side proxy swaps in the real key on outbound calls. Which destinations receive the real key is supposed to be controlled by approvals the developer grants to a kit — a packaged agent configuration fetched from a registry, a Git reference, or a local folder.

How CVE-2026-136998 let kits exfiltrate keys

Peyton Kennedy found that the consent system added in version 0.43.0 (released September 15) recorded the domains a developer approved, but the recorded list was never read back at request time. Instead, the proxy checked only whether a binding existed for the service name; it then sent the real key to whatever domains the current version of the kit named. "The domains the operator approved play no part in that decision," Kennedy wrote.

In Kennedy's demonstration — tracked as CVE-2026-136998 — a kit initially approved for api.anthropic.com was later replaced, at the same Git reference, by a version pointing to a test server. After a one-time approval, the updated kit caused the proxy to deliver a dummy Anthropic key in cleartext to the test server when the next sandbox was created, with no new prompt shown to the developer. The approval even survived the sandbox's deletion. Kennedy ran the test on his own machine and set up the test server locally; he reported that no real-world attacks using this flaw have been observed so far.

Scope: affected versions, integrations, platforms, and scores

According to the official CVE record published by the vendor, the flaw affected every Docker Sandboxes release between 0.43.0 and 0.54.x on macOS, Windows and Linux. Docker fixed the flaw in version 0.55.0 yesterday. Thirteen built-in integrations share the key-injection path, including Anthropic, OpenAI, GitHub, and Google; Kennedy tested the Anthropic path with a dummy value.

Kennedy initially scored the issue 9.3 (Critical) but corrected the attack vector to local, producing a CVSS 3.1 base score of 8.2 (High). Under CVSS 4.0 he rated the flaw 6.9 (Medium); the vendor's 4.0 score was 5.6 (Medium). The two CVSS vectors differ on whether harm to the provider account behind a stolen key counts in the base score.

Immediate fixes, vendor response, and recommended remediation

Upgrading to Docker Sandboxes 0.55.0 removes the vulnerability. The release notes say kit credential injection now enforces the destinations approved for API keys and for OAuth separately, and treats a binding with no approved destinations as missing. Kennedy also asked Docker to tie approvals to a kit's content digest and to record every key injection in the policy log; the published notes confirm the destination enforcement but do not mention those two additional changes.

For machines still on older versions, and for anyone who granted credentials to third-party kits while vulnerable, Kennedy recommends the following steps:

  • Review the approvals file at ~/.config/sbx/credentials.yaml or %APPDATA%\\sbx\\credentials.yaml on Windows, and remove any binding granted to a third-party kit. The file records approvals, not key values, as the vendor's credential documentation explains.
  • Read a kit's inject domains and its permissions.network.allow entries on every sbx create, not only the first.
  • Where the kit source allows it, pin kits to a fixed commit, or keep a reviewed copy in a local folder.
  • Store keys per sandbox with the --sandbox flag instead of globally.
  • Rotate the provider keys behind any approved third-party kit that later changed.

Kennedy also reported a separate flaw to Docker on September 21 — a file-copy issue that allowed an agent to access host files outside its approved folders — which the vendor fixed on November 3. In both reports he said the virtual machine boundary held and that the failures were in what the developer's approval was attached to.

What this means for developers, security teams, and provider accounts

Developers: Any key stored with sbx secret set is global by default, so a redirected key is the one every sandbox on the machine uses. Developers who granted credentials to third-party kits while running vulnerable versions should review approvals and rotate provider keys where appropriate.

Security teams: The flaw shows a gap between user consent and the binding of that consent to immutable kit content; teams should enforce pinning, inspect kit inject domains and network allowlists on every sandbox creation, and consider per-sandbox key storage.

Provider accounts (Anthropic, OpenAI, GitHub, Google integrations): A stolen token grants whatever scopes it carries — for example, a typical GitHub developer token can permit repository write access — so account owners behind approved kits that later changed should rotate keys and audit account activity.

Docker's 0.55.0 release addresses the immediate enforcement gap; the broader tension Kennedy flagged remains a question of how tightly approvals are bound to a kit's inspected content and how transparently key injections are logged. As Kennedy summarized, an approval that is not tied to the artifact inspected becomes an inherited capability for whatever arrives next.

Original reporting: The Hacker News