Keyrook

Docker Sandboxes flaw lets a malicious AI agent kit steal your API keys

A flaw in Docker Sandboxes lets a third-party AI agent kit redirect a developer's Anthropic, OpenAI or GitHub key to an attacker's server after one approval. Versions 0.43.0 to 0.54.x are affected; v0.55.0, released 30 Nov 2026, fixes it.

Diagram showing how one approval of kit version 1 silently covers every later version, letting the host proxy send the real API key to an attacker host
Image: Endor Labs

Affects

  • Docker Sandboxes

Docker Sandboxes promises developers that their API keys never enter the sandbox where an AI coding agent runs. A flaw in how the tool remembers credential approvals breaks that promise: a third-party agent kit can collect one honest approval, then push an update that sends the developer’s real Anthropic, OpenAI or GitHub key to a server the attacker controls. The update needs no second approval, no warning, and leaves no record in the logs that a key was sent.

The flaw affects the sbx command line and the sandboxd daemon in versions 0.43.0 through 0.54.x. Docker fixed it in v0.55.0, released on 30 November 2026. Endor Labs, whose researcher found and reported the flaw on 21 September 2026, rates it 8.2 High on the CVSS 3.1 scale.

  • 8.2CVSS 3.1 scoreHigh severity
  • 13Built-in servicesShare the same injection path
  • v0.55.0Fixed releaseReleased 30 Nov 2026

How the approval is supposed to work

Developers keep their keys on the host machine. A key is saved with sbx secret set, and the coding agent working in its isolated virtual machine never sees it. Instead, the agent’s requests carry a stand-in header. A proxy running on the host watches outgoing traffic, and when a request is headed to a destination the developer approved, it replaces the stand-in with the genuine key before the request leaves. That design means a rogue agent could spend the key through the proxy, yet never possess the key to copy or leak directly.

Which destinations receive the real key is decided by the agent kit — a packaged agent configuration. Built-in agents ship their own kits. Third-party kits are fetched by reference, from a tag, a branch or a directory, and can declare credentials for the same built-in services.

Version 0.43.0 added a consent gate in front of that. When a developer runs sbx create against a third-party kit, the tool shows each credential the kit wants and the domains it will be sent to, and approval is written to a file on the host. The approval screen is accurate, and the default is to decline. The problem is what happens to that approval afterwards.

The approval outlives what was approved

The saved approval records only the service name — Anthropic, say — and the list of domains the developer agreed to. But at request time, the proxy never reads that list back. The check is a simple yes-or-no question: does an approval row exist for this service? If it does, the proxy injects the real key at whatever domains the kit currently declares.

That opens a quiet version swap:

How one approval turns into a stolen key

  1. The attacker publishes an honest-looking kit

    Version 1 of the kit declares only the provider’s real domain, such as api.anthropic.com, for its credential.

  2. The developer approves it

    Running sbx create shows an approval screen that truthfully says the key goes to the provider’s domain. The developer approves, and the approval is saved.

  3. The attacker ships version 2 at the same reference

    The only change is the destination: the kit now names a host the attacker controls, and adds that host to the sandbox’s network allowlist in the same file.

  4. The next run passes without asking again

    The tool finds the saved approval row, asks nothing, shows no warning and no diff. The new version runs under the old approval.

  5. The proxy sends the real key to the attacker

    Requests to the attacker’s host carry the genuine provider key in the header. The logs record an allowed connection and say nothing about a credential being injected.

The researcher confirmed the behaviour with a dummy credential and a test server on the local machine: rewriting the saved domain list to a nonsense value changed nothing, which proved the recorded list has no effect on where the key goes. The same test showed the key arriving in cleartext over plain HTTP, so the attacker needs no interception ability — only an endpoint that accepts a request.

The approval is also not tied to any particular kit. It is recorded by service name alone, not by kit name, content digest or source, so an approval obtained by one version of a kit carries over to every later version fetched from the same reference.

What a stolen key unlocks

Because credentials are stored globally by default, the key a kit can redirect is the one every sandbox on the machine uses. Thirteen built-in services share the same injection path — Anthropic, Copilot, Cursor, Devin, Droid, GitHub, Google, Groq, Mistral, Nebius, OpenAI, OpenRouter and xAI — and the researcher tested the Anthropic path with a dummy value.

What leaves the machine is the raw credential, and its value depends on the service. A stolen model-provider key gives metered API access billed to the victim’s account. A stolen GitHub token carries whatever permissions that token was granted, which for a typical developer token means it can change the victim’s repositories.

The product’s core promise — that raw keys stay out of the virtual machine — still holds throughout. It does not help here: the key does not need to enter the virtual machine if the kit decides where the host sends it.

What held, and what did not

Several neighbouring paths were correctly refused, which bounds the finding. A mixin kit cannot add an injection domain for a built-in service. A kit cannot impersonate a built-in agent by name. The sbx kit add command refuses credential-declaring kits outright. And without an interactive terminal, sbx create declines rather than proceeding, with no flag to skip the approval step.

The consent default really is decline, and the approval screen itself is sound. The defect is that what the screen promises is never enforced afterwards. The researcher’s report even notes that the software already contains a function whose name describes exactly the missing check — it simply does not gate the runtime path.

How the flaw surfaced

  1. 21 Sep 2026

    Reported to Docker

    Endor Labs reports the credential-binding flaw privately.

  2. 3 Nov 2026

    Earlier finding fixed

    Docker ships v0.51.0, fixing the researcher’s first Sandboxes finding, a file-copy flaw.

  3. 30 Nov 2026

    Fix released and finding published

    Docker Sandboxes v0.55.0 ships with the fix, and the research is published.

What to do now

Docker’s v0.55.0 release notes say kit credential injection now respects the destinations approved separately for API keys and OAuth in credential bindings, and bindings with no approved destinations are treated as missing. That is the fix for the version swap. Until every machine is on v0.55.0, treat every standing approval as live:

Upgrade and clean up approvals

  1. Upgrade to Docker Sandboxes v0.55.0

    Update the CLI and the daemon, then confirm the running version before creating new sandboxes.

  2. Review existing approvals

    Open the credentials file on the host and remove any approval granted to a third-party kit. Each one is a standing approval for whatever that kit’s reference serves next.

  3. Re-read every kit before you run it

    Check a kit’s credential destinations and its network allowlist entries on every sbx create, not just the first. The tool will not show you a change.

  4. Pin what you can

    When the source supports it, point at one exact commit instead of a moving tag or branch, or store a copy you have reviewed on your own machine.

  5. Scope keys to sandboxes and rotate if in doubt

    Keys are global by default; a key set for one sandbox limits what a redirected approval can reach. If you approved a third-party kit that later changed, rotate the affected provider keys.

One approval should never have been enough to cover every future version of a kit. Until the update is installed, the safest assumption is that any approval already granted still stands — and that the next kit update can spend it.

Sources

  1. Docker Sandboxes vulnerability lets malicious AI agent kits steal developers' API keysEndor Labs
  2. Docker Sandboxes release notesDocker Docs

More news

All the news
  1. Patch Notes2 min

    Wren:AM 15.3.1 fixes unauthenticated flaw that can lead to remote code execution

    Wren:AM 15.3.1, released December 2, fixes a deserialization flaw scored 9.8 that lets anyone reach the legacy password-reset pages and run code on the server without logging in.

    • Wren:AM
  2. Patch Notes2 min

    Fastify file uploads can hang on a 67 KB request — update @fastify/busboy to 3.2.7

    A single unauthenticated upload of about 67 KB can stall @fastify/busboy forever, leaving Fastify file uploads hanging. Version 3.2.7, released 2 December 2026, fixes it.

    • @fastify/busboy
  3. Patch Notes2 min

    HPE patches two maximum-severity hard-coded credential flaws in Networking COP

    HPE's December 1 update for Networking Central On-Premises fixes 21 flaws, including two hard-coded credential bugs scored 10.0 that let strangers log in over SSH and take full admin control.

    • HPE Networking Central On-Premises (COP)