HTML injection leading to XSS in odf-kit odtToHtml()
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- Low · Low · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-79.
Summary
odf-kit versions from 0.6.0 before 0.14.2 do not escape values of inline CSS style attributes when rendering ODT documents to HTML. A crafted style value such as a font color containing a double quote ends the attribute early, which causes HTML injection and cross-site scripting (CWE-79). An unauthenticated remote attacker needs a victim to view or open a crafted document, and the attack requires user interaction.
Written with Claude Haiku 5.5 from the sources below · 2026-11-04
Description from the CNA
odf-kit allows users to generate, fill, read, and convert OpenDocument Format files (.odt, .ods) in TypeScript and JavaScript. Starting in version 0.6.0 and prior to version 0.14.2, he 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. The same unescaped `style="${...}"` pattern appears at roughly ten other emission sites: paragraph and heading (`paragraphStyleToCss`), table cells and rows (`cellStyleToCss`, `rowStyleToCss`), `<col>`, and the image style attribute. The affected source attributes include `fo:color`, `fo:background-color`, `fo:text-shadow`, `fo:letter-spacing`, `fo:font-family` (via both direct and font-face resolution), `fo:margin-*`, `fo:padding-*`, `fo:line-height`, `fo:border*`, and `style:vertical-align`. Version 0.14.2 contains a patch.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| GitHubNewbie0 | odf-kit | 0.6.0 to before 0.14.2 | 0.14.2 | Patch available | CNA |
| — | odf-kit (npm) | 0.6.0 to before 0.14.2 | 0.14.2 | Patch available | GHSA-3cgg-c5pp-57h6 |
- odf-kit VendorGitHubNewbie0 Affected 0.6.0 to before 0.14.2 Fixed in 0.14.2 Patch available CNA
- odf-kit (npm) Vendor— Affected 0.6.0 to before 0.14.2 Fixed in 0.14.2 Patch available GHSA-3cgg-c5pp-57h6
Remediation
Update odf-kit to version 0.14.2, which escapes the style attribute values.
Written with Claude Haiku 5.5 from the sources below · 2026-11-04
- Fix · CNA odf-kit (GitHubNewbie0) Fixed in 0.14.2
- Fix · GHSA-3cgg-c5pp-57h6 odf-kit (npm) Fixed in 0.14.2 Advisory →
Timeline
- 2026-10-21 Threatist record created from CVE-2026-113787
- 2026-10-21 Affected versions changed · CNA
- 2026-10-23 Priority changed: MEDIUM → LOW
- 2026-10-30 CISA SSVC decision points changed
- 2026-10-30 Priority changed: LOW → MEDIUM
- 2026-11-04 Alias added: GHSA-3cgg-c5pp-57h6
- 2026-11-04 Fix available: npm/[email protected] · GHSA-3cgg-c5pp-57h6
- 2026-11-04 CVSS score added · GHSA-3cgg-c5pp-57h6
- 2026-11-04 Weakness changed · GHSA-3cgg-c5pp-57h6
- 2026-11-04 5 new references · GHSA-3cgg-c5pp-57h6
References
Sources
- CVE-2026-113787 · CVE Program
- CVE-2026-113787 · NVD
- FIRST EPSS
- GHSA-3cgg-c5pp-57h6 · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences