Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

`FileSecretStore` accepts truncated AES-GCM auth tags

Open Beginner friendly
#2,485 1 comment 0 reactions 0 assignees View on GitHub

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
Domain
backend, security

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

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."

Dominant language
TypeScript
Stars
10.9k
Forks
1.5k
Avg merge
5h 47m
Merged PRs (30d)
148

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from modelcontextprotocol/inspector

All issues in modelcontextprotocol/inspector

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.