The vulnerability exists in the mistune math plugin, where the render_inline_math and render_block_math functions fail to escape user-provided input before rendering it into HTML. The core of the issue is that these functions directly concatenate the text variable, which contains raw content from the markdown, into the final HTML string. This occurs even when the main markdown parser is initialized with escape=True, as the math plugin's rendering path does not adhere to this setting. As a result, any HTML or script tags provided within math delimiters ($...$ or $$...$$) are rendered as-is by the browser, leading to a cross-site scripting (XSS) vulnerability. An attacker can exploit this to execute arbitrary JavaScript in the victim's browser, potentially stealing cookies, session tokens, or performing actions on their behalf.