{"id":"CVE-2026-44899","published":"2026-05-26T20:36:40Z","modified":"2026-05-27T13:31:02Z","title":"Mistune Image Directive CSS Injection Vulnerability","vendor":"lepture","product":"mistune","tier":"tail","description":{"text":"Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.2.1, the Image directive plugin validates the :width: and :height: options with a regex compiled as _num_re = re.compile(r\"^\\d+(?:\\.\\d*)?\"). 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. This vulnerability is fixed in 3.2.1.","provenance":"source","from":"CVE.org"},"cvss":{"score":4.7,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00228,"percentile":0.13848,"provenance":"source"},"cwes":[{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation"}],"references":[{"url":"https://github.com/lepture/mistune/security/advisories/GHSA-ccfx-mfmx-2fx9","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/lepture/mistune/releases/tag/v3.2.1","tags":["x_refsource_MISC"]}],"priority":{"score":6.1,"factors":[{"name":"EPSS percentile","points":2.77},{"name":"CVSS severity","points":3.29}]},"vendorSlug":"lepture","affectedVersions":[{"vendor":"lepture","product":"mistune","versions":["< 3.2.1"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2026-05-27T13:28:35.879099Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"mistune","vulnerableRanges":[">=3.2.0, <3.2.1","<3.2.1"],"patched":["3.2.1"],"from":["GHSA-ccfx-mfmx-2fx9","PYSEC-2026-2209"],"provenance":"source"}],"summary":{"text":"The Image directive plugin in lepture's mistune Python Markdown parser (versions prior to 3.2.1) validates its :width: and :height: options with a regex that only checks the leading digits, so any trailing content passes validation. That unescaped value is then written directly into a style attribute of the rendered image, allowing injected CSS to appear in the output. An attacker can exploit this over the network with no privileges, but a user must interact with the crafted content (such as viewing the rendered Markdown) for the injection to take effect.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:18:48Z"},"euvd":{"id":"EUVD-2026-31992","exploited":false,"provenance":"source"}}