ndcli device connect opens a shell on a firewall and a local tunnel to its OPNsense WebAdmin, at http://localhost:<port>. NDCLI 1.50.2 makes that tunnel check every request before it goes to the firewall. We found the gap in our own internal review, and we know of no exploitation of it. Upgrade when you can.
TL;DR
- Before 1.50.2, a page from another site open in the same browser, or a host name rebound to 127.0.0.1, could send requests through an open tunnel. Only the firewall’s own WebAdmin defences stood in the way.
- The tunnel now refuses a request with a foreign host, or one the browser marks as coming from another site, before it reaches the firewall.
- Upgrade NDCLI to 1.50.2 with Homebrew, Scoop or the release download. Nothing changes in daily use.
What was exposed
The WebAdmin tunnel used to pass whatever arrived on its local port straight to the firewall, and on the firewall the request runs as the user who opened the session. Your browser treats the tunnel like any other local web server. So while a tunnel was open, two things could reach it:
- A page from another site open in the same browser could send requests to
localhost:<port>. - A host name rebound to 127.0.0.1 (DNS rebinding) could make the browser treat the tunnel as part of an outside site.
What stopped such requests was only the WebAdmin’s own defences on the firewall, such as OPNsense’s CSRF check on changes. Those defences are still there; the tunnel now adds its own check in front of them.
What the tunnel checks now
Every request is checked before anything is sent to the firewall:
- The host. The
Hostmust belocalhostor127.0.0.1on the tunnel’s own port. Anything else gets421 Misdirected Request, which stops a rebound host name. - Where it came from. The request must come from the tunnel’s own page:
Sec-Fetch-Sitemust besame-originornone(an address you typed, or opened from the terminal), andOriginmust be the tunnel’s own. Each is checked when the browser sends it, and a request that fails either check gets403 Forbidden. - Links from other sites. When the browser marks a page load as coming from another site, such as a link in a chat or on a web page, the tunnel doesn’t forward the path the link named. It answers with its own page, which moves on to the WebAdmin’s start page; in Chrome, where we tested it, that lands on the signed-in dashboard.
- Every request on a connection. Browsers send many requests over one connection. Each of them is checked, not only the first.
The tunnel also refuses connection upgrades, which the WebAdmin doesn’t use. A refused request is answered by the tunnel itself and never reaches the firewall.
What you'll notice
Nothing, in daily use: the WebAdmin’s own pages, live widgets and Live View all come from the tunnel’s page, so they pass. If you open a tunnel address from a link, for example one pasted in chat, you start on the dashboard and go on from there.
Upgrade to 1.50.2
Or download the binary from the NDCLI 1.50.2 release, as in Installation. Run ndcli version to check you have it. A tunnel that is already open keeps the old behaviour until you close it, so restart any running device connect sessions after the upgrade.
The device connect reference has the command’s flags, and Remote Access covers remote sessions in general.