Skip to content

fix(security): fast-uri を更新し High アドバイザリ (host confusion) を解消 - #167

Merged
ara-ta3 merged 1 commit into
mainfrom
devin/1784771715-zenn-sec-audit
Jul 23, 2026
Merged

fix(security): fast-uri を更新し High アドバイザリ (host confusion) を解消#167
ara-ta3 merged 1 commit into
mainfrom
devin/1784771715-zenn-sec-audit

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

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. 脆弱性の概要

ライブラリ 前 → 後 Severity CVSS 種類 CVE / GHSA
fast-uri 3.1.2 → 4.1.1 High 7.5 Host confusion (URL authority パース) GHSA-v2hh-gcrm-f6hx (CVE-2026-16221) / GHSA-4c8g-83qw-93j6 (CVE-2026-13676)

いずれも fast-uri が URL の authority(ホスト部)を誤解釈し、リテラルのバックスラッシュ区切りや IDN 正規化失敗によって、意図しないホストへの許可判定(host confusion → SSRF/認可バイパスの前段)を引き起こしうるというもの。パッチ済みは >=3.1.4

2. このコードベースでの攻撃シナリオと到達性評価

fast-uri(CLI/開発ツールのみ・攻撃者到達経路なし)

  • 依存経路: textlint(dependencies) → @modelcontextprotocol/sdkajv(+ ajv-formats)→ fast-urifast-uriajv が JSON Schema の $id/$ref などの URI 解決に用いる。
  • 入口/手法: この脆弱性が悪用されるには、攻撃者が制御する URL 文字列が fast-uri のパーサに到達する必要がある。本リポジトリでの fast-uri の唯一の利用箇所は textlint(記事 Markdown の校正 CLI)内部の ajv であり、処理対象はリポジトリ所有者自身が書いた記事・設定ファイルのみ。ネットワーク経由で外部入力を受け付けるサーバ機能は存在しない。
  • 実際の影響度: 実質的な影響なし(開発/CI 時のみの依存で、攻撃者制御入力の到達経路が無い)。ただし audit/Dependabot 上の High として表面化しており、パッチ適用コストが低いため解消する。

3. 修正内容

pnpm-workspace.yaml(overrides は pnpm 10 のワークスペース設定側に集約されている):

 overrides:
-  fast-uri@<3.1.2: '>=3.1.2'
+  fast-uri@<3.1.4: '>=3.1.4'
  • pnpm installpnpm-lock.yaml を更新。fast-uri>=3.1.4 を満たす最新の 4.1.1 に解決(ajv@8.18.0 は 4.x を受理、make lint で動作確認済み)。
  • 破壊的変更: 無し。記事・設定・アプリコードの変更なし。
  • 対象外(未修正): @hono/node-servertextlint → @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 linttextlint --config ./textlintrc.json --ignore-path ./textlintignore articles、CI と同一コマンド): 正常終了(exit 0、クラッシュなし)。CI(node 24 / make installmake lint)でも同様に通る想定。

Link to Devin session: https://app.devin.ai/sessions/81808a35c5264b1aa2ee724d9b029ba9

…rm-f6hx, GHSA-4c8g-83qw-93j6)

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@ara-ta3
ara-ta3 merged commit 0c22896 into main Jul 23, 2026
1 check passed
@ara-ta3
ara-ta3 deleted the devin/1784771715-zenn-sec-audit branch July 23, 2026 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant