/

CVE-2026-34560

Severity:

CRITICAL RISK

(9.1)

Cross-Site Scripting (XSS) in CI4MS Logs Interface

CVE-2026-34560

Analyzed

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Stored Blind Cross-Site Scripting leading to potential administrative account compromise

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 blind Cross-Site Scripting (XSS) vulnerability in the logs interface, where user-controlled data is rendered without proper output encoding.

An attacker can inject malicious JavaScript into data that ends up in application logs, leading to code execution in an administrator's browser when the logs page is later viewed.

Affected context

The vulnerability affects CI4MS deployments that:

  • Log user-controlled or externally supplied data (e.g., request parameters, headers, form fields, or payloads)
  • Expose a web-based logs viewing interface within the admin or management area
  • Render logged entries into HTML templates without applying appropriate context-aware output encoding

The issue primarily manifests when administrators or privileged operators use the web UI to inspect logs that contain previously stored attacker-controlled payloads.

Exploit preconditions

  • Attack surface: Web application interfaces or APIs whose input is captured into application logs
  • Required access: Ability to supply data that is logged (e.g., HTTP requests, form submissions, API calls), which can often be unauthenticated or low-privilege
  • Trigger point: An administrator or privileged user navigates to the logs viewing page in the CI4MS backend, causing the logged payload to be rendered and executed in their browser
  • Why exploitation is possible: Logged values originating from untrusted sources are injected directly into the logs view HTML without proper escaping or encoding, allowing embedded script to execute in the admin's browser context

Why this happens

The underlying issue is improper neutralization of user input before it is included in dynamically generated HTML, aligning with CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-site Scripting).

In this case, the logging subsystem captures raw, user-controlled values, and the log viewer template outputs these values directly into the page without applying context-appropriate escaping (e.g., HTML encoding for text nodes, attribute encoding for attributes). Because the logged content is treated as safe display data instead of untrusted input, an attacker can craft entries that contain malicious script tags or event handlers. These payloads remain dormant until a privileged user views the logs page, at which point the browser interprets the content as executable script.

Potential impact

  • Execution of arbitrary JavaScript in the browser of an administrator or log viewer
  • Theft of administrative session cookies or tokens (if not adequately protected)
  • Unauthorized actions performed with the administrator's privileges (e.g., changing settings, creating new users, modifying content)
  • Installation of persistent browser-based backdoors within the admin's environment (e.g., via malicious bookmarklets or injected resources)
  • Lateral movement to other internal administrative tools opened in the same browser session

General mitigation guidance

Mitigation generally focuses on strict output encoding and reducing implicit trust in log content:

  • Apply context-aware output encoding to all logged values when rendering them in HTML views (e.g., htmlspecialchars / HTML entities for text nodes, attribute encoding where needed)
  • Treat log entries as untrusted input whenever they are displayed in a browser, regardless of where they originated
  • Prefer text-only rendering for logs (e.g., preformatted text blocks) rather than injecting log content into HTML structures that might allow script execution
  • Consider separating log storage and viewing concerns, using log viewers that inherently encode or sanitize content
  • Implement principle of least privilege for log viewers: limit access to logs to dedicated admin accounts and avoid using highly privileged sessions for casual browsing
  • Introduce secure-by-default templating practices that escape content unless explicitly marked as safe following validation

How teams detect issues like this

Detection can leverage a combination of code analysis, review practices, and behavior monitoring:

  • Use static application security testing (SAST) or linters to detect direct insertion of untrusted variables into templates without encoding, especially in log viewer components
  • During code review, flag patterns where log content or other "internal data" is assumed safe and rendered directly into views
  • Enforce architectural policies that require escaping by default in templating engines and prohibit raw HTML output of log lines
  • Perform dynamic testing with benign XSS test payloads that flow into logs, then access the logs interface to verify that payloads are encoded rather than executed
  • Integrate automated security checks into CI/CD pipelines to scan for common XSS sinks and missing encoding routines

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-r4v5-rwr2-q7r4

Frequently asked

questions

Yes. If an attacker can send data that is captured in the application logs (for example, through public-facing forms or endpoints), they can exploit this vulnerability without direct access to the admin interface. Execution occurs later when an administrator views the contaminated logs page.

Generally, the attacker only needs the ability to cause data to be logged, which may be possible as an unauthenticated user. They do not need administrative access, because the payload is executed in the context of the administrator who later reviews the logs.

Ensure that all untrusted data is properly contextually encoded at the point of output, especially in administrative views such as logs. Treat log contents as untrusted input and render them using HTML-safe escaping or as plain text within non-executable containers.

Adopt a "escape by default" templating strategy, enforce coding standards that require output encoding for any data derived from user or external input, and include XSS-focused checks in both automated testing and manual code reviews. Additionally, design logging and diagnostic interfaces with the assumption that logs may contain hostile content.

Find out what's already
exploitable in your codebase.