Security

AgentENV: sandbox guest reaches the host control plane

AgentENV - sandbox guest can reach the host control plane: unrestricted gateway ACCEPT precedes the internal-network REJECT rules, plus OCI layer blob path traversal (GHSA-hw7r-gmc9-84jv)

PUBLISHED SEVERITY CRITICALSTATUS PatchedGHSA-hw7r-gmc9-84jv
Patched

The firewall issues are fixed in AgentENV 0.1.3 (2026-08-20) by #186. The OCI layer path issue is fixed in 0.2.4 (2026-10-23). Use 0.2.4 or later. Track the fix at kvcache-ai/AgentENV#186.

Product
AgentENV (Firecracker sandbox server: network policy, OCI image import) in kvcache-ai/AgentENV
Affected versions
AgentENV before 0.1.3 for the firewall issues (findings 1 and 2), and before 0.2.4 for the OCI path issue (finding 3). Reviewed at f41abb2 (main, 2026-07-30). Fully fixed in 0.2.4 (2026-10-23).
Severity
CRITICAL
Status
Patched
Weaknesses
  • CWE-923Improper Restriction of Communication Channel to Intended Endpoints
  • CWE-693Protection Mechanism Failure
  • CWE-22Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
As filed on the advisory, for the three findings covered here.
GitHub advisory
GHSA-hw7r-gmc9-84jv
Published by the maintainer on 2026-11-16
CVE
Pending (requested from the maintainer 2026-11-16)
Published
Credit
Finder: Aaron Elijah Mars of Aeon. Tool: Aeon (https://www.aeon.fun).

What users should do now

Upgrade to AgentENV 0.2.4 or later (the latest release is 0.2.5). 0.1.3 already fixes the firewall issues, but the OCI layer path fix first shipped in 0.2.4.

  1. Upgrade every AgentENV node to 0.2.4 or later and restart the server, so the new host and sandbox firewall rules are installed.
  2. If untrusted code ran in sandboxes on an older version, treat the node as possibly compromised: other tenants' sandboxes could have been listed, forked, paused, deleted or reached through the proxy. Check host firewall or connection logs for connections from sandbox addresses to the API port.
  3. Set API_ADDR to a specific trusted address instead of the default 0.0.0.0:8000, so the control API and proxy do not listen on every host interface. This is still the default on main.
  4. Until you can upgrade, add host INPUT rules that reject new connections from the sandbox address ranges (host_interaction_cidr and veth_cidr, by default 10.11.0.0/16 and 10.12.0.0/16) to the API and metrics ports.
  5. Only pull userImage from registries you trust until you run 0.2.4 or later.

Summary

AgentENV gives each sandbox an egress firewall chain. Before 0.1.3 that chain first allowed all traffic, on any protocol and port, to the sandbox's gateway address and to the host's DNS server. Only after that came the rules meant to reject AgentENV's internal networks. iptables uses the first rule that matches, so the early allow won. The gateway address is the host itself, and the host had no INPUT rules for sandbox traffic, so code inside a microVM could connect to any host service listening on 0.0.0.0. That includes the AgentENV control API and its sandbox proxy, which share one port (0.0.0.0:8000 by default).

The advisory also covers a second, separate issue: the OCI image import built a layer's file path from the digest string in the registry's manifest without checking it, so a hostile registry could point a layer at any path on the host.

Affected versions

  • Findings 1 and 2 (firewall): AgentENV 0.1.2 and earlier. Fixed in 0.1.3 (2026-08-20). This holds even with internet access turned off for the sandbox, and on nodes set up as SECURITY.md recommends, because the traffic starts inside the microVM.
  • Finding 3 (OCI layer path): AgentENV 0.2.3 and earlier. Fixed in 0.2.4 (2026-10-23).
  • Reviewed on main at f41abb2 (2026-07-30).

The published advisory lists 0.1.3 as the patched version. That is correct for the firewall issues, but the OCI path fix landed later and first shipped in 0.2.4.

Impact

Finding 1 (Critical): sandbox to host control plane. From inside any sandbox, untrusted code could reach the AgentENV API on the host through its default gateway and act on every other sandbox on the node:

  • List every sandbox on the node, with IDs, plus snapshots, templates and nodes.
  • Fork another tenant's running sandbox. The copy inherits its memory and filesystem and can then be read.
  • Pause or delete other tenants' sandboxes.
  • Reach services inside another tenant's sandbox, including envd, through the sandbox proxy on the same port.

This breaks the isolation between sandboxes that AgentENV exists to provide. It needs no special settings: a fully locked-down sandbox was just as exposed.

Finding 2 (High when the DNS server is private): host resolver. The DNS server address is read from the host's resolv.conf. In a company network or cloud VPC this is usually an internal host. The same early allow rule let sandbox code reach any port on that host (SSH, HTTP and so on), not just DNS.

Finding 3 (High): registry-controlled host path. A registry serving a sandbox's userImage could set a layer digest that turns into any path on the host. This gave the registry a way to test whether a host file exists and has a given size, and could put the contents of an archive-shaped host file into the guest's root filesystem. Since userImage is set by the caller, a tenant could aim this at a registry they control.

A fourth finding in the advisory is tracked separately and not covered here. A working exploit is withheld.

Affected code

Permalinks at f41abb2, the commit reviewed before the fixes.

Fix

  • #186 (commit 6e88ae2, merged 2026-08-19, by the maintainers) removes the all-ports ACCEPT for the gateway. The sandbox chain now allows only replies to host-started connections and DNS on TCP and UDP port 53 before the internal-network rejects. It also adds host INPUT rules that reject new connections from sandbox interfaces. Shipped in 0.1.3.
  • Commits d243f6e and 87c1df3 (landed by the maintainer on 2026-10-14) make the OCI layer path check the digest: the algorithm must be a known token, the hex part must be only hex digits, and the final path must stay inside the blob store. Shipped in 0.2.4.
  • Both fixes are still in place on main today.

Detection (for defenders)

  • Inside a sandbox network namespace, list the AGENTENV-EGRESS chain. On an affected version it starts with an ACCEPT for the gateway address that has no protocol or port. On a fixed version the only ACCEPT rules before the REJECTs are for replies and DNS port 53.
  • On the host, check that the INPUT chain rejects new connections from the AgentENV veth interfaces.
  • In host firewall or connection logs, look for connections to the AgentENV API port whose source address is in the sandbox ranges. Normal API clients do not come from there.
  • For the OCI issue, look for image imports that failed with a malformed or unusual layer digest, or manifests whose layer digests contain / or ... On 0.2.4 and later these fail with an error that the digest is unsafe.

Timeline

  1. Reported privately via GitHub PVR (GHSA-hw7r-gmc9-84jv), with suggested fixes.
  2. Maintainers merge #186 (firewall fix for findings 1 and 2).
  3. AgentENV 0.1.3 released with the firewall fix.
  4. Maintainer lands the OCI layer path fix for finding 3 on main.
  5. AgentENV 0.2.4 released with the OCI path fix.
  6. Maintainer publishes GHSA-hw7r-gmc9-84jv as Critical; we ask the maintainer to request a CVE ID. Public write-up.

Credit

Finder: Aaron Elijah Mars of Aeon. Tool: Aeon.

Firewall fix in #186 by LSX-s-Software.

References