The vulnerability described is a stored Cross-Site Scripting (XSS) issue in the 'color mode' preference of Statamic CMS. The advisory states this is fixed in version 6.6.2. By comparing the git tags for versions 6.6.1 and 6.6.2, I identified the relevant commit that patches the vulnerability. The commit 8f1ea9ff8000de090c7406a80bb5aa273eda4e0f, titled '[6.x] Fix color mode preference values', directly addresses the issue. The patch modifies the preferredColorMode function within the src/Auth/User.php file. Previously, the function returned the user's preference value directly. The fix introduces a check to ensure the value is one of the expected safe values ('auto', 'light', 'dark'), otherwise defaulting to 'auto'. This change clearly indicates that the preferredColorMode function was the source of the vulnerability, as it was responsible for processing and returning the potentially malicious input without proper sanitization.