I run coding agents inside throwaway VMs for the obvious reason: I want the agent to have a working shell without handing it my laptop. The pitch is clean. The agent gets a box, the box gets a network policy, and your API keys stay on the host where the agent cannot read them.
Docker Sandboxes is built on that pitch, and this week it turned out the key never had to enter the box to leave it. Docker published CVE-2026-136998 on December 1, Endor Labs described the bug the same day, and the fix had already shipped in 0.55.0 on November 30. The consent prompt was accurate, the default was safe, and neither fact protected anybody.
🔑 The Promise, in Detail
Raw keys never enter the sandbox. You store one on the host with sbx secret set. The agent inside the microVM sends requests with a placeholder header like x-api-key: proxy-managed, and a proxy on the host swaps in the real key on the way out for approved destinations. A compromised agent can spend the key through the proxy, but it never holds it.
Which destinations get the real key is decided by the kit, a packaged agent configuration fetched from a registry, a Git reference, or a local folder. Its inject block names, per service, the domains where the proxy should substitute the credential. Built-in agents ship their own kits; third-party kits declare credentials for the same services.
Version 0.43.0, published September 15, put a consent gate in front of that. Its release notes say credential-binding consent “now defaults to decline and clearly identifies when API-key secrets will be sent to new domains.” On a TTY, sbx create shows each credential and its domains. Approving writes a binding to ~/.config/sbx/credentials.yaml, or %APPDATA%\sbx\credentials.yaml on Windows:
anthropic:
apiKey:
domains:
- api.anthropic.com
That prompt is honest. The default is the safe one. And the list it wrote down was never consulted again.
📝 The Note Nobody Read
At request time, the gate was a boolean keyed on the service name. If credentials.yaml had a row for anthropic, the proxy injected the real key at whatever domains the current kit declared. The domains you approved played no part in that decision.
The binding also said nothing about which kit it was granted to. It was not keyed by kit name, content digest, or source. An approval obtained by one version transferred to every later version fetched from the same reference. Endor’s researcher, Peyton Kennedy, demonstrated that version swap, not the cross-kit case.
Put together, that is an attack you cannot see:
- The attacker publishes kit v1, whose inject block names only
api.anthropic.com. - You run
sbx create, read a prompt that accurately says the key goes there, and approve. - The attacker ships v2 at the same tag, branch, or directory, changing only the inject domain to a host they control.
- Your next
sbx createfinds a row foranthropicand passes. No prompt, no warning, no diff. - The proxy substitutes the real key into requests to the attacker’s host.
The kit also opens its own exit. Its permissions.network.allow entries are applied without a prompt, so v2 can add the attacker’s host to the sandbox’s egress allowlist in the same file that redirects the key.
One detail makes the root cause easy to believe. The binary already contains a function called sandboxlib/bindingconsent.MissingDomainsForService. The name describes precisely the check that was missing, and it does not appear to gate the runtime path.
🧪 Four Bytes of Proof
The reproduction is small. Kennedy stored a dummy Anthropic key scoped to one sandbox, so no real credential was involved, and pointed two kits at a canary HTTP server on loopback using localtest.me, which resolves to 127.0.0.1 without an /etc/hosts edit. Kit A’s inject list names api.anthropic.com. Kit B is identical except that its list names canary.localtest.me.
He approved kit A, tore the sandbox down with sbx rm --force, and created a new sandbox from kit B. No prompt appeared. The sandbox sent the placeholder, the host proxy swapped in the real value, and the canary logged X-Api-Key: sk-ant-FAKE-CANARY-deadbeef in cleartext over plain HTTP. No TLS interception, no network position, just an endpoint willing to accept a request.
Then he did the check that closes the argument. He rewrote the binding’s domains to example.invalid, unrelated to either kit, and the leak was identical. The recorded list had no effect on where the key went.
What you would see afterward is nothing. sbx policy log recorded the connection to the canary host as allowed and said nothing about a credential being injected into it. The approval survived deleting the sandbox, and to anyone reading logs later it looks like an ordinary permitted request.
Kennedy tested Anthropic with a dummy value. The other twelve services share the code path and were not demonstrated individually, which he says plainly. The full set spans thirteen providers, including OpenAI, GitHub, Google, Cursor, and xAI.
📦 A Kit Is a Package Now
The exploitation shape is an ordinary supply-chain update. The attacker compromises nothing. They publish a plausible kit, wait for one approval under a prompt that is truthful at the time, then change the destination. Nothing asks again. Nothing records that the answer changed.
Two defaults make it worse. sbx secret set stores secrets globally unless you pass --sandbox, and Docker’s documentation says so: “Service secrets are global by default, so the secret is available to all sandboxes.” The key a kit redirects is the key every sandbox on the machine uses.
The other is what a GitHub token means. A stolen provider key is billed usage, annoying but recoverable. A stolen GitHub token carries whatever scopes you granted it, and for a typical developer token that includes write access to repositories. The damage follows the key.
We have a decade of scar tissue for this pattern with npm, pip, and dependency confusion. The new part is that agent configuration is a package too, declaring where your credentials go. If you would not npm install a tag without a lockfile, apply the same instinct to a kit.
⚖️ Three Scores and a Scope Argument
Docker’s own CVE record scores it 5.6, Medium, under CVSS 4.0. Kennedy scored it 8.2 High under CVSS 3.1 and 6.9 Medium under CVSS 4.0. He first had it at 9.3 Critical and corrected the vector to local before submitting: the malicious kit is a file the developer fetches, not a service an attacker reaches over the network. The two 4.0 vectors differ on whether provider-side harm counts in the base score.
NVD’s record is still Awaiting Analysis, so there is no independent NVD score. CISA’s ADP enrichment says exploitation: none, automatable: no, technical impact: partial. No attacks have been reported, which is not the same as nobody having tried, but it does mean this is a design problem rather than an incident to respond to.
Scope, plainly. This affects the local product on macOS, Linux, and Windows, versions 0.43.0 through 0.54.x, fixed in 0.55.0, and it requires that you approved a third-party kit. If you only run the built-in agents, which ship their own kits, you were not exposed this way. The research covered local sandboxes; cloud sandboxes keep a separate secret store, and it has not been established whether they shared the affected authorization logic.
🛠️ What to Actually Do
Upgrade to 0.55.0 or later. Its release notes say credential injection “now enforces the approved destinations for API keys and OAuth tokens,” and that bindings with no approved destinations are treated as missing. The same release requires HTTPS for external endpoints that receive a host-managed credential, which independently kills the cleartext variant.
For older versions, and for anyone who granted credentials to a third-party kit while vulnerable:
- Open
~/.config/sbx/credentials.yamland remove any binding you granted to a third-party kit. Each one is a standing approval for whatever that reference serves next. - Read a kit’s inject domains and
permissions.network.allowentries on everysbx create, not only the first. - Pin kits to a fixed commit, or keep a reviewed copy in a directory you control.
- Store keys per sandbox with
--sandboxinstead of globally. - Rotate the keys behind any approved kit that later changed, and check provider usage and GitHub audit activity.
Kennedy also asked Docker to bind approvals to a kit’s content digest and to log every credential injection next to the destination it already logs. The published notes confirm the destination enforcement and do not mention those two changes. The version swap is closed for patched machines. The audit gap is not.
🧠 Final Thoughts
The isolation primitive held. The microVM boundary never broke, and the raw key never entered the guest. The failure sat in what the operator’s decision was attached to: you approved a destination, and the product remembered a service name.
That is the same shape as Kennedy’s earlier finding here, CVE-2026-103916, where sbx cp approved a path that then resolved somewhere else. Two bugs in one product in a month is not enough to generalize about sandboxing. It is enough to state a rule: a consent prompt is a data structure, and it is only as strong as the check that reads it back.
So read the file your prompt wrote. If nothing reads it back at request time, you did not give consent. You clicked.
Thanks for reading.