exceljs-hardened@5.0.2

Unofficial security-hardened fork of exceljs, patching known unpatched vulnerabilities in the upstream (unmaintained) project. Not affiliated with the original exceljs maintainers.

  • latest version

    5.1.1

  • latest non vulnerable version

  • first published

    2 months ago

  • latest version published

    1 days ago

  • licenses detected

  • Direct Vulnerabilities

    Known vulnerabilities in the exceljs-hardened package. This does not include vulnerabilities belonging to this package’s dependencies.

    Fix vulnerabilities automatically

    Snyk's AI Trust Platform automatically finds the best upgrade path and integrates with your development workflows. Secure your code at zero cost.

    Fix for free
    VulnerabilityVulnerable Version
    • L
    Improper Encoding or Escaping of Output

    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.

    How to fix Improper Encoding or Escaping of Output?

    Upgrade exceljs-hardened to version 5.1.0 or higher.

    <5.1.0
    • H
    External Control of File Name or Path

    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.

    How to fix External Control of File Name or Path?

    Upgrade exceljs-hardened to version 5.1.0 or higher.

    <5.1.0
    • H
    Prototype Pollution

    Affected versions of this package are vulnerable to Prototype Pollution via mergeConditionalFormattings, which processes x14 conditional formatting rule IDs read directly from an xlsx file without sanitization. When an attacker supplies an x14:cfRule element with id="__proto__", the lookup resolves to Object.prototype, and the merge step copies every property of the extension rule onto it. Loading such a file with xlsx.load() permanently sets attacker-controlled string values on properties such as type, direction, border, and cfvo on every object in the Node.js process until it restarts.

    How to fix Prototype Pollution?

    Upgrade exceljs-hardened to version 5.1.0 or higher.

    <5.1.0
    • H
    Allocation of Resources Without Limits or Throttling

    Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling via xlsx.load() when parsing a workbook containing a worksheet <col> element with an unbounded max attribute. For each <col min max> entry, one Column object is allocated for every column index in the range, and the upper bound is not capped at the 16,384 columns Excel supports. An attacker can supply a file of a few kilobytes with max="300000000", causing the process to allocate hundreds of millions of Column objects and abort with a fatal V8 heap out-of-memory error that cannot be caught with try/catch.

    How to fix Allocation of Resources Without Limits or Throttling?

    Upgrade exceljs-hardened to version 5.1.0 or higher.

    <5.1.0
    • H
    Allocation of Resources Without Limits or Throttling

    Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling via unbounded image anchor column parsing in Worksheet.getColumn, triggered when an application reads image positions from a workbook. An attacker can embed a drawing XML file (xl/drawings/drawing1.xml) containing an arbitrarily large anchor column index (e.g. 300000000), causing getImages() to walk the column list up to that index and allocate millions of Column objects until the process aborts with a fatal V8 heap out-of-memory error. Because the abort is a fatal V8 error, it cannot be caught with try/catch, making the denial of service unrecoverable.

    How to fix Allocation of Resources Without Limits or Throttling?

    Upgrade exceljs-hardened to version 5.1.0 or higher.

    <5.1.0
    • H
    Unchecked Input for Loop Condition

    Affected versions of this package are vulnerable to Unchecked Input for Loop Condition via an unbounded sheetId value in xl/workbook.xml. Worksheets are stored in a sparse array indexed by their sheetId, so every access that walks the array - worksheets, getWorksheet(), and writeBuffer() - costs time proportional to the largest id present. An attacker can supply a workbook containing a sheetId up to the 32-bit limit, causing the event loop to stall for tens of seconds on each subsequent worksheet access or write operation, blocking all other request processing.

    How to fix Unchecked Input for Loop Condition?

    Upgrade exceljs-hardened to version 5.1.0 or higher.

    <5.1.0
    • H
    Allocation of Resources Without Limits or Throttling

    Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling via data-validations-xform.js when parsing a workbook containing an unbounded sqref range. Each address in a sqref range is stored individually in the validation model, so a range such as A1:XFD1048576 causes xlsx.load() to iterate approximately 17 billion entries, blocking the event loop and crashing the process with an uncatchable out-of-memory abort.

    How to fix Allocation of Resources Without Limits or Throttling?

    Upgrade exceljs-hardened to version 5.1.0 or higher.

    <5.1.0
    • H
    Incomplete Cleanup

    Affected versions of this package are vulnerable to Incomplete Cleanup via WorkbookReader.parse in the streaming XLSX reader, which fails to clean up temporary files and open file descriptors when sheet parsing fails or a consumer stops iterating early. An attacker can repeatedly upload malformed multi-sheet workbooks with worksheets placed before xl/sharedStrings.xml, causing temporary files and descriptors to accumulate until the temporary directory fills and the process can no longer open files or sockets (EMFILE).

    How to fix Incomplete Cleanup?

    Upgrade exceljs-hardened to version 5.1.0 or higher.

    <5.1.0
    • M
    Regular Expression Denial of Service (ReDoS)

    Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via slideFormula in lib/utils/shared-formula.js when translating shared formulas to child cells. An attacker can supply a spreadsheet containing a very long master formula (for example, a run of hyphens) that triggers quadratic regex backtracking, blocking the Node.js event loop for several seconds per affected cell read. The delay scales super-linearly with formula length and multiplies with the number of crafted cells in the workbook.

    How to fix Regular Expression Denial of Service (ReDoS)?

    Upgrade exceljs-hardened to version 5.1.0 or higher.

    <5.1.0
    • H
    Unchecked Input for Loop Condition

    Affected versions of this package are vulnerable to Unchecked Input for Loop Condition via unbounded r attribute parsing in row-xform.js, where rows are stored in a sparse array indexed by the row number supplied in an XLSX file. An attacker can supply an XLSX file containing a row numbered far beyond Excel's limit of 1,048,576, causing getSheetValues(), workbook writes, and CSV export to iterate up to that number and block the event loop for a duration proportional to the row number chosen.

    How to fix Unchecked Input for Loop Condition?

    Upgrade exceljs-hardened to version 5.1.0 or higher.

    <5.1.0
    • H
    Allocation of Resources Without Limits or Throttling

    Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling via Worksheet._parseMergeCells, which expands merged cell ranges read from a workbook file cell by cell into worksheet objects. An attacker can supply a workbook containing a mergeCell ref such as A1:XFD1048576, causing xlsx.load() to attempt to create billions of Row and Cell objects, exhausting all available heap memory. The resulting fatal V8 out-of-memory error aborts the entire Node.js process and cannot be caught with try/catch.

    How to fix Allocation of Resources Without Limits or Throttling?

    Upgrade exceljs-hardened to version 5.1.0 or higher.

    <5.1.0
    • H
    Prototype Pollution

    Affected versions of this package are vulnerable to Prototype Pollution via CellMatrix when loading a workbook with a defined name whose range targets a __proto__ sheet. An attacker can supply an xlsx file whose xl/workbook.xml contains a definedName referencing __proto__ as the sheet name, causing CellMatrix to write empty arrays onto Object.prototype process-wide when workbook.xlsx.load() runs. The polluted keys are the row numbers of the defined range, each holding an empty array, which persists for the lifetime of the Node.js process. Code that tests for key presence, iterates with for...in, or relies on a key being absent can be broken or bypassed.

    How to fix Prototype Pollution?

    Upgrade exceljs-hardened to version 5.1.0 or higher.

    <5.1.0
    • H
    Allocation of Resources Without Limits or Throttling

    Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling via DefinedNames.addEx, which expands cell ranges from xl/workbook.xml cell by cell into a matrix during xlsx.load(). A workbook containing a defined name that covers an entire sheet (e.g., $A$1:$XFD$1048576, approximately 17 billion cells) causes a fatal V8 heap out-of-memory error that cannot be caught with try/catch and terminates the entire Node.js process.

    How to fix Allocation of Resources Without Limits or Throttling?

    Upgrade exceljs-hardened to version 5.1.0 or higher.

    <5.1.0