Allow dsh web --host to bind a specific LAN interface
#7111
Replies: 1 comment
|
Your reading of the tree is correct, with one correction about which check is the gate. What blocks a specific interfaceNot the startup check. The rejection happens one layer down, in the webserver's own schema: Your LAN-trust reading holds, and its second half is the sharper point
On the security considerationThe stated reason is in the error text itself — "it would expose remote code execution to the network" ( What a user can do todayThe listener is loopback or wildcard only, so remote access has to arrive at loopback. The documented path is an SSH launch: the URL still prints, the browser handoff is suppressed, and the client or editor owns the forwarded address ( Not verified: the line numbers you quote from the published |
Uh oh!
There was an error while loading. Please reload this page.
What happens now.
dsh web --hostaccepts only the loopback and all-interfaces literals (@deepseek-ai/dsh-host-webserverlib/index.js:141):and the Web app refuses the second one at startup (
@deepseek-ai/dsh-web-applib/startup.js:40):Consequence. There is no way to expose the Web UI — or anything built on it, such as a LAN manager for a small fleet of harness instances — to another machine on the same network. A specific interface (the LAN address the machine already has) cannot be named at all.
What makes this worth revisiting. The fence a LAN bind would need already exists and already runs:
@deepseek-ai/dsh-web-app'sresolveLanTrust(lib/index.js:83) computes the non-internal IPv4 addresses, folds them intotrustedHostsfor the/apibrowser-trust fence, and the ready banner announces a LAN candidate (lib/index.js:199). All of it is gated onbindHost === "0.0.0.0", which startup rejects, so on the CLI path it is unreachable.Note also that with a non-wildcard bind that function returns an empty
lanAddressesand atrustedHostsof only the explicit--trusted-hostvalues, so a specific-interface bind would need its own address added to the fence to be usable.Suggested shape. Accept an explicit interface literal —
--host 192.168.1.5— and continue to reject the all-interfaces wildcard, or gate that wildcard behind an explicit opt-in. Binding one address exposes the listener only on the subnet that address is on, and lets the existing trust fence do its job. If remote code execution is the concern, an opt-in flag that also requires a token or an allowlist is the safer form than a silent wildcard bind.Acceptance.
dsh web --host <a non-internal IPv4 literal of this host>serves on that address and prints it in the ready banner; a browser on another machine on the same subnet can load it; and the/apifence still rejects a Host header that is neither the bound address nor an explicit--trusted-host.(Re-verified against
@deepseek-ai/dsh0.1.6-alpha.2; the line numbers above are that version's.)All reactions