PatchSiren

PatchSiren cyber security CVE debrief

CVE-2026-44899 lepture CVE debrief

A cross-site scripting (XSS) vulnerability exists in the Mistune Python Markdown parser prior to version 3.2.1. The Image directive plugin uses a permissive regular expression (`^d+(?:.d*)?`) to validate `:width:` and `:height:` options, accepting any string that begins with digits. When a non-integer value passes this check, `render_block_image()` inserts it unescaped into a `style` attribute. An attacker can inject arbitrary CSS and JavaScript by crafting a width or height value that starts with digits followed by malicious payload, such as `100px; background-image: url('javascript:alert(1)')` or similar style-based injection vectors. The vulnerability requires user interaction (rendering malicious Markdown) and can affect downstream web applications that display parsed content without additional sanitization. The CVSS 3.1 score of 4.7 (Medium) reflects network attack vector, low attack complexity, no required privileges, required user interaction, changed scope, and low confidentiality impact with no integrity or availability impact.

Vendor
lepture
Product
mistune
CVSS
MEDIUM 4.7
CISA KEV
Not listed in stored evidence
Original CVE published
2026-05-26
Original CVE updated
2026-07-23
Advisory published
2026-05-26
Advisory updated
2026-07-23

Who should care

Organizations using Mistune to render untrusted Markdown content in web applications; security teams monitoring Python package dependencies; developers implementing Markdown processing pipelines; compliance teams tracking XSS remediation in content management systems

Technical summary

The vulnerability stems from a prefix-only regular expression validation in `mistune/directives/image.py`. The `_num_re` pattern `^d+(?:.d*)?` accepts strings beginning with numeric characters without enforcing complete match or sanitizing trailing content. When `render_block_image()` constructs HTML output, validated values are interpolated directly into `style` attributes without HTML entity encoding or CSS escaping. This permits injection of arbitrary CSS properties and potentially JavaScript execution through style-based vectors. The fix in 3.2.1 likely implements stricter validation or proper escaping of directive option values.

Defensive priority

medium

Recommended defensive actions

  • Upgrade Mistune to version 3.2.1 or later to obtain the security fix
  • Review applications rendering user-supplied Markdown with Mistune for suspicious image directives containing style-breaking payloads
  • Implement Content Security Policy (CSP) headers to mitigate impact of style-based injection vectors
  • Consider additional output encoding or HTML sanitization layers for rendered Markdown content in security-sensitive contexts
  • Audit logs for unusual image directive parameters containing semicolons, parentheses, or JavaScript protocol handlers in width/height fields

Evidence notes

Vulnerability confirmed through GitHub Security Advisory GHSA-ccfx-mfmx-2fx9 and Mistune release notes. The fix in version 3.2.1 addresses the insufficient input validation. CWE-79 (Improper Neutralization of Input During Web Page Generation) classified as primary weakness. No known exploitation in the wild as of CVE publication date.

Sources and references

Verified primary and authoritative sources

  • CVE-2026-44899 CVE Program record

    Publisher, destination, and source semantics verified

    URL: https://www.cve.org/CVERecord?id=CVE-2026-44899

    CVE Program - Official CVE Program record with source-provided CVE metadata.

  • CVE-2026-44899 NVD vulnerability detail

    Publisher, destination, and source semantics verified

    URL: https://nvd.nist.gov/vuln/detail/CVE-2026-44899

    NIST National Vulnerability Database - Official NIST NVD detail page and source-specific vulnerability assessment.

Supplemental references

Methodology and review provenance

AI-assisted synthesis based on stored public vulnerability evidence. System validation, approval state, and publication status do not by themselves establish human review of this revision. PatchSiren helps prioritize defensive review and does not prove exposure or remediation on any system.