/

CVE-2026-34989

Severity:

CRITICAL RISK

(9.0)

Cross-Site Scripting (XSS) in CI4MS Profile Name Handling

CVE-2026-34989

Analyzed

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Stored Cross-Site Scripting leading to account compromise and session hijacking

Severity:

CRITICAL RISK

(9.0)

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 31.0.0.0 contain a stored cross-site scripting (XSS) vulnerability in the user profile name fields (such as full name and username).

By injecting malicious JavaScript into their profile name, an attacker can have this payload stored on the server and later executed in multiple application views when other users or admins view the profile.

Affected context

The vulnerability occurs in CI4MS installations that allow users to edit profile attributes like full name or username and subsequently display these values in various views (e.g., profile pages, user lists, or navigation headers).

It is relevant where profile data is accepted as free-form text, stored in the backend, and later rendered into HTML without robust output encoding or context-aware escaping.

The risk is elevated in deployments where authenticated users have broad visibility, such as administrative user management interfaces or public-facing profile directories.

Exploit preconditions

  • Attack surface: Web UI for updating user profile information (full name / username).
  • Required access: Ability to authenticate or otherwise reach the profile update functionality (typically a regular user account).
  • Trigger point: Any page or component that renders the stored profile name into the DOM without proper HTML/JavaScript encoding.
  • Why exploitation is possible: The application accepts user-controlled profile name input, stores it verbatim, and later reuses it in multiple views without context-aware output encoding or sanitization, allowing embedded script content to execute in the browser of any user loading those views.

Why this happens

The core issue is a failure to apply context-appropriate output encoding for user-controlled data rendered into HTML templates.

Profile names are treated as inert text but are stored and later injected into the HTML response without escaping characters that have special meaning in HTML or JavaScript contexts.

This aligns with CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-site Scripting), where untrusted input is incorporated into web pages without neutralizing script-related payloads.

The vulnerability reflects a missing or incomplete encoding layer in the view/template layer, and reliance on input sanitization alone rather than output encoding at all render points.

Potential impact

  • Execution of arbitrary JavaScript in the context of the victim's browser session.
  • Theft of session cookies or other authentication tokens, which may lead to account takeover.
  • Unauthorized actions performed on behalf of logged-in users (e.g., CSRF-like effects via script-driven requests).
  • Exfiltration or modification of sensitive data accessible through the web interface.
  • Defacement of application content or injection of phishing content targeting users.
  • Pivoting to further attacks such as installing malicious browser-based keyloggers or dropping additional payloads.

General mitigation guidance

Effective mitigation centers on ensuring untrusted data is safely rendered in all contexts:

  • Apply strict, context-aware output encoding for all user-controlled fields (such as profile names) before inserting them into HTML, attributes, JavaScript, or URLs.
  • Treat profile-related fields as untrusted regardless of perceived benign use, and escape characters like <, >, ", ', and & at render time.
  • Prefer templating and helper APIs that enforce escaping by default, only allowing explicit, reviewed bypasses when content is proven safe.
  • Implement centralized encoding utilities or middleware to reduce the likelihood of inconsistent handling across views and components.
  • Restrict or avoid rich text or HTML input for fields that do not require formatting to minimize XSS surface area.
  • Apply the principle of least privilege on session and authentication tokens so that compromise of one account yields minimal blast radius.

How teams detect issues like this

Detection typically involves a combination of automated and manual techniques:

  • Use static analysis or linting rules to flag direct insertion of user-controlled variables into HTML templates without escaping or encoding helpers.
  • During code review, look for profile-related fields (e.g., full name, username) passed directly to views or echo statements, and verify that encoding is applied at every render point.
  • Employ dynamic application security testing (DAST) tools configured with XSS test payloads to probe profile update flows and downstream views where profile data appears.
  • Validate that templating frameworks are configured to escape output by default and that any suppression of escaping is explicitly justified and reviewed.
  • Implement security-focused logging and Content Security Policy (CSP) violation reporting to surface suspicious script execution patterns at runtime.

Sources

SourceLink
github.comgithub.com/ci4-cms-erp/ci4ms/security/advisories/GHSA-vr2g-rhm5-q4jr

Frequently asked

questions

The vulnerability is broadly exploitable wherever an attacker can create or modify a profile and that profile data is later displayed to other users or administrators; each affected view that renders the profile name becomes a trigger point for the stored payload.

Typically, the attacker needs only the privileges required to update their own profile (usually a standard authenticated user). Once the malicious payload is stored, it can affect higher-privileged users who view impacted pages.

The most robust fix is to apply strict, context-sensitive output encoding for all user-controlled fields at every render point, using framework-provided escaping mechanisms rather than ad-hoc sanitization, and to ensure templates escape output by default.

Adopt an output-encoding-by-default strategy in templating, integrate secure coding guidelines that treat all user input as untrusted, enforce automated static and dynamic checks for XSS patterns in CI pipelines, and centralize security-critical helpers (like encoding utilities) to avoid inconsistent handling across the codebase.

Find out what's already
exploitable in your codebase.