fetch: --allowed-hosts accepts wildcard IP entries (e.g. *.0.0.1) and matches any IPv4 ending with that suffix
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
Hướng nghiên cứu
Bắt đầu tại src/fetch/src/mcp_server_fetch/allowlist.py và đọc normalize_allowed_host cùng host_is_allowed, là các điểm truy cập bị ảnh hưởng theo issue. Kiểm tra các bài kiểm thử hiện có về chuẩn hóa và khớp host được cho phép, sau đó bổ sung kiểm thử cho địa chỉ IP dạng literal có wildcard, hậu tố số và host là địa chỉ IP. Hoàn thành khi các đầu vào đó bị từ chối hoặc không bao giờ khớp với địa chỉ IP dạng literal, trong khi wildcard cho tên miền con của hostname vẫn hoạt động.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
mcp-server-fetch's --allowed-hosts allowlist (src/fetch/src/mcp_server_fetch/allowlist.py) documents two valid entry forms:
Two entry forms only, to keep the semantics obvious: an exact host (a name or an IP literal), and
*.example.com, which matches any subdomain at any depth of example.com...
However, normalize_allowed_host only checks ipaddress.ip_address(...) when not wildcard (line 37). When a wildcard prefix *. is given before an IP literal or numeric IP suffix (such as *.10.0.0.1 or *.0.0.1), httpx.URL(f"http://{name}/") parses name without error and returns *.10.0.0.1 / *.0.0.1.
Then in host_is_allowed(host, allowed_hosts), host.endswith(entry[1:]) matches any IPv4 literal ending with .0.0.1 (for example, *.0.0.1 matches both 10.0.0.1 and 127.0.0.1).
from mcp_server_fetch.allowlist import host_is_allowed, normalize_allowed_hosts
entries = normalize_allowed_hosts(["*.0.0.1"]) # returns ('*.0.0.1',)
assert host_is_allowed("127.0.0.1", entries) is True
assert host_is_allowed("10.0.0.1", entries) is True
Expected
normalize_allowed_hostrejects wildcard IP literals and numeric-TLD wildcard suffixes (*.10.0.0.1,*.0.0.1,*.[::1]) withValueError.host_is_alloweddoes not match*.subdomain wildcards against IP address literals.
- Ngôn ngữ chính
- TypeScript
- Star
- 91.9k
- Fork
- 11.9k
- Merge trung bình
- 3 giờ 10 phút
- Pull request đã merge (30 ngày)
- 178
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của modelcontextprotocol/servers
-
bug server-sequentialthinking v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
modelcontextprotocol/servers#5526 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fix(docker): correct stale --db-path comments in fetch/git Dockerfiles and clarify git READMECó thể đã có người làm @cliffhall đã nhận hôm nay. Đang mởdocumentation server-fetch server-git v2
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
modelcontextprotocol/servers#5483 · 4 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
chore v2
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
modelcontextprotocol/servers#5527 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement server-memory v2
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
modelcontextprotocol/servers#5525 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
everything: README description of `get-env` masking omits the whole-segment rule — `APIKEY` / `MYKEY` are not maskedCó thể đã có người làm @cliffhall đã nhận hôm nay. Đang mởdocumentation server-everything v2
modelcontextprotocol/servers#5524 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của modelcontextprotocol/servers
Issue tương tự
-
maintenance
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
assistant-ui/assistant-ui#10499 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
app-server bug CLI
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
cimd: default originBoundFields rejects a cross-origin client_uri, which the CIMD draft forbidsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
better-auth/better-auth#12458 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ログイン中の404画面にヘッダーとナビを出すĐang mởCodex使用可 コード
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ryuki-moro/Nicomaru#218 ·
Maintainer thường phản hồi trong vòng 3 ngày