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

`FileSecretStore` accepts truncated AES-GCM auth tags

クローズ 初心者向け
#2,485 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
75/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
cryptography, node.js, typescript
領域
backend, security

調査の方向性

問題は core/auth/node/file-secret-store.ts の decodeParts 関数の約298行目と、復号が行われる678-679行目にあります。まず、現在の検証を理解するためにファイルを読んでください。次に、decodeParts を修正してIVの長さを12、タグの長さを16に強制し、createDecipheriv に { authTagLength: 16 } オプションを追加します。切り詰められたタグを持つシークレットを作成し、SecretFileKeyMismatchError を期待するテストを書きます。修正が機能することを確認するために、既存のテストスイートを実行してください。

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

説明

bug security v2

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

環境構築

はじめの一歩

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

modelcontextprotocol/inspector のほかの issue

modelcontextprotocol/inspector の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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