Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. mistune
  4. ›
  5. CVE-2026-44899

CVE-2026-44899: Mistune Image Directive CSS Injection Vulnerability

May 14, 2026 (updated June 8, 2026)

The Image directive plugin validates the :width: and :height: options with a regex compiled as _num_re = re.compile(r"^\d+(?:\.\d*)?"). This pattern is applied via re.match() (which anchors only at the start of the string, not the end). Any value that begins with one or more digits passes validation, regardless of what follows.

When the validated value is not a plain integer, render_block_image() inserts it directly into a style="width:...;" or style="height:...;" attribute. Because the value was accepted by the prefix-only regex, any CSS after the leading digits reaches the style= attribute verbatim and without escaping.

An attacker can therefore inject an arbitrary chain of CSS properties — including position:fixed, background-color, z-index, outline, and opacity — using nothing more than a single :width: option in a fenced image directive. The resulting element can visually cover the entire browser viewport, enabling full-page phishing overlays and UI redressing attacks.

References

  • github.com/advisories/GHSA-ccfx-mfmx-2fx9
  • github.com/lepture/mistune/releases/tag/v3.2.1
  • github.com/lepture/mistune/security/advisories/GHSA-ccfx-mfmx-2fx9
  • nvd.nist.gov/vuln/detail/CVE-2026-44899

Code Behaviors & Features

Detect and mitigate CVE-2026-44899 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 3.2.0 before 3.2.1

Fixed versions

  • 3.2.1

Solution

Upgrade to version 3.2.1 or above.

Impact 4.7 MEDIUM

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

Learn more about CVSS

Weakness

  • CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Source file

pypi/mistune/CVE-2026-44899.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Tue, 23 Jun 2026 12:22:51 +0000.