Skip to content

fix(security): secure default host binding to loopback#576

Open
niStee wants to merge 1 commit into
icebear0828:devfrom
niStee:fix-host-binding
Open

fix(security): secure default host binding to loopback#576
niStee wants to merge 1 commit into
icebear0828:devfrom
niStee:fix-host-binding

Conversation

@niStee
Copy link
Copy Markdown

@niStee niStee commented May 15, 2026

The default host binding of :: inadvertently exposes the proxy to the entire local network, which can be a security risk for a local development proxy. This patch locks the default binding to 127.0.0.1 to ensure safe local-only isolation. Users who explicitly want network access can override it in their config.

@niStee niStee force-pushed the fix-host-binding branch from 5613237 to 06955f6 Compare May 16, 2026 22:03
@icebear0828
Copy link
Copy Markdown
Owner

谢 PR,思路对的 — 默认开 0.0.0.0 确实是个 expose 风险。但当前 patch 会让 Docker 部署破:

[P1] 容器内 loopback 监听让 publish 不可达config/default.yaml:30
Docker 用户运行容器时,ports: 8080:8080 把流量发到容器的网卡,不是容器内 loopback。改成 127.0.0.1 默认后 Node 只在容器内 loopback 监听,host 端访问会全部 connection refused,但 /health 在容器内还是 200,假性健康。

建议方向:

  • 默认值保留 0.0.0.0/::,但在 docs / config 里加显式安全提示
  • 或者按运行模式分:Electron / 本地 npm start 默认 127.0.0.1,Docker 镜像通过 env 或 entrypoint 覆盖回 0.0.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants