CVE-2026-25496: Craftcms/cms Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-9f5h-mmq6-2x78
CWE-79
Published
Advisory Summary

CVE-2026-25496 is a MODERATE cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Craftcms/cms libraries in the Packagist ecosystem. The issue involves craft cms vulnerable to stored xss in number prefix & suffix fields. Remediation is available by upgrading affected packages to version 5.8.22, 4.16.18.

CVE-2026-25496 at a Glance

CVE Identifier CVE-2026-25496
GHSA Identifier GHSA-9f5h-mmq6-2x78
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Craftcms/cms
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2026-25496

To remediate this vulnerability, upgrade all affected Craftcms/cms dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

craftcms/cms fixed: 5.8.22
Upgrade craftcms/cms to 5.8.22
craftcms/cms fixed: 4.16.18
Upgrade craftcms/cms to 4.16.18
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for craftcms/cms

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-25496, inspect your project dependencies for Craftcms/cms:

inspect dependencies for craftcms/cms

Analyze the terminal output to locate any version of Craftcms/cms in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.8.22), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where 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. In Craftcms/cms, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## 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 - Administrator access - `allowAdminChanges` is enabled in production, which is against our [security recommendations](https://craftcms.com/knowledge-base/securing-craft). ### 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: <img width="611" height="908" alt="image" src="https://github.com/user-attachments/assets/63766ca4-4fa9-490b-8bea-37364137527d" /> ```html <img src=x onerror="alert('Number Prefix/Suffix XSS')" hidden> ``` 5. Save the field 6. Add this field to any element (e.g., User Profile fields via **Settings** → **Users** → **User Fields**) 7. Navigate to your account (`/admin/myaccount`) or any user profile (`/admin/users/{id}`) 8. XSS executes when viewing the form <img width="1246" height="677" alt="image-1" src="https://github.com/user-attachments/assets/dafeb2b7-905f-4a4b-b3d6-1c16a905498f" /> ## Mitigation Sanitize prefix/suffix before rendering or use `|e` filter instead of `|raw`.

CVE-2026-25496 Affected Craftcms/cms Versions

2 component(s)
Fixed Versions:
5.8.224.16.18
Product / Package Ecosystem Affected Versions Fixed Version
craftcms/cms
Packagist
≥ 5.0.0-RC1
< 5.8.22
5.8.22
craftcms/cms
Packagist
≥ 4.0.0-RC1
< 4.16.18
4.16.18

References

Frequently Asked Questions

What is CVE-2026-25496?
CVE-2026-25496 is a security vulnerability in Craftcms/cms involving Craft CMS Vulnerable to Stored XSS in Number Prefix & Suffix Fields under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Craftcms/cms versions are affected?
Affected versions include releases prior to 5.8.22, 4.16.18 across affected packages: craftcms/cms.
What version fixes CVE-2026-25496?
Upgrading to 5.8.22, 4.16.18 (or the latest patched release for your respective branch) resolves the vulnerability.
Is craftcms/cms affected?
Yes, craftcms/cms is affected in releases prior to 5.8.22, 4.16.18. Upgrade your dependency to 5.8.22, 4.16.18 or later.
What CWE is associated with CVE-2026-25496?
CVE-2026-25496 is classified under CWE-79: 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.).
How can I check Packagist dependencies for CVE-2026-25496?
Run the dependency tree command: 'inspect dependencies for craftcms/cms'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-9f5h-mmq6-2x78",
  "modified" : "2026-02-09T22:39:05Z",
  "published" : "2026-02-09T20:35:47Z",
  "aliases" : [ "CVE-2026-25496" ],
  "summary" : "Craft CMS Vulnerable to Stored XSS in Number Prefix & Suffix Fields",
  "details" : "## Summary\n\nA 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.\n\n## Proof of Concept\n\n### Required Permissions\n\n- Administrator access\n- `allowAdminChanges` is enabled in production, which is against our [security recommendations](https://craftcms.com/knowledge-base/securing-craft).\n\n### Steps to Reproduce\n1. Log in with an admin account\n2. Navigate to **Settings** → **Fields** → **New field**\n3. Choose **Number** as the field type\n4. Set the **Prefix/Suffix Text** field to: <img width=\"611\" height=\"908\" alt=\"image\" src=\"https://github.com/user-attachments/assets/63766ca4-4fa9-490b-8bea-37364137527d\" />\n```html\n<img src=x onerror=\"alert('Number Prefix/Suffix XSS')\" hidden>\n```\n5. Save the field\n6. Add this field to any element (e.g., User Profile fields via **Settings** → **Users** → **User Fields**)\n7. Navigate to your account (`/admin/myaccount`) or any user profile (`/admin/users/{id}`)\n8. XSS executes when viewing the form <img width=\"1246\" height=\"677\" alt=\"image-1\" src=\"https://github.com/user-attachments/assets/dafeb2b7-905f-4a4b-b3d6-1c16a905498f\" />\n\n## Mitigation\nSanitize prefix/suffix before rendering or use `|e` filter instead of `|raw`.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "craftcms/cms"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0-RC1"
      }, {
        "fixed" : "5.8.22"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 5.8.21"
    }
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "craftcms/cms"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0-RC1"
      }, {
        "fixed" : "4.16.18"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.16.17"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/craftcms/cms/security/advisories/GHSA-9f5h-mmq6-2x78"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-25496"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/craftcms/cms/commit/cb5fb0e979e72f315c9178fc031883d49527f513"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/craftcms/cms"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/craftcms/cms/releases/tag/4.16.18"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/craftcms/cms/releases/tag/5.8.22"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-02-09T20:35:47Z",
    "nvd_published_at" : "2026-02-09T20:15:58Z"
  }
}