`FileSecretStore` accepts truncated AES-GCM auth tags
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 75/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- cryptography, node.js, typescript
調査の方向性
問題は core/auth/node/file-secret-store.ts の decodeParts 関数の約298行目と、復号が行われる678-679行目にあります。まず、現在の検証を理解するためにファイルを読んでください。次に、decodeParts を修正してIVの長さを12、タグの長さを16に強制し、createDecipheriv に { authTagLength: 16 } オプションを追加します。切り詰められたタグを持つシークレットを作成し、SecretFileKeyMismatchError を期待するテストを書きます。修正が機能することを確認するために、既存のテストスイートを実行してください。
索引モデルが issue の本文から書いたものです。
説明
Severity: Low (hardening). CWE: CWE-310 / CWE-347 class (improper authentication-tag validation). Status: behavior confirmed; exploitability limited.
What
core/auth/node/file-secret-store.ts: decodeParts (around line 298) checks only that the payload has three
dot-separated parts. crypto.createDecipheriv(CIPHER, key, parts.iv) and decipher.setAuthTag(parts.tag) (lines 678-679) then run
without authTagLength, so tag and IV lengths are attacker-influenced by whoever can edit the file.
Reproduction (standalone, no repo code)
AES-256-GCM encrypt, then decrypt with the tag truncated:
| Runtime | 16-byte tag | 4-byte tag | 1-byte / 0-byte tag |
|---|---|---|---|
Node 22.19.0 (Docker node:22.19-alpine, engines floor is >=22.19.0) |
accepted | accepted | rejected |
| Node 26.5.0 | accepted | rejected (ERR_CRYPTO_INVALID_AUTH_TAG) |
rejected |
So on the supported Node 22 line a 4-byte tag authenticates, cutting forgery cost to about 2^-32 per attempt.
Limits
Needs write access to the user's local secrets file, and each attempt needs the app to decrypt it, so this is not remote
and not cheaply exploitable. Newer Node versions already reject it.
Suggested change
In decodeParts, require iv.length === 12 and tag.length === 16, and pass { authTagLength: 16 } to createDecipheriv.
Add a test with a truncated tag that expects SecretFileKeyMismatchError.
Reviewed at 1e31c78 (v2.8.0). No fix code is offered, per CONTRIBUTING.md.
Prompt used (per CONTRIBUTING.md)
"Audit this repository's CI workflows and one crypto module against the OpenSSF/CRA-friendly checklist. Run Semgrep,
osv-scanner, gitleaks and trufflehog; read every cited line before accepting a finding; reproduce any crypto claim on the
lowest supported Node version; drop findings that are test fixtures or already mitigated."
- 主要言語
- TypeScript
- スター
- 11.1k
- フォーク
- 1.5k
- 平均マージ
- 4時間 32分
- マージ済み PR(30日)
- 136
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
modelcontextprotocol/inspector のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
modelcontextprotocol/inspector#2725 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
modelcontextprotocol/inspector#2723 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
modelcontextprotocol/inspector#2727 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
modelcontextprotocol/inspector#2726 ·
メンテナーはふだん 1 日以内に返信
-
insufficient_scope challenge retry doesn't detect expired access token, gives up after one identical retry対応中かも @its-nott-me が 2 日前に担当しました。 オープンbug
難易度 3/5 1〜2日 初心者へのやさしさ 50/100
modelcontextprotocol/inspector#2724 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
modelcontextprotocol/inspector の issue をすべて見る
似ている issue
-
freshness freshness:observed-only
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
thoroc/context-radar#280 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
-
documentation story
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
bug category:billing priority:p3 track:fast
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
LanternOps/breeze#9223 ·
メンテナーはふだん 1 日以内に返信