/

CVE-2026-34557

Severity:

CRITICAL RISK

(9.1)

XSS in CI4MS Role and Group Management

CVE-2026-34557

Analyzed

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Stored Cross-Site Scripting leading to account takeover and permission abuse

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, a CodeIgniter 4-based CMS skeleton, contains a stored cross-site scripting (XSS) vulnerability in its group and role management features prior to version 0.31.0.0.

Unsanitized, user-controlled input in several group-related fields is stored on the server and later rendered without proper output encoding in privileged administrative views, allowing execution of attacker-supplied JavaScript in an admin's browser.

Affected context

This vulnerability manifests within the CI4MS administrative interface, specifically in the role, group, and permission management sections.

It affects deployments where:

  • Administrative users manage groups/roles through the web UI
  • Group-related fields accept user-controlled data (for example, names, labels, or descriptions)
  • That data is later displayed in administrative pages without adequate output encoding

The risk is heightened in multi-tenant or multi-admin environments where untrusted users can influence role or group metadata that is later viewed by privileged operators.

Exploit preconditions

  • Attack surface: Web-based management interface for groups, roles, and permissions
  • Required access: Ability to create or modify group-related fields (e.g., group name/label/description) via the CI4MS UI or API; this may be a low-privileged backend user, a compromised account, or an integration with insufficient validation
  • Trigger point: An administrator or other privileged user browses to the affected role/group management views where the stored data is rendered
  • Why exploitation is possible: User-controlled values are accepted and persisted without robust server-side sanitization or validation, and later embedded into HTML responses without appropriate context-aware output encoding, allowing the browser to interpret them as executable script

Why this happens

The underlying issue is a classic stored XSS pattern as described by CWE-79: failure to neutralize or encode user-controlled input before including it in a web page.

In CI4MS, multiple fields associated with group management accept arbitrary text input that is:

  1. Persisted to server-side storage without strict validation or canonicalization, and
  2. Rendered into administrative templates using output mechanisms that do not apply HTML/JavaScript-safe encoding.

This combination creates a path where attacker-supplied JavaScript can be injected once, stored indefinitely, and executed automatically whenever a privileged user views the affected administrative screens.

Potential impact

  • Execution of arbitrary JavaScript in the context of an authenticated administrator's session
  • Theft of session identifiers, CSRF tokens, or other sensitive browser-stored data belonging to admins
  • Unauthorized actions performed on behalf of an administrator (e.g., changing roles, escalating privileges, creating backdoor accounts)
  • Tampering with role/permission configurations, potentially granting broader access to attackers or disabling security controls
  • Defacement or injection of malicious content into administrative pages, which could spread further attacks (e.g., phishing or malware delivery)

General mitigation guidance

Effective mitigation typically focuses on robust output encoding, strict input handling, and isolation of untrusted data:

  • Apply context-aware output encoding for all dynamic values rendered into HTML, attributes, JavaScript, or URLs, ensuring that group and role fields are never interpreted as executable code.
  • Use template engines and framework helpers that escape by default, and avoid disabling escaping unless absolutely necessary and safe.
  • Introduce server-side validation and normalization for group-related fields, constraining them to expected character sets and lengths (e.g., alphanumeric names with limited punctuation).
  • Adopt a defense-in-depth approach with Content Security Policy (CSP) to limit the impact of any remaining XSS vectors, such as disallowing inline scripts where feasible.
  • Apply the principle of least privilege to administrative accounts and minimize the number of users allowed to create or modify role/group metadata.

How teams detect issues like this

Detection can combine code-level inspection with runtime monitoring:

  • Use static analysis or linting rules to flag direct insertion of user-controlled data into views without encoding, particularly within administrative templates handling roles and groups.
  • During code review, look for:
  • Raw echoing of database fields in views
  • Suppressed or disabled template escaping mechanisms
  • Custom rendering helpers that bypass framework-provided encoding
  • Implement security testing (e.g., unit and integration tests) that include benign script-like markers in group and role fields to verify they are safely encoded in rendered HTML.
  • Employ dynamic application security testing (DAST) tools or web vulnerability scanners configured to probe for stored XSS in administrative workflows.
  • Enable logging or monitoring for unusual modifications to group/role metadata, coupled with alerts on suspicious patterns (e.g., presence of <script, onerror=, or javascript: substrings) in stored values.

Sources

SourceLink
github.comgithub.com/ci4-cms-erp/ci4ms/security/advisories/GHSA-rpjr-985c-qhvm

Frequently asked

questions

Exploitability depends on who can influence group-related fields. In environments where semi-trusted or low-privileged users can create or edit group metadata that is later viewed by administrators, the vulnerability can be leveraged to execute arbitrary JavaScript in high-privilege sessions.

Not necessarily. The attacker needs a path to store crafted input in the affected fields; this could be any level of access or integration that allows modifications to group or role metadata. However, impact becomes severe only when a privileged user views the compromised administrative pages.

Ensure all user-controlled data used in views—especially in admin role and group management screens—is passed through context-aware output encoding by default. Combine this with conservative server-side validation to constrain allowed input and avoid rendering unescaped values directly.

Adopt a security-by-default templating approach where automatic escaping is standard, establish coding standards that prohibit unencoded output of user data, integrate static and dynamic XSS checks into CI pipelines, and include explicit test cases for stored XSS in administrative areas handling roles, groups, and permissions.

Find out what's already
exploitable in your codebase.