`FileSecretStore` accepts truncated AES-GCM auth tags
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- cryptography, node.js, typescript
Research direction
The issue is in core/auth/node/file-secret-store.ts around line 298 in the decodeParts function and lines 678-679 where decryption occurs. First, read the file to understand the current validation. Then, modify decodeParts to enforce IV length of 12 and tag length of 16, and add the { authTagLength: 16 } option to createDecipheriv. Write a test that creates a secret with a truncated tag and expects a SecretFileKeyMismatchError. Run the existing test suite to ensure the fix works.
Written by the indexing model from the issue text.
Description
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."
- Dominant language
- TypeScript
- Stars
- 10.9k
- Forks
- 1.5k
- Avg merge
- 5h 47m
- Merged PRs (30d)
- 148
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from modelcontextprotocol/inspector
-
chore security v2
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
modelcontextprotocol/inspector#2484 · 1 comment ·
-
enhancement v2
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
modelcontextprotocol/inspector#2438 · 1 comment ·
-
bug v2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
modelcontextprotocol/inspector#2424 · 2 comments ·
-
chore v2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
modelcontextprotocol/inspector#2416 · 1 comment ·
-
chore v2
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
modelcontextprotocol/inspector#2414 · 1 comment ·
All issues in modelcontextprotocol/inspector
Similar issues
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Crush Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
ElementsProject/cln-application#167 · 1 comment · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Quantco/pnpm-licenses#17 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100