The vulnerability is a stored XSS caused by the inline rendering of user-uploaded SVG files. The vulnerability description explicitly mentions that 'SVG attachments are rendered inline instead of being forced as a download'. The recommended mitigation is to 'Serve attachments with Content-Disposition: attachment to prevent inline rendering'.
By analyzing the commits between the last vulnerable version (0.24.6) and the first patched version (v2.0.0), I identified commit 4915f535d0a815698ce1af43491b13b6683ec527. This commit directly addresses the issue.
The commit modified the GetTaskAttachment function in pkg/routes/api/v1/task_attachment.go. The patch changes the Content-Disposition header from inline to attachment. This change prevents the browser from rendering the SVG file and instead prompts the user to download it, thus mitigating the stored XSS vulnerability.
The vulnerable function is therefore GetTaskAttachment, as it was the function responsible for serving the malicious file with the insecure header. Other commits I analyzed (329c07f24b27b0238aa0bd02ae9b4003b13387d4 and d222d4502acdf9d235880d3675d2dcf7f18e1d85) are related follow-up fixes to the same function and header, confirming that this was the area of the code containing the vulnerability.