Docker Sandboxes: You Approved the Kit. Your API Keys Went to a Stranger's Server.

Docker Sandboxes: You Approved the Kit. Your API Keys Went to a Stranger’s Server.

Docker Sandboxes promises one thing: your AI coding agent works inside an isolated virtual machine, and your API keys stay out of its reach. You store a key on your machine, the agent asks through a placeholder, and a proxy swaps in the real key only where you approved. But one kit update could send your real Anthropic, OpenAI, or GitHub key to a stranger’s server — no new prompt, no warning.

The flaw was found by Peyton Kennedy of Endor Labs, tracked as CVE-2026-136998, and fixed in version 0.55.0. Kennedy proved it with a dummy key and a test server; no attacks have been reported. An attacker needs little: no access to your computer, no exploit against the virtual machine — just one approval and one changed line in the kit’s next version.

How the keys were supposed to stay put

A developer stores a key with sbx secret set. The agent never sees it: it sends requests with a placeholder header, and a proxy swaps in the real key before it leaves. The kit — a packaged agent configuration from a registry, a Git reference, or a local folder — decides which destinations get the real key.

Since 0.43.0, released September 15, 2026, approving a kit’s credential request writes a binding — a record of the service and domains agreed to. But the recorded list was never read back: the check only asked whether a binding existed for the service name, never which domains were in it, and the proxy sent the real key to whatever domains the current kit version named. As Kennedy put it: “The domains the operator approved play no part in that decision.” We have seen an extension that whispered instructions Claude then ran; the danger here was the approval itself.

Four ways one approval lets API keys leave the machine: a kit update swaps the target, the approval survives deletion, the allowlist grows silently, and keys are global by default.
One approval, four open doors. The binding recorded the destinations the developer agreed to — and the proxy never checked them.

The test that proved it

Kennedy approved a kit whose only destination was api.anthropic.com, then replaced it at the same reference with a version pointing at his test server. The next sandbox creation showed no prompt, and the proxy delivered the dummy key there in cleartext. The approval survived the sandbox’s deletion.

Nothing warned the developer: the policy log recorded the connection as allowed, silent about the key injection. A kit version could also add its own server to the network allowlist without a prompt. The prompt still defaults to decline, and a kit cannot impersonate a built-in agent. But the one check that mattered was never performed.

Why it matters more than the score suggests

Kennedy rates it 8.2 High under CVSS 3.1; under CVSS 4.0, his 6.9 against the vendor’s 5.6, both Medium. He first scored it 9.3 Critical, then corrected the vector to local: the kit is a file the developer fetches, not a service an attacker reaches over the network. The blast radius is set by something the scores cannot see: secrets stored with sbx secret set are global by default, so one redirected key serves every sandbox.

Thirteen built-in integrations share the key-injection path, including Anthropic, OpenAI, GitHub, and Google; Kennedy tested Anthropic. A stolen GitHub token grants its scopes — typically write access to its owner’s repositories. The virtual machine never breaks; the escape needs no breakout, and we have seen what happens when an agent that escaped its bounds turns into a real breach. Cloud sandboxes keep a separate secret store, and whether they shared the logic is unestablished.

The fix, and what it does not do

Upgrading to 0.55.0 removes the flaw: credential injection now enforces the destinations approved for API keys and for OAuth separately, and a binding with no approved destinations counts as missing.

Kennedy also asked Docker for two more changes: tie approvals to a kit’s content digest, and log every key injection. The published notes confirm the destination enforcement and mention neither. Until approvals are bound to the exact kit inspected, re-check the kit every time, not just the first time.

Kennedy’s second bug in the product within a month; both were reported on September 21. The earlier one, a file-copy flaw that let an agent reach host files outside its approved folders, was fixed on November 3. In both, the virtual machine held; the failure sat in what the approval was attached to.

Version 0.55.0 enforces the destinations approved for API keys and OAuth separately, and treats an empty approval as missing. Five checks: review the approvals file, read every kit's destinations, pin kits, scope keys per sandbox, and rotate exposed keys.
Version 0.55.0 closes the hole. The five checks below are for every machine still on an older version — and for anyone who ever approved a third-party kit.

Five checks for your machine

Do these in order — the researcher’s recommendations for older versions, and for anyone who approved a third-party kit while vulnerable.

  1. Review the approvals file. Open ~/.config/sbx/credentials.yaml — %APPDATA%\sbx\credentials.yaml on Windows — and remove any binding granted to a third-party kit. The file records approvals, not key values.
  2. Read the kit’s destinations on every create. Check inject domains and permissions.network.allow entries on every sbx create — an update can change them without asking.
  3. Pin the kit. Pin kits to a fixed commit where the source allows it, or keep a reviewed copy in a local folder.
  4. Scope keys per sandbox. Store keys per sandbox with the --sandbox flag instead of globally.
  5. Rotate what was exposed. Rotate the provider keys behind any approved third-party kit that later changed.

Then upgrade to 0.55.0. Kennedy’s closing line is the one to keep: “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.” You approved a kit — make sure it is still that kit.

Comments

This site uses Akismet to reduce spam. Learn how your comment data is processed.