Admin API remains externally accessible after configuring adminHost for localhost
0 reputation · 07 Dec 2020, 14:24 UTC
0 reputation · 07 Dec 2020, 14:24 UTC
When securing a Node-RED instance, administrators often set the adminHost property to 127.0.0.1 to limit the HTTP admin API to the loopback interface.
The goal is to confirm that this setting alone prevents any external host from reaching the editor UI and deploying flows, while preserving normal flow execution through HTTP input/output nodes.
Uncertainty remains about whether additional configuration—such as disabling httpAdminRoot or enabling adminAuth—is required, and whether changing adminHost could inadvertently affect other Node-RED components.
Does setting adminHost to 127.0.0.1 by itself block external access to the admin API?
Is it necessary to also modify httpAdminRoot or configure adminAuth for complete isolation?
Are there any side effects on standard HTTP nodes when the admin API is bound to localhost only?
34775 reputation · 07 Dec 2020, 16:14 UTC
Setting adminHost to 127.0.0.1 alone does not guarantee that the Node‑RED admin API is unreachable from external hosts.
The adminHost option controls the interface on which the editor UI is served. In many Node‑RED deployments the underlying admin HTTP API shares the same listener, but some installations expose the API on a separate port or bind it to 0.0.0.0 regardless of the UI setting. If the API listener remains on all interfaces, external clients can still reach it.
adminHost value is read from settings.js and applied when the Node‑RED process starts.adminHost requires a restart of the Node‑RED service for the new binding to take effect.netstat -tlnp or ss -tlnp show the actual address and port the API is listening on.settings.js and confirm adminHost is set to "127.0.0.1".systemctl restart nodered or whichever method you use).ss -tlnp | grep :1880 (replace 1880 with your admin port) and note the address shown in the Local Address:Port column.0.0.0.0:1880 or [::]:1880, the API is still bound to all interfaces.adminHost is correctly set and that no other configuration (e.g., command‑line --host flag) overrides it. After correcting, restart again and repeat the ss check.Please provide the output of the ss -tlnp (or netstat -tlnp) line for the admin API port so we can verify whether the listener is already on 127.0.0.1 or still on 0.0.0.0. This detail determines whether a simple restart suffices or if additional binding overrides must be investigated.
Use comments to ask for clarification. Post a solution as an answer.
34,775 reputation · 07 Dec 2020, 23:23 UTC
In Node‑RED the setting that controls which network interface the built‑in web server (editor UI and admin API) binds to is uiHost, not adminHost. Setting uiHost to "127.0.0.1" makes the Express listener loopback‑only, which also blocks external access to HTTP in/out nodes because they share the same server instance. The httpAdminRoot only changes the URL path prefix, and adminAuth adds authentication but does not affect the bind address. To verify, restart Node‑RED and run ss -tlnp | grep :1880 (or your uiPort) and confirm the Local Address shows 127.0.0.1.