CraftCMS
cpe:2.3:a:craftcms:craft_cms:*:*:*:*:*:*:*
- >= 5.0.0-RC1, <= 5.8.21
- >= 4.0.0-RC1, <= 4.16.17
A stored cross-site scripting (XSS) vulnerability has been identified in Craft CMS versions 4.0.0-RC1 through 4.16.17 and 5.0.0-RC1 through 5.8.21. The issue resides in the Number field type settings, where the Prefix and Suffix fields are processed with the raw Twig filter without adequate escaping. This flaw enables script execution when the Number field is displayed on user profiles. The vulnerability has been patched in Craft CMS versions 4.16.18 and 5.8.22.
Exploitation of this vulnerability allows for stored cross-site scripting, where injected scripts are executed in the context of the user viewing the affected profile.
To reproduce this vulnerability, log in with an admin account and navigate to the field settings. Create a new Number field and enter a script-injecting image tag in the Prefix or Suffix Text field. After saving the field, add it to a user profile. The injected script will execute when the profile is viewed.
Users can update to Craft CMS versions 4.16.18 or 5.8.22 to address this vulnerability.
Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.