/

CVE-2026-34566

Severity:

CRITICAL RISK

(9.1)

Cross-Site Scripting (XSS) in CI4MS Page Management

CVE-2026-34566

Analyzed

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Stored client-side code execution in users' browsers, including administrators

Severity:

CRITICAL RISK

(9.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

CI4MS versions prior to 0.31.0.0 contain a stored cross-site scripting (XSS) vulnerability in the Page Management module, where multiple fields accept and persist attacker-supplied JavaScript without proper sanitization.

When these malicious values are later rendered in admin listings and public page views without correct output encoding, arbitrary scripts can execute in visitors' browsers, potentially compromising sessions, data, and administrative workflows.

Affected context

The vulnerability appears in the Page Management functionality of CI4MS (a CodeIgniter 4-based CMS skeleton) when pages are created or edited.

It is most relevant in deployments where:

  • Untrusted or semi-trusted users can create or modify pages
  • Page metadata and content fields are stored and later displayed in admin lists and public views
  • Output encoding is not consistently applied when rendering stored content into HTML pages or DOM elements

Any environment exposing Page Management to multiple users or editors is particularly at risk, especially when administrators routinely browse lists of pages through the backend interface.

Exploit preconditions

  • Attack surface: Web UI of the CI4MS Page Management module (both admin and public-facing pages).
  • Required access: Ability to create or edit pages (e.g., editor or contributor role, compromised account, or misconfigured permissions).
  • Trigger point: Viewing of an affected admin listing page or public page that renders the stored malicious field without proper output encoding.
  • Why exploitation is possible: User-controlled input is stored server-side and later injected into the HTML/DOM without appropriate context-aware escaping, allowing attacker-provided JavaScript to execute in the browser of anyone viewing the page.

Why this happens

This vulnerability stems from insufficient output encoding of stored user-controlled data in the Page Management subsystem.

Multiple editable fields accept arbitrary input that is persisted to the database and subsequently rendered into HTML responses or DOM contexts without the proper escaping for their placement (e.g., HTML body, attributes, or script-adjacent locations).

This maps to CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting), where an application fails to neutralize or encode attacker-controlled content before including it in web pages, enabling client-side script execution in victims' browsers.

Potential impact

  • Theft of session cookies or other authentication tokens from affected users
  • Impersonation of administrative accounts and account takeover within the CMS
  • Unauthorized actions performed on behalf of an administrator (e.g., changing content, creating new admin users)
  • Injection of phishing content or defacement of public pages
  • Exfiltration or manipulation of data accessible via the victim's browser session
  • Lateral movement to other internal applications reachable from the victim's browser

General mitigation guidance

Effective mitigation focuses on context-aware output encoding and strict handling of user-controlled content:

  • Encode all user-supplied fields at output time using HTML-, attribute-, or JavaScript-context-safe escaping, depending on where the data is injected.
  • Treat page titles, slugs, metadata, and body content as untrusted, even for privileged users, and apply consistent encoding before rendering.
  • Centralize templating and view rendering through helper functions or a view layer that enforces safe-by-default escaping semantics.
  • Limit where raw HTML is ever allowed; if rich content is needed, use vetted sanitization libraries that strip or neutralize scripts, event handlers, and dangerous tags.
  • Apply the principle of least privilege to editorial roles so fewer users can introduce potentially malicious content.
  • Use defense-in-depth browser controls (such as a well-scoped Content Security Policy) to reduce the impact of any remaining XSS issues.

How teams detect issues like this

Detection typically involves a combination of code analysis and runtime testing:

  • Static analysis: Scan views and controllers for direct echoing of user-controlled variables (e.g., content fields, titles, slugs) without passing through encoding helpers or escaping functions.
  • Code review signals: Look for custom HTML generation, manual concatenation of strings into templates, and any bypasses of the default escaping in the templating engine.
  • Security testing: Use automated DAST tools or manual penetration testing to inject benign script markers into page fields and verify whether they are rendered as executable code.
  • Policy enforcement: Establish coding guidelines requiring context-aware escaping for all untrusted data and enforce them via pre-merge checks or automated linters integrated into the CI pipeline.

Sources

SourceLink
github.comgithub.com/ci4-cms-erp/ci4ms/releases/tag/0.31.0.0
github.comgithub.com/ci4-cms-erp/ci4ms/security/advisories/GHSA-458r-h248-29c5

Frequently asked

questions

Yes. Any user with access to the Page Management feature who can submit content that is later viewed by others can exploit this vulnerability remotely via the web interface.

In most realistic deployments, some level of authenticated access is required to create or edit pages. However, the XSS payload executes in the context of whoever views the affected pages, including highly privileged administrators.

Apply strict, context-aware output encoding for all stored user-controlled fields wherever they are rendered, and, where rich HTML is needed, pass content through a robust sanitization layer that removes scripts and dangerous attributes.

Adopt a secure-by-default templating approach that automatically escapes all variables, restrict direct HTML output, incorporate XSS-focused static and dynamic testing into the development lifecycle, and define coding standards that treat all user input as untrusted until safely encoded at output.

Find out what's already
exploitable in your codebase.