The vulnerability is a stored Cross-Site Scripting (XSS) issue in the 'Number' field type of Craft CMS. The root cause is the improper handling of user-provided 'Prefix' and 'Suffix' text in the field's settings. The provided patch, commit cb5fb0e979e72f315c9178fc031883d49527f513, directly points to the source of the vulnerability in the Twig template src/templates/_components/fieldtypes/Number/input.twig. The patch shows that the prefix and suffix variables were being rendered using |md(inlineOnly=true)|raw, which allows for raw HTML output. The fix involves adding encode=true to the md filter, which sanitizes the input.
While the flaw is in the template, the function that would appear in a runtime profile during exploitation is the one that renders this template. In Craft CMS, each field type has a corresponding class that handles its behavior, including how its input is rendered. For the 'Number' field, this is the craft\fields\Number class. The method responsible for generating the input HTML is getInputHtml(). This function takes the field's settings, including the potentially malicious prefix and suffix, and passes them to the vulnerable Twig template for rendering. Therefore, craft\fields\Number::getInputHtml is the key function that facilitates the XSS vulnerability.