You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 97d89b9
Browse filesBrowse the repository at this point in the historyBrowse files
fix: refuse foreign Origins on the Python servers whatever HOST is
The SDK's DNS-rebinding protection checks Origin only when it binds
loopback, so with HOST widened a page on any origin could reach the git,
fetch and time tools. Each transport.py now wraps the SDK's app in a
localhost-Origin middleware, as the TypeScript servers do with
localhostOriginValidation, and runs it under uvicorn itself.
The READMEs now say what each endpoint refuses, and that the TypeScript
ones send no CORS headers.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: cliffhall <[email protected]>
Copy file name to clipboardExpand all lines: src/fetch/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -343,7 +343,7 @@ this one, so set it deliberately. Point a client at the URL, such as
343
343
}
344
344
```
345
345
346
-
Every other option works as it does over stdio. On loopback the SDK also checks each request's `Host` and `Origin` headers against loopback names, to guard against DNS rebinding.
346
+
Every other option works as it does over stdio. A browser page from any origin but localhost is refused with `403`, whatever `HOST` is, to guard against DNS rebinding; on loopback the SDK also checks each request's `Host` header.
It listens on `127.0.0.1:3001` unless `HOST` and `PORT` say otherwise (for
416
416
example `PORT=8080`); `HOST=0.0.0.0` exposes it to every machine that can reach
417
-
this one, so set it deliberately. A browser page can reach it only from a
418
-
localhost origin. Point a client at the URL, such as
417
+
this one, so set it deliberately. A request from a browser page on any
418
+
origin but localhost is refused with `403`, and the endpoint sends no CORS
419
+
headers, so it serves clients that are not browser pages. Point a client at the URL, such as
419
420
`http://127.0.0.1:3001/mcp`, instead of giving it a command:
Copy file name to clipboardExpand all lines: src/git/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -407,7 +407,7 @@ this one, so set it deliberately. Point a client at the URL, such as
407
407
}
408
408
```
409
409
410
-
Every other option works as it does over stdio; `--repository` matters more here, since any client that can reach the port can use the server. On loopback the SDK also checks each request's `Host` and `Origin` headers against loopback names, to guard against DNS rebinding.
410
+
Every other option works as it does over stdio; `--repository` matters more here, since any client that can reach the port can use the server. A browser page from any origin but localhost is refused with `403`, whatever `HOST` is, to guard against DNS rebinding; on loopback the SDK also checks each request's `Host` header.
It listens on `127.0.0.1:3001` unless `HOST` and `PORT` say otherwise (for
169
169
example `PORT=8080`); `HOST=0.0.0.0` exposes it to every machine that can reach
170
-
this one, so set it deliberately. A browser page can reach it only from a
171
-
localhost origin. Point a client at the URL, such as
170
+
this one, so set it deliberately. A request from a browser page on any
171
+
origin but localhost is refused with `403`, and the endpoint sends no CORS
172
+
headers, so it serves clients that are not browser pages. Point a client at the URL, such as
172
173
`http://127.0.0.1:3001/mcp`, instead of giving it a command:
It listens on `127.0.0.1:3001` unless `HOST` and `PORT` say otherwise (for
232
232
example `PORT=8080`); `HOST=0.0.0.0` exposes it to every machine that can reach
233
-
this one, so set it deliberately. A browser page can reach it only from a
234
-
localhost origin. Point a client at the URL, such as
233
+
this one, so set it deliberately. A request from a browser page on any
234
+
origin but localhost is refused with `403`, and the endpoint sends no CORS
235
+
headers, so it serves clients that are not browser pages. Point a client at the URL, such as
235
236
`http://127.0.0.1:3001/mcp`, instead of giving it a command:
Copy file name to clipboardExpand all lines: src/time/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -255,7 +255,7 @@ this one, so set it deliberately. Point a client at the URL, such as
255
255
}
256
256
```
257
257
258
-
Every other option works as it does over stdio. On loopback the SDK also checks each request's `Host` and `Origin` headers against loopback names, to guard against DNS rebinding.
258
+
Every other option works as it does over stdio. A browser page from any origin but localhost is refused with `403`, whatever `HOST` is, to guard against DNS rebinding; on loopback the SDK also checks each request's `Host` header.
0 commit comments