Harden MCP HTTP endpoint: loopback bind + Host/Origin validation#78
Open
ozzafar wants to merge 2 commits into
Open
Harden MCP HTTP endpoint: loopback bind + Host/Origin validation#78ozzafar wants to merge 2 commits into
ozzafar wants to merge 2 commits into
Conversation
✅ Extension Build Successful!📦 VSIX artifact is ready for download Scroll down to the "Artifacts" section and download To install: In VS Code, run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes ICM 31000000603080 (unauthenticated debugger access via 0.0.0.0 bind) and ICM 31000000611073 (DNS rebinding via missing Host header validation), both reported by MSRC against src/debugMCPServer.ts.
Background
The DebugMCP HTTP server exposes powerful, unauthenticated debugger primitives (evaluate_expression, start_debugging, …). MSRC reported two composable vulnerabilities:
Fixes
Validation
Manual repro against the fixed build
Rebinding-style request — now rejected:
curl -i -X POST "http://127.0.0.1:3001/mcp"
-H "Host: attacker.example"
-H "Content-Type: application/json"
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
→ HTTP/1.1 403 Forbidden
{"jsonrpc":"2.0","error":{"code":-32000,"message":"Forbidden: Host header is not a loopback address"},"id":null}
LAN-style probe — connection now refused:
nmap -p 3001
→ 3001/tcp closed