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)
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')
- 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.
- Upgrade every AgentENV node to 0.2.4 or later and restart the server, so the new host and sandbox firewall rules are installed.
- 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.
- Set
API_ADDRto a specific trusted address instead of the default0.0.0.0:8000, so the control API and proxy do not listen on every host interface. This is still the default onmain. - Until you can upgrade, add host
INPUTrules that reject new connections from the sandbox address ranges (host_interaction_cidrandveth_cidr, by default10.11.0.0/16and10.12.0.0/16) to the API and metrics ports. - Only pull
userImagefrom 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.mdrecommends, 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
mainatf41abb2(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.
- The static egress chain adds an all-ports ACCEPT for the gateway and DNS addresses before the internal-network REJECT rules: src/sandbox/network/policy.rs#L168-L198
- The code's own intent: gateway and DNS exceptions go before the rejects of the full internal pools: src/sandbox/network/address_plan.rs#L71-L80
- The gateway address is the host side of the veth pair and is the guest's default route: src/sandbox/network/slot.rs#L58, slot.rs#L414-L418
- Host firewall rules only touched
FORWARDandnat/POSTROUTING, with noINPUTrules for sandbox traffic: src/sandbox/network/manager.rs#L564-L588 - The guest DNS server is read from the host's resolver config and private addresses are accepted: src/sandbox/network/slot.rs#L873-L918
- The API listens on
0.0.0.0:8000by default: src/bin/server.rs#L71, and the sandbox proxy is merged into the same router: src/api/server.rs#L28 - The OCI layer path is built from the manifest's digest with no checks: src/image/oci_image.rs#L1289-L1295
- That path is returned as the layer blob once a file of the manifest's size exists there: src/image/oci_image.rs#L512-L525, oci_image.rs#L677-L685
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
INPUTrules 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
maintoday.
Detection (for defenders)
- Inside a sandbox network namespace, list the
AGENTENV-EGRESSchain. 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
INPUTchain 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
- Reported privately via GitHub PVR (GHSA-hw7r-gmc9-84jv), with suggested fixes.
- Maintainers merge #186 (firewall fix for findings 1 and 2).
- AgentENV 0.1.3 released with the firewall fix.
- Maintainer lands the OCI layer path fix for finding 3 on
main. - AgentENV 0.2.4 released with the OCI path fix.
- 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
- Fix PR (merged 2026-08-19): kvcache-ai/AgentENV#186
- Fix commits (OCI path, 2026-10-14): d243f6e, 87c1df3
- Fixed releases: AgentENV 0.1.3 (findings 1 and 2), AgentENV 0.2.4 (finding 3)
- GitHub advisory: GHSA-hw7r-gmc9-84jv
- CVE: not assigned yet; requested from the maintainer
- Affected repository: kvcache-ai/AgentENV