File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,16 @@ Use SSE when:
123
123
- Working with restricted networks
124
124
- Implementing simple updates
125
125
126
+ #### Security Warning: DNS Rebinding Attacks
127
+
128
+ SSE transports can be vulnerable to DNS rebinding attacks if not properly secured. To prevent this:
129
+
130
+ 1 . ** Always validate Origin headers** on incoming SSE connections to ensure they come from expected sources
131
+ 2 . ** Avoid binding servers to all network interfaces** (0.0.0.0) when running locally - bind only to localhost (127.0.0.1) instead
132
+ 3 . ** Implement proper authentication** for all SSE connections
133
+
134
+ Without these protections, attackers could use DNS rebinding to interact with local MCP servers from remote websites.
135
+
126
136
<Tabs >
127
137
<Tab title = " TypeScript (Server)" >
128
138
``` typescript
@@ -381,6 +391,8 @@ When implementing transport:
381
391
- Handle denial of service scenarios
382
392
- Monitor for unusual patterns
383
393
- Implement proper firewall rules
394
+ - For SSE transports, validate Origin headers to prevent DNS rebinding attacks
395
+ - For local SSE servers, bind only to localhost (127.0.0.1) instead of all interfaces (0.0.0.0)
384
396
385
397
## Debugging Transport
386
398
Original file line number Diff line number Diff line change @@ -50,6 +50,16 @@ sequenceDiagram
50
50
In the ** SSE** transport, the server operates as an independent process that can handle
51
51
multiple client connections.
52
52
53
+ #### Security Warning
54
+
55
+ When implementing HTTP with SSE transport:
56
+
57
+ 1 . Servers ** MUST** validate the ` Origin ` header on all incoming connections to prevent DNS rebinding attacks
58
+ 2 . When running locally, servers ** SHOULD** bind only to localhost (127.0.0.1) rather than all network interfaces (0.0.0.0)
59
+ 3 . Servers ** SHOULD** implement proper authentication for all connections
60
+
61
+ Without these protections, attackers could use DNS rebinding to interact with local MCP servers from remote websites.
62
+
53
63
The server ** MUST** provide two endpoints:
54
64
55
65
1 . An SSE endpoint, for clients to establish a connection and receive messages from the
Original file line number Diff line number Diff line change @@ -67,6 +67,16 @@ The server **MUST** provide a single HTTP endpoint path (hereafter referred to a
67
67
** MCP endpoint** ) that supports both POST and GET methods. For example, this could be a
68
68
URL like ` https://example.com/mcp ` .
69
69
70
+ #### Security Warning
71
+
72
+ When implementing Streamable HTTP transport:
73
+
74
+ 1 . Servers ** MUST** validate the ` Origin ` header on all incoming connections to prevent DNS rebinding attacks
75
+ 2 . When running locally, servers ** SHOULD** bind only to localhost (127.0.0.1) rather than all network interfaces (0.0.0.0)
76
+ 3 . Servers ** SHOULD** implement proper authentication for all connections
77
+
78
+ Without these protections, attackers could use DNS rebinding to interact with local MCP servers from remote websites.
79
+
70
80
### Sending Messages to the Server
71
81
72
82
Every JSON-RPC message sent from the client ** MUST** be a new HTTP POST request to the
You can’t perform that action at this time.
0 commit comments