sandlock icon indicating copy to clipboard operation
sandlock copied to clipboard

procfs: most of /proc/net still shows the host's network state

Open congwang-mk opened this issue 2 months ago • 0 comments

With -r /proc, only /proc/net/dev and /proc/net/if_inet6 are virtualized (tcp/tcp6 only under port_remap). Everything else is the host's, since sandlock creates no network namespace:

tcp, udp, unix, route, arp, fib_trie, sockstat, snmp, netstat, dev_mcast all match the host line for line.

Inside the sandbox netstat -tln lists the host's listeners, route -n its routing table, and fib_trie every local IP. That is the information the NETLINK_ROUTE virtualization and the SIOCGIF* block are meant to hide.

Proposed fix: default-deny under /proc/net and serve a loopback-only view for the files tools actually read (tcp, udp, route, arp, fib_trie, sockstat), filtering tcp/udp to the sandbox's own sockets regardless of port_remap.

congwang-mk avatar Sep 20 '26 01:09 congwang-mk