fix(security): fast-uri を更新し High アドバイザリ (host confusion) を解消 - #167
Merged
Conversation
…rm-f6hx, GHSA-4c8g-83qw-93j6) Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
pnpm audit/ Dependabot が検出した High 2 件(fast-uriの host confusion 系)を解消する。pnpm-workspace.yamlの既存 override をfast-uri@<3.1.2 → <3.1.4に引き上げるだけの変更で、fast-uriはパッチ済みの4.1.1に解決される(>=3.1.4を満たす最新)。修正前2 high / 1 moderate→ 修正後0 high(残る1 moderateは対象外、後述)。到達性はコードを追って確認した: 本リポジトリは Zenn の記事コンテンツ用で、
textlint(記事の校正)とzenn-cli(プレビュー)という CLI/開発ツールのみを依存に持ち、公開稼働するサーバ/アプリのランタイムは存在しない。1. 脆弱性の概要
いずれも
fast-uriが URL の authority(ホスト部)を誤解釈し、リテラルのバックスラッシュ区切りや IDN 正規化失敗によって、意図しないホストへの許可判定(host confusion → SSRF/認可バイパスの前段)を引き起こしうるというもの。パッチ済みは>=3.1.4。2. このコードベースでの攻撃シナリオと到達性評価
fast-uri(CLI/開発ツールのみ・攻撃者到達経路なし)
textlint(dependencies) →@modelcontextprotocol/sdk→ajv(+ajv-formats)→fast-uri。fast-uriはajvが JSON Schema の$id/$refなどの URI 解決に用いる。fast-uriのパーサに到達する必要がある。本リポジトリでのfast-uriの唯一の利用箇所は textlint(記事 Markdown の校正 CLI)内部の ajv であり、処理対象はリポジトリ所有者自身が書いた記事・設定ファイルのみ。ネットワーク経由で外部入力を受け付けるサーバ機能は存在しない。3. 修正内容
pnpm-workspace.yaml(overrides は pnpm 10 のワークスペース設定側に集約されている):pnpm installでpnpm-lock.yamlを更新。fast-uriは>=3.1.4を満たす最新の4.1.1に解決(ajv@8.18.0は 4.x を受理、make lintで動作確認済み)。@hono/node-server(textlint → @modelcontextprotocol/sdk → @hono/node-server経由、GHSA-frvp-7c67-39w9, moderate)。本タスクの対象は High/Critical のため今回は対象外。こちらも CLI ツール内部依存で攻撃者到達経路は無い。4. 修正後の確認
pnpm audit: High 0 件(修正前 High 2 → 0)。残存は1 moderate(上記@hono/node-server)のみ。make lint(textlint --config ./textlintrc.json --ignore-path ./textlintignore articles、CI と同一コマンド): 正常終了(exit 0、クラッシュなし)。CI(node 24 /make install→make lint)でも同様に通る想定。Link to Devin session: https://app.devin.ai/sessions/81808a35c5264b1aa2ee724d9b029ba9