You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
deploy/vm: sandboxes can reach cloud instance metadata (169.254.169.254) #357
On deploy/vm, sandbox containers can reach cloud instance metadata at 169.254.169.254.
MI1 R8's nftables table (deploy/vm/setup-vm.sh, install_sandbox_firewall) filters only the input hook: traffic addressed to the host itself. Metadata traffic is forwarded through the host, and the forward path is deliberately untouched in S1, because outbound egress is S5's (moca-egress) work. setup-vm.test.sh even asserts that no hook forward chain exists.
On an EC2 host with IMDSv1 enabled, or IMDSv2 with a hop limit of 2 or more, model code in a sandbox can therefore read the instance role's credentials. Those belong to the host, not to any session or user. Other clouds' metadata services are exposed the same way.
Current mitigation (documented, not enforced)
deploy/vm/README.md now says to close this at the platform:
With a hop limit of 1, a forwarded container request cannot obtain an IMDSv2 token.
Proposed fix
Add a forward-hook chain to the moca_sandbox table that drops link-local destinations arriving from the sandbox bridge:
chain forward {
type filter hook forward priority filter; policy accept;
iifname "moca-sandbox0" ip daddr 169.254.0.0/16 counter drop
iifname "moca-sandbox0" ip6 daddr fd00:ec2::254 counter drop
}
Update setup-vm.test.sh's "no forward hook" assertion to "the forward hook drops only link-local metadata".
It was not done in #350 because that firewall was verified live on the rig, and a table that fails to load keeps every sandbox down, since the unit is fail-closed through RequiredBy=. So this change needs its own live run: metadata unreachable from a sandbox, outbound internet still working, and the relay attach port still working. If S5's moca-egress lands first and covers this, close this issue in its favour.
Context
Found in the self-review of #350 (MI1 S1). It is recorded as deferred in docs/specs/2026-09-28-moca-multi-user-isolation-design.md §13 ("Blocking cloud instance metadata from sandboxes"). Related to the microVM tier's egress work in #277.
Activity
fix(vm): drop link-local metadata in the sandbox forward path