External Control of File Name or Path Affecting exceljs-hardened package, versions <5.0.0


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.37% (30th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-EXCELJSHARDENED-19883937
  • published17 Sept 2026
  • disclosed24 Aug 2026
  • creditUnknown

Introduced: 24 Aug 2026

NewCVE-2026-78208  (opens in a new tab)
CWE-73  (opens in a new tab)

How to fix?

Upgrade exceljs-hardened to version 5.0.0 or higher.

Overview

Affected versions of this package are vulnerable to External Control of File Name or Path via Workbook.addImage({filename}) in lib/xlsx/xlsx.js (addMedia()). An attacker can read arbitrary files accessible to the Node.js process by supplying a filename fragment that escapes the intended base directory, causing the chosen file to be embedded into the generated .xlsx download as an image.

Notes

  • The vulnerability is still present in upstream exceljs; an unofficial fork - exceljs-hardened, carries the out-of-tree hardening mentioned in the referenced advisory.

Workarounds

  • Do not build the addImage({filename}) path with path.join() from a base directory plus user input alone; resolve the final path and verify it still starts with the intended base directory before passing it to addImage(), which blocks ../ traversal into arbitrary readable files.
  • Map user-supplied image names to a fixed allowlist of known-safe file paths instead of accepting an arbitrary path fragment, which prevents attackers from selecting paths outside the intended asset set.

CVSS Base Scores

version 4.0
version 3.1