{"schema":"threatline.record/2","record":{"id":"GHSA-2rqm-h6hv-g79v","aliases":["GHSA-2rqm-h6hv-g79v"],"summary":"odf-kit has HTML injection leading to XSS in odsToHtml() via unescaped style attribute values","details":"### Summary\n\nODF 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.\n\n### Details\n\nTwo 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:\n\n- **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.\n- **Row height.** `row.height` (from `style:row-height`) is emitted raw into the row element's `style` attribute.\n\nThe same defect in the ODT renderer (`odtToHtml()`) is tracked as GHSA-3cgg-c5pp-57h6 (CVE-2026-113787).\n\n### Impact\n\nAny 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.\n\n### Patches\n\nFixed in 0.14.2. Both sites now route document-controlled values through a shared attribute-escaping helper:\n\n- [`1424227`](https://github.com/GitHubNewbie0/odf-kit/commit/1424227d1ca2716a249b623d1456575ff0331dcc): escape style attribute values in the ODS HTML renderer\n- [`aa64c73`](https://github.com/GitHubNewbie0/odf-kit/commit/aa64c734ebd7e7be40e35fcda83b1144193c3da2): the shared `escapeAttr` helper\n\nUsers should upgrade to 0.14.2 or later.\n\n### Credit\n\nReported by @PethuKannan.","categories":["Libraries & packages"],"product":"odf-kit","vendor":"","ecosystem":"npm","affected_ranges":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-2rqm-h6hv-g79v","source_modified_at":"2026-10-23T20:55:33Z","fetched_at":"2026-10-23T21:10:45.942435Z","package":{"ecosystem":"npm","name":"odf-kit"},"range":">= 0.9.8, < 0.14.2"},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-2rqm-h6hv-g79v","source_modified_at":"2026-10-23T21:00:05.237565089Z","fetched_at":"2026-10-23T21:10:45.942435Z","package":{"name":"odf-kit","ecosystem":"npm","purl":"pkg:npm/odf-kit"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.9.8"},{"fixed":"0.14.2"}]}],"versions":[]}],"fixed_versions":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-2rqm-h6hv-g79v","source_modified_at":"2026-10-23T20:55:33Z","fetched_at":"2026-10-23T21:10:45.942435Z","package":{"ecosystem":"npm","name":"odf-kit"},"version":"0.14.2"},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-2rqm-h6hv-g79v","source_modified_at":"2026-10-23T21:00:05.237565089Z","fetched_at":"2026-10-23T21:10:45.942435Z","package":{"name":"odf-kit","ecosystem":"npm","purl":"pkg:npm/odf-kit"},"version":"0.14.2"}],"cvss":6.1,"severity":"Medium","kev":{"listed":false},"epss":{"probability":null,"percentile":null,"score_date":null},"published_at":"2026-10-23T20:55:31Z","modified_at":"2026-10-23T21:00:05.237565089Z","provenance":[{"source":"GitHub Advisory Database","url":"https://github.com/advisories/GHSA-2rqm-h6hv-g79v","fetched_at":"2026-10-23T21:10:45.942435Z","source_modified_at":"2026-10-23T20:55:33Z"},{"source":"OSV","url":"https://osv.dev/vulnerability/GHSA-2rqm-h6hv-g79v","fetched_at":"2026-10-23T21:10:45.942435Z","source_modified_at":"2026-10-23T21:00:05.237565089Z"}],"sources":["GitHub Advisory Database","OSV"],"references":[{"url":"https://github.com/GitHubNewbie0/odf-kit/security/advisories/GHSA-2rqm-h6hv-g79v","source":"GitHub Advisory Database"},{"url":"https://github.com/GitHubNewbie0/odf-kit/commit/1424227d1ca2716a249b623d1456575ff0331dcc","source":"GitHub Advisory Database"},{"url":"https://github.com/advisories/GHSA-2rqm-h6hv-g79v","source":"GitHub Advisory Database"}],"locations":[],"motoko_assessment":{"status":"requires_architecture_review","automatic_remediation":false},"classification":{"method":"product-first software-layer rules","rules_version":"2.1","matched_on":"ecosystem","confidence":"heuristic","reviewed":false},"change_timestamp":"2026-10-23T21:00:05.237565089Z","content_hash":"8ad4933a5cf1d3f2fefef65a9b4a0d1153b2fc056ccd26ce3b002958fbdcd75d"}}
