Skip to content
PatchBriefing

Search PatchBriefing

Type at least two characters. Results update as you type.

Search CVEs, products, packages and article titles.

Nothing found. Identifiers such as CVE and GHSA can be searched in both languages.

Subscribe

Medium · 6.1 Node.js & npm GHSA-2rqm-h6hv-g79v

odf-kit XSS Vulnerability via Unescaped Style Attributes in odsToHtml()

odf-kit's odsToHtml() function fails to HTML-escape document-controlled style values, allowing a crafted .ods file to break out of a style attribute and inject arbitrary HTML/script. Fixed in 0.14.2.

By PatchBriefing ·

Produced automatically from official sources with the help of AI. How we work →

Synthesized by AI from 2 sources · updated 1 week ago

AI summary

A cross-site scripting (XSS) vulnerability has been identified in odf-kit, an npm package used to convert OpenDocument format files such as .ods spreadsheets into HTML. The issue affects the odsToHtml() conversion function, which is intended to produce HTML output for direct rendering in web pages.

What happened

odf-kit's odsToHtml() function, used to render ODS spreadsheet files as HTML, writes certain document-controlled values directly into HTML style attributes without escaping them. Two specific locations were affected: the inline style built from a cell's formatting properties (such as color, font size, font family, background color, and text alignment), and the row height value taken from the row's formatting. In both cases, a double-quote character inside the value can break out of the style attribute, allowing an attacker to inject arbitrary HTML and attributes into the rendered output.

Technical cause

The vulnerability is an instance of improper neutralization of input during web page generation (CWE-79, cross-site scripting). Two emission sites in the ODS-to-HTML renderer construct a style attribute string from document data without HTML-escaping it: a helper function that assembles inline CSS from cell formatting properties, and a separate location that emits the row height directly into the row element's style attribute. Because neither value is escaped, an attacker-controlled double quote in either value allows breaking out of the attribute context.

Why it matters

Any application that converts untrusted .ods files to HTML using odsToHtml() and then inserts that HTML into a page is exposed to script execution in the context of the host page's origin. This can lead to actions performed as the viewing user, session token theft, or other typical XSS impacts, depending on how the application handles rendered content.

Who is affected

Any project or service using the odf-kit npm package to render .ods spreadsheet files to HTML via odsToHtml(), where that output is inserted into a page as HTML rather than treated as plain text, and where the input .ods files may originate from untrusted sources.

Affected versions

odf-kit versions from 0.9.8 up to (not including) 0.14.2 are affected. The fact package notes that before version 0.14.0 the affected renderer file was located at a different internal path, but the vulnerability itself applies across this entire range.

Fixes and mitigation

The issue is fixed in odf-kit 0.14.2. The fix routes both affected emission sites (cell inline styles and row height) through a shared attribute-escaping helper, ensuring document-controlled values can no longer break out of the style attribute.

Recommended action

Upgrade odf-kit to version 0.14.2 or later. If immediate upgrading is not possible, avoid rendering odsToHtml() output from untrusted .ods files directly as HTML, or apply additional output sanitization before insertion into a page.

PatchBriefing score

6.1 / 10 · Medium

Official CVSS: 6.1

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Why this score

The PatchBriefing score equals the official CVSS score; when this article covers several vulnerabilities, the highest one. Signals such as known exploitation and EPSS are listed separately and do not change the score.

Affected versions

odf-kit ≥ 0.9.8 < 0.14.2
vulnerable
odf-kit >= 0.9.8, < 0.14.2
vulnerable
≥ 0.14.2
patched

Reported fixes

The issue is fixed in odf-kit 0.14.2. The fix routes both affected emission sites (cell inline styles and row height) through a shared attribute-escaping helper, ensuring document-controlled values can no longer break out of the style attribute.

How this was built

2 source records were collected, matched and used to prepare the report above.

  • GitHub Advisory Database database
  • OSV.dev database
Unified report
odf-kit XSS Vulnerability via Unescaped Style Attributes in odsToHtml()
1 article · 2 sources cited
Revision history
  1. Generated
  2. Published
  3. Generated
The Morning Brief

Relevant changes for the stacks you follow.

Choose your stacks, topics and optional WordPress plugins. At 07:00 CET, matching advisories and releases from the reporting period are grouped into one email.

✓ Choose stacks and topics✓ Change preferences anytime✓ One grouped email