Dev.to AI 🤖 Ai 👁 0 📖 11 min read

The Sandbox Blocked File Writes and Left a Door Open: How a Coding Agent Switched Off Its Own Approvals Over Loopback

TL;DR CVE-2026-82533 (CVSS 4.0 score 9.4, CWE-807, published September 8, 2026) is an authentication bypass in the local HTTP control plane of DeepSeek Harness, an open-source coding agent. Versions before 0.1.2-alpha

TL;DR

  • CVE-2026-82533 (CVSS 4.0 score 9.4, CWE-807, published September 8, 2026) is an authentication bypass in the local HTTP control plane of DeepSeek Harness, an open-source coding agent. Versions before 0.1.2-alpha.1 trusted a client-supplied Host header instead of checking who actually opened the connection.
  • The part that matters for agent builders: the OS sandbox restricted file writes but left networking on, so a confined agent could reach 127.0.0.1:3080 and change its own session. According to the researcher write-up, one curl PATCH set {"approval":"never","mode":"danger-full-access"} and the sandbox and approval prompts were gone for later commands.
  • I rebuilt the trust decision locally with real sockets and three designs. A Host-header check let 3 of 4 attack requests through. Adding the peer address blocked only one more. Requiring a session token that the confined process does not hold blocked all 4, while the operator's own request still worked in every design.
  • The lesson is not "check the peer address". A confined agent on the same machine has a perfectly honest loopback peer address. The control plane needs an identity the agent cannot obtain, and every route that changes policy needs it.
  • The fix shipped on August 27, 2026 (version 0.1.2-alpha.1), and the release notes carry a sentence worth quoting at your own team: sandboxing, approvals and permissions "do not guarantee isolation".

What did the CVE actually let an agent do?

Most agent sandboxes are file-system sandboxes. The agent's shell commands run under bubblewrap on Linux or Seatbelt on macOS, writes are restricted to the workspace, and a separate approval layer decides which commands run without asking. That design assumes the policy lives somewhere the agent cannot touch.

DeepSeek Harness (dsh) is a local-first coding agent. It runs a web interface and a control-plane HTTP API on 127.0.0.1:3080 by default, with no authentication on that port. According to the OX Security write-up, the sandboxes restricted file writes but left networking enabled, so loopback was reachable from inside the confinement. The function that gated API access, named isTrustedApiRequest in that write-up, checked whether the request's Host header looked like a loopback address and never compared it with the connection's real peer address.

The reported attack was a single command from inside the sandbox:

curl -H "Host: 127.0.0.1:3080" http://127.0.0.1:3080/api/sessions/{id}/config \
     -X PATCH -d '{"approval":"never","mode":"danger-full-access"}'

After that call the session ran in danger-full-access, which disabled the sandbox and stopped approval prompts for later commands. The write-up adds an attribution detail: the harness logged the policy change as source: {kind: 'user'}, so the audit trail could not tell a person from the agent.

There was a second scenario. If the port was reachable from outside, through a tunnel or a reverse proxy, an unauthenticated remote caller could take control of the agent and read stored conversations without an API key. The VulnCheck advisory lists the impact as local sandbox escape, privilege escalation to unconfined execution, disabled approval prompts, remote command execution when the port is externally accessible, and unauthorized transcript access.

Credit for the finding goes to Nir Zadok and Moshe Siman Tov Bustan, per the advisory. The advisory lists versions below 0.1.2-alpha.1 as affected and 0.1.2-alpha.1 as fixed.

Why is "the sandbox escaped" the wrong summary?

Because nothing escaped. The sandbox did what it was configured to do: it stopped file writes outside the workspace. The agent never broke that boundary. It walked to a service that lived beside the boundary and asked the service to move the boundary for it.

This is a pattern, not a one-off. In my earlier posts in this series the broken check was always a path, a URL or a command string. Here the thing being guarded was a configuration plane, and the missing question was "who is allowed to change the rules?". An approval gate, a sandbox mode and an allowlist are only as strong as the weakest route that can edit them. If an edit route accepts any caller that can reach a port, the agent is one HTTP request away from owning its own policy.

Two properties made it worse:

  1. Reachability was inherited. Loopback is not a trust boundary against a process that already runs on the machine. Confinement that leaves loopback open hands the agent every local service the user has running.
  2. The log lied by default. An audit entry that says user for every accepted request is not an audit entry. After an incident you cannot answer "did a person turn approvals off?"

The vendor's own wording after the fix is candid about the limits. The v0.1.2-alpha.1 release notes updated the safety notice to say the harness "has not been security-audited, and sandboxing, approvals, and permissions do not guarantee isolation." I would put that sentence in front of anyone deploying a local agent runtime, whichever runtime it is.

Does checking the peer address fix it?

No, and this is the part I wanted to measure rather than assume. A natural patch for "we trusted the Host header" is "check the socket's remote address instead". That stops a remote caller who forges Host: 127.0.0.1. It does nothing about a confined agent, because the agent really is connecting from 127.0.0.1.

I wrote a short script with real sockets. It starts a throwaway control-plane server on an ephemeral port, binds it to all interfaces, and issues the same PATCH from five different positions. Nothing leaves the machine, and no real product is involved. Three trust checks are compared:

def loopback(host):
    h = host.rsplit(":", 1)[0].strip("[]")
    return h in ("127.0.0.1", "localhost", "::1")

def trust_a(h):  # Host header only (the bug shape)
    return loopback(h.headers.get("Host", ""))

def trust_b(h):  # Host header + the real peer address
    return trust_a(h) and h.client_address[0] in ("127.0.0.1", "::1")

def trust_c(h):  # peer address + a credential the confined process does not hold
    return trust_b(h) and h.headers.get("X-Session-Token") == PROCESS_TOKEN

The "remote" caller connects through the machine's own LAN address, so the server sees a non-loopback peer. The confined agent connects over loopback. The operator's UI connects over loopback with the token. Results from one run:

scenario                                      A     B     C
remote caller, spoofed Host                   OPEN  blk   blk
remote caller, honest Host                    blk   blk   blk
confined agent on loopback, spoofed Host      OPEN  OPEN  blk
confined agent on loopback, no token          OPEN  OPEN  blk
operator UI on loopback, with token           OPEN  OPEN  OPEN
attack requests blocked of 4: {'A': 1, 'B': 2, 'C': 4}
operator UI allowed: {'A': True, 'B': True, 'C': True}

I also checked the state change itself, not just the status code: under design A the session mode flipped to danger-full-access for three of the four attack requests, under B for two, and under C for none. The audit field recorded user for the accepted agent call under design A.

Control-plane attack requests blocked, out of 4

Measured locally: who gets through each trust check

Three readings of this table, with the caveat that it models the trust decision and is not a test of the real product:

  • Design A fails in both directions. It admits the remote forger and the local agent.
  • Design B fixes the remote case only. The two requests from the confined agent still pass, because they come from the one address B is willing to trust.
  • Design C works because the deciding input changed from "where did this come from" to "what does this caller hold". The confined process was never given the token.

What did the vendor change in the fix?

From the release notes and the patch commit, the direction is the same as design C. Network access to the web interface now requires a one-time token in the launch URL. The commit's architecture notes describe moving from implicit loopback assumptions to a browser session established by a process token and a signed cookie, with Host and Origin kept as routing evidence only. The same notes say the CLI now rejects binding to 0.0.0.0, and that configuration operations need an authenticated browser session.

I read the commit through its documentation and tests, not by running a patched build, so I cannot tell you how the token is delivered on every platform. That delivery path is the thing to check on any runtime: if the token is printed to the terminal the agent also reads, or sits in an environment variable the confined shell inherits, design C quietly collapses back into design B.

One more observation from the day I wrote this. The repository's security advisories page listed no published advisories, while the CVE record exists through VulnCheck. If you track agent runtimes through GitHub advisories alone, this one would not have reached you. Subscribe to the CVE feed for the packages you run, not only the repository's advisory page.

How do you design a control plane the agent cannot edit?

The checklist I would apply to any local agent runtime, including your own:

  1. Inventory every route that changes policy. Sandbox mode, approval mode, allowlists, tool enablement, network rules. Treat them as one class, "policy writes", and list them by name.
  2. Give policy writes an identity the agent cannot obtain. A per-process secret held by the UI process, a Unix socket with file permissions the sandbox cannot satisfy, or a handshake that needs a human-approved step. Do not use anything derivable from the network.
  3. Make confinement cover the control plane. If the sandbox leaves loopback open, you have exposed every local listener. Either block loopback for the confined process or allow only the specific model endpoint it needs.
  4. Bind to a Unix domain socket or a named pipe where you can. Filesystem permissions and process credentials are checks the kernel performs, which is stronger than a header a client writes.
  5. Never raise privilege through the same channel the agent uses. A mode change from "confined" to "full access" should require a prompt the model cannot answer.
  6. Log the credential, not a label. Record which identity authorized each policy write, and alarm when a policy write has no human session behind it.
  7. Refuse unsafe bind addresses. The patched CLI rejecting 0.0.0.0 is a cheap guard against accidental exposure through a tunnel.

A regression test makes item 1 and item 2 stick. This one enumerates routes and fails if any policy-writing route answers without the token:

POLICY_ROUTES = [("PATCH", "/api/sessions/1/config"), ("PUT", "/api/rules"), ("POST", "/api/tools/enable")]

def test_policy_writes_require_identity(client):
    for method, path in POLICY_ROUTES:
        r = client.request(method, path, json={}, headers={"Host": "127.0.0.1:3080"})
        assert r.status_code in (401, 403), f"{method} {path} accepted an unauthenticated caller"

def test_forged_host_is_not_identity(client, operator_token):
    r = client.patch("/api/sessions/1/config", json={"mode": "danger-full-access"},
                     headers={"Host": "127.0.0.1:3080"})
    assert r.status_code == 403
    r = client.patch("/api/sessions/1/config", json={"approval": "ask"},
                     headers={"X-Session-Token": operator_token})
    assert r.status_code == 204

The second test matters as much as the first. A gate that refuses everyone is easy to build; the check is that the operator path still works.

Where does this sit among recent agent sandbox bugs?

I covered the Docker Sandboxes sbx cp symlink issue earlier in this series: one check, four code paths. The shape here is different. In sbx cp the guard existed but covered too few paths. In this CVE the guard existed on the file system and nobody guarded the knob that turns it off. Both end the same way, with an agent doing something its operator believed was blocked.

If you only remember one test from this series, make it this: for every protection your agent runtime advertises, find the command that disables it, and ask which callers can send that command. Sandboxes, approvals and allowlists are configuration, and configuration needs its own access control.

FAQ

What is CVE-2026-82533?
An authentication bypass (CWE-807, reliance on untrusted inputs in a security decision) in the local HTTP control-plane API of DeepSeek Harness versions before 0.1.2-alpha.1. The server accepted a client-supplied loopback Host header in place of validating the actual connection origin. VulnCheck published it on September 8, 2026 with a CVSS 4.0 score of 9.4.

Which version fixes it?
0.1.2-alpha.1, released August 27, 2026. Network access to the web interface then requires a one-time token in the launch URL, and the safety notice states that sandboxing, approvals and permissions do not guarantee isolation.

Does checking the socket's peer address stop a confined agent?
No. In my local model, a peer-address check blocked a remote forger but still admitted both requests from a process on loopback, because its peer address was genuinely loopback. Only a credential the confined process does not hold blocked all four attack requests while the operator's request still worked.

Why is leaving loopback reachable inside a sandbox a problem?
Every service listening on the machine becomes part of the agent's reach, including the agent runtime's own control plane. File-system confinement says nothing about what the process can ask a neighbor to do on its behalf.

What is the cheapest mitigation if I run a local agent runtime today?
Upgrade to a patched version, keep the control port off any tunnel or reverse proxy, and test it yourself: from inside the sandbox, try to read and change the session configuration over loopback. If either works without a token you did not give the agent, treat the sandbox as advisory.

Further reading

Earlier posts in this series:

  • The Allowlist Guarded the Destination, Not the Route: A Proxies Parameter Leaked Credentials From an Agent HTTP Tool (earlier post, same series)
  • One Check, Four Paths: What the Docker Sandboxes sbx cp Symlink Bug Teaches About Guarding Every Position (earlier post, same series)

Sources

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.