Mistune is a Python Markdown parser with renderers and plugins. In 3.2.0 and realier, in src/mistune/directives/image.py, the render_figure() function concatenates figclass and figwidth options directly into HTML attributes without escaping. This allows attribute injection and XSS even when HTMLRenderer(escape=True) is used, because these values bypass the inline renderer.
Mistune Python Markdown parser versions 3.2.0 and earlier contain an XSS vulnerability in the render_figure() function where figclass and figwidth options are not properly escaped. This allows attackers to inject malicious HTML attributes and execute arbitrary JavaScript even when HTML escaping is enabled.
تحتوي دالة render_figure() في ملف src/mistune/directives/image.py على ثغرة حقن السمات حيث يتم دمج خيارات figclass و figwidth مباشرة في سمات HTML دون تجنب. هذا يسمح بتجاوز آليات الحماية من XSS حتى عند استخدام HTMLRenderer مع خيار escape=True.
مكتبة Mistune لمعالجة Markdown في Python الإصدار 3.2.0 وأقدم تحتوي على ثغرة XSS في دالة render_figure() حيث لا يتم تجنب خيارات figclass و figwidth بشكل صحيح. يسمح هذا للمهاجمين بحقن سمات HTML ضارة وتنفيذ JavaScript عشوائي حتى عند تفعيل تجنب HTML.
Update Mistune to version 3.2.1 or later. If immediate patching is not possible, implement additional HTML sanitization on figclass and figwidth parameters before passing them to the renderer, or disable figure directive processing until patched.
قم بتحديث Mistune إلى الإصدار 3.2.1 أو أحدث. إذا لم يكن التصحيح الفوري ممكناً، قم بتطبيق تنظيف HTML إضافي على معاملات figclass و figwidth قبل تمريرها إلى المعالج، أو قم بتعطيل معالجة توجيه الشكل حتى يتم التصحيح.