# CVE-2026-44899: lepture Mistune CSS injection in Image directive plugin

Source: https://junglewise.ai/threats/cve-2026-44899-lepture-mistune-css-injection-in-image-directive-plugin  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-05-26. Updated: 2026-05-26  
License: CC BY 4.0 with a link back

CVE-2026-44899 · Severity: medium · CVSS 4.7 · Published 2026-05-26

Mistune is a Python library used to convert Markdown text into HTML. A vulnerability in its image processing plugin allows an attacker to inject malicious CSS code into a web page. This could be used to create deceptive overlays, such as fake login forms or phishing screens, that cover the legitimate content of a website.

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

## Quick answers

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

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

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

**Is there a fix for CVE-2026-44899?** 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-44899 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-44899?** 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

The Image directive plugin in Mistune uses a regular expression (`_num_re = re.compile(r"^\d+(?:\.\d*)?")`) that lacks an end-of-string anchor ($). Because validation is performed using `re.match()`, it only checks if the input starts with digits. If the input is not a plain integer (e.g., containing CSS units or malicious payloads), `render_block_image()` inserts the value directly into a `style` attribute without escaping. An attacker can provide a crafted `:width:` or `:height:` value containing a chain of CSS properties (e.g., `position:fixed; z-index:9999`). This allows for full-page UI redressing, phishing overlays, or other CSS-based attacks. The issue is fixed in version 3.2.1 by using a stricter regex.

## Affected products

- lepture mistune < 3.2.1

## Identifiers

- CVE-2026-44899
- GHSA-ccfx-mfmx-2fx9
- PYSEC-2026-2209

## Timeline

- 2026-05-03: patched: Version 3.2.1 released on GitHub.
- 2026-05-12: advisory: GitHub Security Advisory GHSA-ccfx-mfmx-2fx9 published.
- 2026-05-26: disclosed: CVE-2026-44899 published to NVD.

## References

- [https://github.com/lepture/mistune/releases/tag/v3.2.1](https://github.com/lepture/mistune/releases/tag/v3.2.1)
- [https://github.com/lepture/mistune/security/advisories/GHSA-ccfx-mfmx-2fx9](https://github.com/lepture/mistune/security/advisories/GHSA-ccfx-mfmx-2fx9)

## 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)
