The vulnerability stems from insufficient URL protocol validation in two key areas:
In nodebb-plugin-markdown's pre-patch code, the absence of a custom validateLink function allowed dangerous protocols. The commit ab7f268 introduced protocol checks, confirming this was missing previously.
The underlying markdown-it library (before f76d3be) had incomplete validation for data: URLs, as shown in its commit diff adding MIME-type restrictions. NodeBB's dependency on an unpatched markdown-it version propagated this flaw.
Both functions directly control URL sanitization during Markdown-to-HTML conversion, making them root causes for the XSS vectors described.