/

CVE-2026-78208

Severity:

HIGH RISK

(7.5)

Path Traversal (CWE-73) in ExcelJS Workbook.addImage()

CVE-2026-78208

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-73

Impact:

Arbitrary File Read

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 contains a path traversal vulnerability in the Workbook.addImage() function because supplied file paths are not adequately validated. An attacker who can influence the image path may cause the Node.js process to read arbitrary files accessible to its account and embed their contents in a generated workbook.

Affected context

The issue occurs in applications that use ExcelJS to create workbooks and call Workbook.addImage() with file paths influenced by external or insufficiently trusted input. Risk depends on the Node.js process having access to sensitive files and on the resulting workbook being returned, stored, or otherwise exposed to the attacker.

Exploit preconditions

  • Attack surface: Application functionality that generates Excel workbooks with ExcelJS images
  • Required access: Ability to influence an image path directly or through application-controlled data
  • Trigger point: Invocation of Workbook.addImage() during workbook generation
  • Why exploitation is possible: The supplied path is not sufficiently constrained to an approved directory or validated against traversal sequences, allowing file reads outside the intended image location

Why this happens

The vulnerability results from accepting a file path as an image source without enforcing a trusted path boundary. When externally influenced path data is passed to file-reading logic, traversal components or absolute paths can redirect access to unintended files. This maps to CWE-73: External Control of File Name or Path, where attacker-controlled path information influences filesystem operations.

Potential impact

  • Sensitive local files may be read by the Node.js process
  • File contents may be embedded in generated workbooks
  • Credentials, configuration data, or source code may be disclosed
  • Exposed files may enable follow-on compromise or privilege escalation

General mitigation guidance

Mitigation generally focuses on reducing trust in file path inputs and enforcing a controlled filesystem boundary.

Common defensive patterns include:

  • Accepting approved image identifiers or opaque asset references instead of arbitrary paths
  • Resolving paths against a fixed, dedicated asset directory and verifying that the result remains within that directory
  • Rejecting absolute paths, traversal components, symbolic-link escapes, and unexpected file types
  • Applying strict allowlists for permitted files and image formats
  • Running the Node.js process with the minimum filesystem permissions required
  • Avoiding inclusion of generated workbooks or embedded assets in responses unless access has been authorized

How teams detect issues like this

Organizations can detect this class of issue through:

  • Static analysis rules for filesystem APIs that consume request-derived or configuration-derived paths
  • Code review checks for path concatenation, missing canonicalization, and absent directory-boundary validation
  • Tests using traversal markers, absolute paths, symbolic links, and encoded path variants
  • Runtime monitoring for unexpected reads outside designated asset directories
  • Policy enforcement requiring approved asset abstractions and least-privilege filesystem access

Automated security review tools may help identify untrusted data flows into workbook image or file-reading APIs.

Sources

SourceLink
github.comgithub.com/exceljs/exceljs
github.comgithub.com/exceljs/exceljs/blob/v4.4.0/lib/doc/workbook.js#L142-L147
github.comgithub.com/exceljs/exceljs/blob/v4.4.0/lib/xlsx/xlsx.js#L421-L429
github.comgithub.com/mateocallec/exceljs-hardened/security/advisories/GHSA-m8mg-8574-gm3m
vulncheck.comvulncheck.com/advisories/exceljs-through-path-traversal-via-unvalidated-addimage-filename

Frequently asked

questions

It can be exploitable through an application interface if an attacker can influence the image path used during workbook generation. The underlying library call alone does not provide remote access without an integrating application or other path-input surface.

The attacker generally needs the ability to submit or modify data that reaches Workbook.addImage(). The Node.js process must also have read permission for the targeted file.

Replace arbitrary path handling with approved asset references, resolve files within a dedicated directory, and verify the canonical path remains inside that directory before reading it.

Use strict path validation and allowlists, test filesystem boundaries during development, review untrusted data flows into file APIs, and run services with minimal filesystem privileges.

Find out what's already
exploitable in your codebase.