# CVE-2026-104250: unstructured library stored XSS via unescaped HTML generation

Source: https://junglewise.ai/threats/cve-2026-104250-unstructured-stored-xss-via-unescaped-html-generation  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-10-13. Updated: 2026-10-15  
License: CC BY 4.0 with a link back

CVE-2026-104250 · Severity: medium · CVSS 6.1 · Published 2026-10-13

The unstructured library processes documents and generates HTML output, but fails to escape malicious markup embedded in input documents. When a user views HTML generated from an untrusted document in a web browser, embedded scripts execute automatically or on user interaction, potentially allowing an attacker to steal credentials, session tokens, or other sensitive data from the viewer's session.

Technologies: [unstructured (PyPI)](https://junglewise.ai/threats/technologies/unstructured). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2026-104250 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-104250 being exploited in the wild.

**How severe is CVE-2026-104250?** Medium severity, with a CVSS score of 6.1, published 13 October 2026.

**Which products and versions are affected?** unstructured (PyPI) <= 0.24.0, ECOSYSTEM:introduced=0,fixed=0.24.1; Unstructured-Io Unstructured 0.23.3 and likely earlier.

**Is there a fix for CVE-2026-104250?** Yes. unstructured (PyPI): upgrade to 0.24.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-104250 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-104250?** Check whether you run unstructured (PyPI) or Unstructured-Io Unstructured at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- unstructured (PyPI): upgrade to 0.24.1 or later

  ```sh
  pip install "unstructured>=0.24.1"
  ```


## Technical details

The `to_html()` function in `documents/ontology.py` performs no HTML escaping when converting parsed document elements to HTML output, leaving event handler attributes (e.g., `onerror`, `onmouseover`), `javascript:` URL schemes, and other malicious markup from input documents unescaped. An attacker can embed payloads like `<img src=x onerror="...">` or `<a href="javascript:...">` in a document submitted to an ingestion pipeline; when a downstream user renders the generated HTML, the payload executes with no user interaction required for image-based vectors.

## Affected products

- unstructured-io unstructured 0.23.3 and likely earlier

## Identifiers

- CVE-2026-104250
- GHSA-v5mq-3xhg-98m9

## Timeline

- 2026-10-15: disclosed

## Related threats

- [Unstructured partition server-side request forgery](https://junglewise.ai/threats/cve-2026-71428-unstructured-partition-server-side-request-forgery)
- [PYSEC-2026-558 - Unstructured has Path Traversal via Malicious MSG Attachment that Allows Arbitrary File Write](https://junglewise.ai/threats/cve-2025-64712-unstructured-has-path-traversal-via-malicious-msg-attachment-that)
- [GO-2024-3315 - in github.com/Unstructured-IO/unstructured](https://junglewise.ai/threats/cve-2024-46455-unstructured-xml-external-entity-injection-in-xmlparser)
