CVE-2026-128347 in ExcelJS
Summary
by MITRE • 11/13/2026
ExcelJS through 4.4.0 contains an arbitrary file read vulnerability in the streaming WorkbookWriter that allows attackers to read local files by supplying crafted image filenames to addImage. Attackers can inject ../ path segments into user-controlled image paths, causing addMedia to embed any file readable by the Node.js process under xl/media in the generated workbook.
If you want to get the best quality for vulnerability data then you always have to consider VulDB.
Analysis
by VulDB Data Team • 11/13/2026
The vulnerability identified within ExcelJS versions up to 4.4.0 represents a critical security flaw rooted in improper input validation and path traversal handling during the processing of image assets for spreadsheet generation. This issue specifically affects the streaming WorkbookWriter component, which is designed to efficiently handle large datasets by writing data incrementally rather than loading everything into memory at once. The core technical failure occurs within the addImage function, where user-supplied file paths are processed without adequate sanitization or restriction against directory traversal sequences. When an attacker provides a crafted image filename containing relative path segments such as dot-dot-slash (../), the underlying logic fails to normalize these paths securely before embedding them into the workbook structure. Consequently, instead of restricting access to files within the intended application context, the library allows the injection of arbitrary local file system references that resolve outside the expected directory boundaries.
From a technical perspective, this flaw enables an attacker to leverage the addMedia function to embed any file accessible by the Node.js process executing the ExcelJS library into the xl/media subdirectory of the generated workbook package. The Microsoft Office Open XML format used by Excel files stores media assets in a specific location within the zipped archive structure. By manipulating the path resolution logic, an attacker can cause the application to read sensitive local files and embed their contents directly into the output file. This mechanism effectively bypasses standard access controls because the vulnerability exploits the trust placed in the library's internal handling of file paths rather than requiring a breach of operating system permissions beyond what is already granted to the running process. The severity of this issue is compounded by its potential for remote exploitation if the vulnerable function is exposed through an API or web interface that accepts user-controlled input for image sources.
The operational impact of this vulnerability extends beyond simple data leakage, as it can serve as a stepping stone for more severe attacks such as server-side request forgery (SSRF) variants or further file system manipulation depending on the privileges of the Node.js process. If the application runs with elevated permissions, an attacker could potentially read configuration files containing database credentials, private keys, or other sensitive environment variables. Even in less privileged environments, the ability to exfiltrate local files can lead to significant confidentiality breaches and intellectual property theft. Furthermore, because ExcelJS is widely used for generating reports and data exports, this vulnerability affects a broad range of enterprise applications that rely on dynamic spreadsheet creation, making it a high-risk issue across multiple industries including finance, healthcare, and e-commerce where sensitive data processing is common.
To mitigate this risk, developers must immediately upgrade to a patched version of ExcelJS released after 4.4.0, which includes fixes for path traversal vulnerabilities in the image handling logic. In cases where upgrading is not immediately feasible, implementing strict input validation on all user-supplied file paths is essential. This should involve rejecting any input containing relative path sequences like ../ or ..\ and ensuring that resolved paths are strictly confined within a designated whitelist directory using canonicalization techniques provided by Node.js utilities such as fs.realpathSync. Additionally, applying the principle of least privilege to the Node.js process running ExcelJS can limit the scope of files an attacker might access even if they successfully exploit this vulnerability. Security teams should also audit their codebases for direct usage of addImage with user-controlled inputs and consider implementing allowlists for permitted file extensions or specific asset directories to further reduce the attack surface associated with dynamic media embedding features. This approach aligns with industry standards such as CWE-22, which classifies improper limitation of a pathname to a restricted directory, and addresses common exploitation patterns documented in MITRE ATT&CK under techniques related to data exfiltration via file system access.