The vulnerability exists because the Prompt module in DNN Platform did not properly handle output that was intended to be rendered as HTML. Commands within the module could return data that, if crafted by a malicious user, would execute scripts in the browser of a privileged user viewing the output. The investigation of the commits between the last vulnerable version and the first patched version revealed that the core of the fix was to introduce a mechanism to flag output as HTML and then to sanitize it using dompurify before rendering. The ConsoleResultModel constructor and the ListModules.Run method are highlighted as they are central to the vulnerability. The ConsoleResultModel is the data structure that carries the output, and its original implementation was flawed. The ListModules.Run method is an example of a command that produces HTML output and was therefore a vector for the XSS attack. The changes in the patch clearly show the introduction of sanitization and the explicit handling of HTML content, which directly address the root cause of the vulnerability.