The vulnerability exists because user-supplied descriptions for timesheets were rendered as HTML without proper sanitization, allowing for persistent cross-site scripting (XSS). The analysis of the patch commit a0e8aa3a435717187fb12210242dab1b7c97ff3f reveals the root cause. The function App\Twig\MarkdownExtension::markdownToHtml was using a markdown-to-HTML converter with a setting that allowed raw HTML to be processed. This function was called by App\Twig\MarkdownExtension::timesheetContent, which is registered as the desc2html filter in the Twig templating engine. Multiple Twig templates used this filter to render the timesheet description ({{ entry.description|desc2html }}). An attacker could save a malicious payload (like an SVG with embedded JavaScript) in a timesheet description, which would then be executed in the browser of any user viewing that timesheet. The fix involves two parts: first, changing the markdownToHtml function to disallow raw HTML, and second, adding the escape filter in the Twig templates ({{ entry.description|escape|desc2html }}) as an additional layer of defense.