HTML injection in odf-kit ODS renderer enables cross-site scripting
Key facts
- Attack vector
- —
- Privileges required
- —
- User interaction
- —
- Attack complexity
- —
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- —
- Fix status
- Fixed
No CVSS vector from any source. Fix status from GitHub. Impact type from CWE-79.
Summary
odf-kit, an npm package, is affected from 0.9.8 before 0.14.2. Its ODS to-HTML renderer writes document-controlled style values into style attributes without HTML escaping, so a double quote in a crafted ODS file breaks out of the attribute (CWE-79). An attacker who supplies a crafted .ods file can inject arbitrary HTML and script when the output of odsToHtml() is inserted into a page as HTML.
Written with Claude Haiku 5.5 from the sources below · 2026-10-28
Description from the GitHub advisory
### Summary ODF style values are interpolated into `style="..."` attributes without HTML-escaping in odf-kit's ODS to-HTML renderer (`odsToHtml()`). A double-quote character inside an attacker-controlled style value breaks out of the attribute, allowing arbitrary HTML/attribute injection — and therefore script execution (XSS) — from a crafted `.ods` file wherever the rendered output is inserted as HTML, which is the documented purpose of the function. ### Details Two emission sites in `src/ods/to-html/html-renderer.ts` (before 0.14.0, `src/ods-reader/html-renderer.ts`) write document-controlled values into a `style` attribute without escaping: - **Cell style.** `buildInlineStyle()` assembles a CSS string from the cell's formatting properties (`fo:color`, `fo:font-size`, `fo:font-family`, `fo:background-color`, `fo:text-align`, etc.) with no escaping, and `renderCell` emits it raw as the cell's `style` attribute. - **Row height.** `row.height` (from `style:row-height`) is emitted raw into the row element's `style` attribute. The same defect in the ODT renderer (`odtToHtml()`) is tracked as GHSA-3cgg-c5pp-57h6 (CVE-2026-113787). ### Impact Any consumer that renders `odsToHtml()` output as HTML gets XSS from a crafted `.ods` file they convert: untrusted file → arbitrary tags and attributes → script execution in the host page with the page's origin. ### Patches Fixed in 0.14.2. Both sites now route document-controlled values through a shared attribute-escaping helper: - [`1424227`](https://github.com/GitHubNewbie0/odf-kit/commit/1424227d1ca2716a249b623d1456575ff0331dcc): escape style attribute values in the ODS HTML renderer - [`aa64c73`](https://github.com/GitHubNewbie0/odf-kit/commit/aa64c734ebd7e7be40e35fcda83b1144193c3da2): the shared `escapeAttr` helper Users should upgrade to 0.14.2 or later. ### Credit Reported by @PethuKannan.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | odf-kit (npm) | 0.9.8 to before 0.14.2 | 0.14.2 | Patch available | GHSA-2rqm-h6hv-g79v |
- odf-kit (npm) Vendor— Affected 0.9.8 to before 0.14.2 Fixed in 0.14.2 Patch available GHSA-2rqm-h6hv-g79v
Remediation
Upgrade odf-kit to version 0.14.2 or later, which escapes style attribute values in the ODS HTML renderer.
Written with Claude Haiku 5.5 from the sources below · 2026-10-28
- Fix · GHSA-2rqm-h6hv-g79v odf-kit (npm) Fixed in 0.14.2 Advisory →
Timeline
- 2026-10-23 Threatist record created from GHSA-2rqm-h6hv-g79v
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences