# CVE-2026-44896: lepture Mistune XSS in Figure directive image attributes

Source: https://junglewise.ai/threats/cve-2026-44896-lepture-mistune-xss-in-figure-directive-image-attributes  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-05-26. Updated: 2026-06-09  
License: CC BY 4.0 with a link back

CVE-2026-44896 · Severity: medium · CVSS 6.1 · Published 2026-05-26

Mistune is a popular Python library used to convert Markdown text into HTML. A security flaw in how it handles image figures allows an attacker to inject malicious scripts into web pages. If a user views a page containing specially crafted Markdown, the attacker could potentially steal session information or perform actions on the user's behalf.

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

## Quick answers

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

**How severe is CVE-2026-44896?** Medium severity, with a CVSS score of 6.1, published 26 May 2026.

**Which products and versions are affected?** mistune (PyPI) <= 3.2.0, ECOSYSTEM:introduced=0,fixed=3.2.1.

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

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

**Am I affected by CVE-2026-44896?** Check whether you run mistune (PyPI) 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

- mistune (PyPI): upgrade to 3.2.1 or later

  ```sh
  pip install "mistune>=3.2.1"
  ```


## Technical details

A cross-site scripting (XSS) vulnerability exists in Mistune's `render_figure()` function within `src/mistune/directives/image.py`. The function fails to escape the `figclass` and `figwidth` options before concatenating them into HTML attributes, leading to attribute injection. This bypasses the standard `HTMLRenderer(escape=True)` setting because these specific directive values are handled outside the primary inline renderer. An attacker can exploit this by providing a malicious Markdown figure directive that includes JavaScript or other malicious HTML attributes. The issue is fixed in version 3.2.1.

## Affected products

- lepture mistune <= 3.2.0

## Identifiers

- CVE-2026-44896
- GHSA-58cw-g322-p94v
- PYSEC-2026-168

## Timeline

- 2026-05-06: disclosed
- 2026-05-08: advisory: GitHub Advisory published
- 2026-05-26: advisory: NVD published

## References

- [https://api.github.com/users/sergeykochanov](https://api.github.com/users/sergeykochanov)
- [https://github.com/sergeykochanov](https://github.com/sergeykochanov)
- [https://api.github.com/users/sergeykochanov/gists%7B/gist_id%7D](https://api.github.com/users/sergeykochanov/gists%7B/gist_id%7D)
- [https://api.github.com/users/sergeykochanov/repos](https://api.github.com/users/sergeykochanov/repos)
- [https://avatars.githubusercontent.com/u/47022537?v=4](https://avatars.githubusercontent.com/u/47022537?v=4)
- [https://api.github.com/users/sergeykochanov/events%7B/privacy%7D](https://api.github.com/users/sergeykochanov/events%7B/privacy%7D)

## Related threats

- [Mistune path traversal and XSS in Include directive](https://junglewise.ai/threats/duplicate-advisory-mistune-path-traversal-and-xss-in-include-directive-bf25c187)
- [Mistune path traversal and XSS in Include directive](https://junglewise.ai/threats/cve-2026-115355-mistune-before-3-3-0-contains-a-path-traversal-vulnerability-in)
- [Mistune uncontrolled recursion in HTML rendering](https://junglewise.ai/threats/cve-2026-76098-mistune-uncontrolled-recursion-in-html-rendering)
- [lepture Mistune predictable ID generation in TOC plugin](https://junglewise.ai/threats/cve-2026-59930-lepture-mistune-predictable-id-generation-in-toc-plugin)
- [lepture mistune XSS via incomplete URL scheme filtering in HTML renderer](https://junglewise.ai/threats/cve-2026-59929-lepture-mistune-xss-via-incomplete-url-scheme-filtering-in-html)
