The analysis began by identifying the relevant patch from the commit history between the last vulnerable version (v3.6.1) and the first patched version (v3.6.2). The commit a1d2d0f1b02f87a804c84b2d964478dc6c2fb67f was identified as the security fix, as its commit message directly references the GHSA ID of the vulnerability.
An examination of this commit revealed that a new sanitization function, util.SanitizeImgSrc, was introduced in kernel/util/misc.go. This function uses the bluemonday library to clean image source URLs.
The patch then applies this new sanitization function in two key locations: kernel/sql/av_gallery.go and kernel/sql/av_kanban.go. Specifically, the lines asset.Content = util.SanitizeImgSrc(asset.Content) were added within the fillAttributeViewGalleryCardCover and fillAttributeViewKanbanCardCover functions, respectively.
This indicates that these two functions were the points of vulnerability. They were responsible for taking potentially malicious user input (asset.Content) and preparing it for rendering as a cover image URL. Before the patch, this was done without sanitization, leading to a stored XSS vulnerability. The vulnerability description confirms this flow, stating that asset.Content is copied directly to galleryCard.CoverURL or kanbanCard.CoverURL and then injected into an <img> tag without escaping. Therefore, fillAttributeViewGalleryCardCover and fillAttributeViewKanbanCardCover are the identified vulnerable functions.