CVE-2026-25496
JSON

4.8medium

Craft has a stored XSS in Number Prefix & Suffix Fields

Severity
4.8medium CVSS:4.0 by GitHub_M
Exploit likelihood
0.41% (higher than 37% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-9f5h-mmq6-2x78

Description

Craft is a platform for creating digital experiences. In Craft versions 4.0.0-RC1 through 4.16.17 and 5.0.0-RC1 through 5.8.21, 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. This issue is patched in versions 4.16.18 and 5.8.22.

Affected

Product or packageVersionsReported by
craftcms cms>= 5.0.0-RC1, < 5.8.22, >= 4.0.0-RC1, < 4.16.18CVE List
craftcms/cms (Packagist)from 5.0.0-RC1 before 5.8.22, from 4.0.0-RC1 before 4.16.18GitHub Advisory Database
craftcms craft_cmsfrom >4.0.0 before 4.16.18, from >5.0.0 before 5.8.22, 4.0.0, 5.0.0NVD

All scores

GitHub_M4.8medium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N
NVD4.8medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N

Classification

CWE-79

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

Craft is a platform for creating digital experiences. In Craft versions 4.0.0-RC1 through 4.16.17 and 5.0.0-RC1 through 5.8.21, 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. This issue is patched in versions 4.16.18 and 5.8.22.

GitHub Advisory Database

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 Settings → Fields → New 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 Settings → Users → User 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.

NVD (es)

Craft es una plataforma para crear experiencias digitales. En las versiones de Craft 4.0.0-RC1 hasta 4.16.17 y 5.0.0-RC1 hasta 5.8.21, existe una vulnerabilidad de XSS almacenado en la configuración del tipo de campo Número. Los campos Prefijo y Sufijo se renderizan utilizando el filtro Twig |md|raw sin el escape adecuado, lo que permite la ejecución de scripts cuando el campo Número se muestra en los perfiles de los usuarios. Este problema está parcheado en las versiones 4.16.18 y 5.8.22.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-25496 changed 2026-02-10CVE Terms of Use
GitHub Advisory DatabaseGHSA-9f5h-mmq6-2x78 changed 2026-02-22CC-BY-4.0
NVDCVE-2026-25496 changed 2026-06-17Public domain