-
Couldn't load subscription status.
- Fork 148
chore: warn about insecure httpHost usage - MCP-184 #541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a security warning to alert users when they bind the MCP Server to 0.0.0.0, which exposes it to the entire local network and poses security risks.
- Adds a warning log when
httpHostis set to0.0.0.0 - Creates a new log ID for the security warning message
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/transports/streamableHttp.ts | Adds security warning logic after server startup when httpHost is "0.0.0.0" |
| src/common/logger.ts | Adds new log ID constant for the HTTP host security warning |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/transports/streamableHttp.ts
Outdated
| noRedaction: true, | ||
| }); | ||
|
|
||
| if (this.userConfig.httpHost === "0.0.0.0") { |
Copilot
AI
Sep 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The warning only checks for exact match of '0.0.0.0'. Consider also warning for other non-localhost bindings like '::' (IPv6 all interfaces) or specific external IP addresses that could expose the server to unauthorized access.
Co-authored-by: Copilot <[email protected]>
Pull Request Test Coverage Report for Build 17615294858Details
💛 - Coveralls |
Proposed changes
addresses
[REC7] Warn users when they try to change localhost bindings to 0.0.0.0 or other non-local network interfaces.[WARNING] 1006009 - streamableHttpTransport: Binding to 0.0.0.0 can expose the MCP Server to the entire local network, which allows other devices on the same network to potentially access the MCP Server. This is a security risk and could allow unauthorized access to your database context. (46537)Checklist