/

CVE-2026-128347

Severity:

HIGH RISK

(7.5)

Path Traversal (CWE-73) in ExcelJS Streaming Writer

CVE-2026-128347

Analyzed

Vulnerability type

Category:

Path Traversal

CWE:

CWE-73

Impact:

Arbitrary local file read and potential disclosure of sensitive data

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

ExcelJS's streaming WorkbookWriter can read local files when crafted image filenames are passed to addImage. If an attacker can influence those filenames, path traversal may cause files readable by the Node.js process to be embedded in the generated workbook.

Affected context

The issue occurs in ExcelJS's streaming WorkbookWriter when image paths supplied to addImage are processed by addMedia. It becomes risky when image filenames are attacker-controlled or otherwise untrusted, and the Node.js process can read sensitive local files.

Exploit preconditions

  • Attack surface: Applications that use the streaming WorkbookWriter and add images to generated workbooks
  • Required access: Ability to influence an image filename passed to addImage
  • Trigger point: Processing the image path while adding media to the workbook
  • Why exploitation is possible: Path segments in the supplied filename can cause the process to access files outside the intended image directory; readable file contents may then be included under xl/media in the workbook

Why this happens

The underlying issue is insufficient control over externally supplied file paths. When a user-controlled filename is used to locate image content without adequately restricting its resolved path, traversal can escape the intended directory. This maps to CWE-73: External Control of File Name or Path.

Potential impact

  • Sensitive local files readable by the Node.js process may be disclosed in generated workbooks
  • Application secrets or configuration data could be exposed if accessible to the process
  • Generated workbooks may carry unintended file contents to recipients or downstream systems

General mitigation guidance

Defensive patterns focus on limiting which files image inputs can reference and reducing the impact of file access:

  • Prefer image data supplied through controlled buffers or streams over arbitrary filesystem paths where practical
  • Treat filenames as untrusted; resolve paths against a dedicated image directory and reject paths that escape it
  • Use allowlisted image sources and validate file types and expected locations
  • Run the Node.js process with least-privilege filesystem permissions and avoid placing secrets within its readable scope
  • Keep generated workbook handling and distribution aligned with the sensitivity of any embedded content

How teams detect issues like this

  • Use static analysis to identify user-controlled values reaching filesystem path or image-loading APIs
  • Review path normalization and directory-boundary checks around addImage and media processing
  • Add tests and policy checks that reject paths resolving outside approved image directories
  • Monitor generated workbooks and application logs for unexpected media sources or file access
  • Automated code review tools may help flag externally controlled paths used in filesystem operations

Sources

SourceLink
github.comgithub.com/exceljs/exceljs
github.comgithub.com/exceljs/exceljs/blob/v4.4.0/lib/stream/xlsx/workbook-writer.js#L124-L130
github.comgithub.com/exceljs/exceljs/blob/v4.4.0/lib/stream/xlsx/workbook-writer.js#L230-L237
github.comgithub.com/mateocallec/exceljs-hardened/security/advisories/GHSA-f9m8-8qmf-qq29
vulncheck.comvulncheck.com/advisories/exceljs-through-4.4.0-arbitrary-file-read-via-workbookwriter-addimage-filename

Frequently asked

questions

The flaw may be reachable through an application that accepts remote or user-submitted image filenames and uses them with the streaming WorkbookWriter. Exploitability depends on how that application exposes workbook generation.

An attacker needs a way to influence a filename passed to addImage and cause the application to process it. The process must also have permission to read the targeted file.

Avoid accepting arbitrary filesystem paths. Use controlled image data where possible, or constrain resolved paths to a dedicated, approved directory.

Treat external filenames as untrusted, enforce directory-boundary checks and source allowlists, and limit the application's filesystem permissions.

Find out what's already
exploitable in your codebase.