GHSA-2rqm-h6hv-g79v
odf-kit has HTML injection leading to XSS in odsToHtml() via unescaped style attribute values
GHSA-2rqm-h6hv-g79v is a medium vulnerability (CVSS 6.1) in odf-kit, published October 23, 2026. No source lists public exploit code. Fixed in odf-kit 0.14.2.
- Severity
- 6.1 MediumCVSS 3.1, GitHub Advisories
- Exploit chance
- UnscoredNo EPSS score yet
- Exploitation
- None knownNot on CISA’s or ENISA’s lists
- Fixed in
0.14.2odf-kit
Description
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, andrenderCellemits it raw as the cell'sstyleattribute. - Row height.
row.height(fromstyle:row-height) is emitted raw into the row element'sstyleattribute.
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: escape style attribute values in the ODS HTML rendereraa64c73: the sharedescapeAttrhelper
Users should upgrade to 0.14.2 or later.
Credit
Reported by @PethuKannan.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- Required
What an attacker can affect
- Confidentiality
- Low
- Integrity
- Low
- Availability
- None
Affected packages
| Package | Affected | Fixed |
|---|---|---|
odf-kitnpm | 0.9.8 up to 0.14.2 | 0.14.2 |
What each source reports
GitHub Advisories Score used 6.1
odf-kit has HTML injection leading to XSS in odsToHtml() via unescaped style attribute values
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, andrenderCellemits it raw as the cell'sstyleattribute. - Row height.
row.height(fromstyle:row-height) is emitted raw into the row element'sstyleattribute.
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: escape style attribute values in the ODS HTML rendereraa64c73: the sharedescapeAttrhelper
Users should upgrade to 0.14.2 or later.
Credit
Reported by @PethuKannan.
- Record
GHSA-2rqm-h6hv-g79v- CVSS 3.1
- 6.1 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
OSV 6.1
odf-kit has HTML injection leading to XSS in odsToHtml() via unescaped style attribute values
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, andrenderCellemits it raw as the cell'sstyleattribute. - Row height.
row.height(fromstyle:row-height) is emitted raw into the row element'sstyleattribute.
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: escape style attribute values in the ODS HTML rendereraa64c73: the sharedescapeAttrhelper
Users should upgrade to 0.14.2 or later.
Credit
Reported by @PethuKannan.
- Record
GHSA-2rqm-h6hv-g79v- CVSS 3.1
- 6.1 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | GitHub Advisories, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.