Security and safety model โ
IMPORTANT
NodeUI is engineered specifically for local development environments. A suite of built-in safeguards prevents accidental production exposure.
- ๐ซ Fail-Closed in Production: NodeUI turns completely off when
NODE_ENV=productionunless explicitly forced viaNODEUI_ENABLED=true. - ๐ Loopback Binding Only: Incoming requests from non-loopback addresses (
!127.0.0.1and!::1) are immediately rejected with403 Forbidden. - ๐ DNS-Rebinding & CSRF Defence: The
HostandOriginheaders must be loopback names (or allow-listed); proxied (X-Forwarded-*) requests are rejected by default. Responses carry CSP,nosniffand frame-deny headers. - ๐ Optional Access Token: Set
authToken/NODEUI_TOKENto require a token (header, or a one-time?token=login that sets an HttpOnly cookie). - ๐ก๏ธ Aggressive Secret Redaction: Values under keys such as
TOKEN,KEY,SECRET,PASSWORD,AUTH,COOKIE,DSN,DATABASE_URL, plus credentials embedded in text (postgres://user:pass@host, bearer tokens, JWTs,password=...โ including log lines) are replaced with[REDACTED]. Applies to REST and the live stream. SetmaskSecrets: falseto opt out. - ๐ธ Private Heap Dumps: Snapshots are written owner-only (
0600) into a private directory. A heap dump contains every secret in memory; delete them when done. - ๐ Nonce-Gated Mutating Actions: Heavy operations like V8 Heap Snapshots require a two-step challenge: request a single-use confirmation nonce via
POST /confirmations, then submit withx-nodeui-confirmheader. - โก Negligible Cost When Disabled: When inactive, the middleware is a direct
next()passthrough without event listeners or timers. - ๐งพ Credentials Never Stored:
authorization,cookie,set-cookie,proxy-authorization,x-api-keyand any header or query key that looks secret are redacted at capture time, even withmaskSecrets: false. Request/response bodies are off by default.