npm
CVE-2026-113787
odf-kit: HTML injection leading to XSS in odtToHtml() and odsToHtml() via unescaped style attribute values
- Severity
- Medium 6.1
- Published
- 4 Nov 2026
- Last changed
- 4 Nov 2026
- Added to UpHeron
- 23 Nov 2026
- Fixed in
- 0.14.2
- Exploit chance
- 0.2% in the next 30 daysHigher than 15% of CVEs. EPSS by FIRST, 24 Nov 2026
- Weakness
- Cross-site scripting (CWE-79)
- Attack
- Over the network · No login needed · Needs someone to click or open something
- Attacker can
- Read some data · Change some data
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N- Also known as
- GHSA-3cgg-c5pp-57h6
- Sources
- OSV.dev and GitHub
Description
ODF style attribute values are interpolated into style="..." attributes without HTML-escaping in both of odf-kit's to-HTML renderers (odtToHtml and 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 .odt or .ods file wherever the rendered output is inserted as HTML, which is the documented purpose of both functions.
The renderer has an escapeHtml() helper and applies it consistently to text content and to attribute values — href, src, alt, id, data-author, data-date, citation text all go through it. The inline CSS strings do not.
In renderTextSpan (dist/odt/to-html/html-renderer.js:195):
The value of e.g. fo:color is copied from the document into style.fontColor verbatim by the parser (extractSpanStyle, read/parser.js:348), then concatenated raw into the attribute. A " in the value terminates the attribute early.
Affected software
| Software | Affected versions |
|---|---|
odf-kitnpm · osv:npm:odf-kit |
|
About odf-kit
- Weekly downloads (npm)
- 26,862npm, 24 Nov 2026
This is the only vulnerability in odf-kit in our list.
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-113787
- GitHub Advisory Database https://github.com/advisories/GHSA-3cgg-c5pp-57h6