deno
7b3cd9db - fix(permissions): require --allow-net for Unix domain socket ops (#34395)

Commit
160 days ago
fix(permissions): require --allow-net for Unix domain socket ops (#34395) Unix socket connect and listen (Deno.connect / Deno.listen / Deno.listenDatagram with transport: "unix" or "unixpacket", plus Deno.DatagramConn.send) checked only filesystem permissions on the socket path. A script run with `--allow-read=/var/run/docker.sock --allow-write=/var/run/docker.sock` and no `--allow-net` grant could reach the Docker daemon and any other local IPC service exposed via a Unix socket — Docker, podman, dbus, custom RPC endpoints. This adds an `--allow-net=unix:<absolute-path>` scoping form, mirroring the existing `--allow-net=vsock:<cid>:<port>` pattern. The four Unix socket ops now run that check in addition to the existing `check_open` pass, so operators get both axes: revoking `--allow-read` or `--allow-write` on the socket path still blocks access (defense in depth), and operators who currently scope to one specific Docker socket can keep that scoping by adding `--allow-net=unix:/var/run/docker.sock` rather than having to grant unscoped `--allow-net`. This is a breaking change: scripts that relied on `--allow-read` / `--allow-write` alone to reach Unix sockets now need the matching `--allow-net=unix:<path>` rule (or unscoped `--allow-net`).
Author
Parents
Loading