The vulnerability lies in Hugo's handling of content files, where files with a text/html media type were rendered without sanitization, creating a stored XSS risk. The root cause was the absence of a security check to control which content types could be rendered as-is. The fix, introduced in commit e41a06447daa3071a01f333fdcec0a5153c3c8d1, implements a security policy (security.allowContent) that denies text/html by default. This policy is enforced within the pageMetaSource.initFrontMatter function in hugolib/page__meta.go. Before the patch, this function would process content regardless of its type. The patch modifies initFrontMatter to call CheckAllowedContent, a new function that validates the media type against the security policy. Therefore, pageMetaSource.initFrontMatter is the critical function in the execution flow that, in vulnerable versions, would initiate the processing of malicious HTML content.