Process container: DNS lookups still work in proxy mode
Relevant area(s)
Windows
Brief description of your issue
In the Windows process container backend with proxy mode (runtimeConfig.networkProxy) and egress default deny,
connections are correctly restricted to the proxy. However, DNS name resolution still succeeds from inside the
sandbox. Resolution is done by the host's DNS Client service outside the sandbox, so queries leave the PC over the
host's normal network path. docs/networking.md does not mention name resolution.
Possible impact: a prompt-injected agent in a proxy-mode sandbox could encode data it can read into a hostname under
an attacker-controlled domain (e.g. <data>.attacker.example); the attacker's authoritative DNS server receives it in
the query. We verified only that lookups succeed; we did not demonstrate a full exfiltration (the example.com answer
may have come from the host cache). A never-used name such as secret-1234.test.invalid against a logging resolver
would confirm it.
Related: #936 (Bubblewrap proxy-only egress did not restrict a non-IP socket family).
Versions: MXC 1.0.0 and 1.0.1 (wxc-exec.exe from npm @microsoft/mxc-sdk), Windows 11 26300.9711.
Steps to reproduce
Work in one folder. In the config, replace <DIR> with that folder and <PY> with the folder that holds
python.exe (in JSON, double each backslash).
- Start a listener on the host:
python -m http.server 8080(stands in for the allowed upstream). - Create
probe.py:import socket try: print('DNS example.com', socket.getaddrinfo('example.com', 443)[0][4][0]) except OSError as e: print('DNS blocked', e) for port in (8080, 8081): try: socket.create_connection(('127.0.0.1', port), 3); print(port, 'REACHED') except OSError as e: print(port, 'blocked', e) - Create
C.json:{"version": "1.0.0", "containment": "processcontainer", "process": {"commandLine": "python probe.py", "timeout": 60000}, "filesystem": {"readonlyPaths": ["<DIR>", "<PY>"]}, "network": {"egress": {"default": "deny"}, "ingress": {"default": "allow", "hostLoopback": "allow"}}, "runtimeConfig": {"networkProxy": "http://127.0.0.1:8080"}} - Run
wxc-exec C.json.
Expected behavior
DNS resolution blocked in proxy mode (the proxy resolves names for proxied requests), or the behaviour documented in
networking.md with an option to block it.
Actual behavior
DNS example.com <resolved address>
8080 REACHED
8081 blocked [WinError 10013] ...
Connections are restricted correctly, but the name lookup succeeds.