Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

security(everything): gzip-file-as-resource fetches any URL incl. private/metadata IPs by default; get-env dumps all of process.env into model context

オープン
#5,130 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript
領域
backend, security

調査の方向性

Read tools/gzip-file-as-resource.ts and tools/get-env.ts, then compare the gzip server's URL checks with the fetch server's private-address refusal. The issue proposes safe defaults for URL access and environment variables, with both settings documented in the server README. Done means private or metadata addresses are blocked by default, environment output does not expose all secrets by default, and the README explains the configuration.

索引モデルが issue の本文から書いたものです。

説明

bug server-everything v2

Summary

Two hardening gaps in the everything demo server that matter because demo servers get copied into real deployments:

  1. gzip-file-as-resource has no SSRF protection (tools/gzip-file-as-resource.ts): GZIP_ALLOWED_DOMAINS defaults to empty (line 21), and the domain check only applies "when configured" (line 150) — so by default any http/https URL is fetched, private/link-local/metadata addresses included, with redirects not re-checked. This contrasts with the fetch server, which ships default private-IP refusal. Demo code gets forked; the asymmetry propagates.
  2. get-env dumps the entire process.env into the tool result (tools/get-env.ts:28-38, JSON.stringify(process.env, null, 2)) — any prompt-injection source that can phrase a tool call reads every secret in the process (API keys included) straight into the model context. Even for a debug demo, an allowlist (GET_ENV_ALLOWED_KEYS) or opt-in flag would prevent the demo from becoming a deployment exfiltration primitive.

Suggestions

  • gzip: reuse the fetch server's _is_public_address default-deny when the allowlist is empty (or default the allowlist to public-suffix-only behavior);
  • get-env: default to a safe allowlist (or require explicit opt-in), and document both knobs in the server README.

Static analysis of main @ bbb701e7; happy to PR either fix.


Chengzhi Yi (GitHub @Tardfyou) — [email protected]

主要言語
TypeScript
スター
91.4k
フォーク
11.8k
平均マージ
6時間 37分
マージ済み PR(30日)
147

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

modelcontextprotocol/servers のほかの issue

modelcontextprotocol/servers の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。