Skip to content

Stored XSS in Number Prefix & Suffix Fields

Low
angrybrad published GHSA-9f5h-mmq6-2x78 Feb 9, 2026

Package

composer craftcms/cms (Composer)

Affected versions

>= 5.0.0-RC1, <= 5.8.21
>= 4.0.0-RC1, <= 4.16.17

Patched versions

5.8.22
4.16.18

Description

Summary

A stored XSS vulnerability exists in the Number field type settings. The Prefix and Suffix fields are rendered using the |md|raw Twig filter without proper escaping, allowing script execution when the Number field is displayed on users' profiles.

Proof of Concept

Required Permissions

Steps to Reproduce

  1. Log in with an admin account
  2. Navigate to SettingsFieldsNew field
  3. Choose Number as the field type
  4. Set the Prefix/Suffix Text field to: image
<img src=x onerror="alert('Number Prefix/Suffix XSS')" hidden>
  1. Save the field
  2. Add this field to any element (e.g., User Profile fields via SettingsUsersUser Fields)
  3. Navigate to your account (/admin/myaccount) or any user profile (/admin/users/{id})
  4. XSS executes when viewing the form image-1

Mitigation

Sanitize prefix/suffix before rendering or use |e filter instead of |raw.

References

cb5fb0e

Severity

Low

CVE ID

CVE-2026-25496

Weaknesses

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. Learn more on MITRE.

Credits