/

CVE-2026-25510

Severity:

CRITICAL RISK

(9.9)

Arbitrary Code Execution / Remote Code Execution

CVE-2026-25510

Analyzed

Vulnerability type

Category:

Arbitrary Code Execution / Remote Code Execution

CWE:

CWE-94, CWE-434

Impact:

Remote Code Execution by authenticated users with elevated permissions

Severity:

CRITICAL RISK

(9.9)

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.28.5.0 allow an authenticated user with file editor permissions to create and save arbitrary PHP files on the server.

By abusing the file creation and save endpoints, an attacker can upload and execute PHP code, resulting in full remote code execution under the web server's privileges.

Affected context

The vulnerability appears in CI4MS deployments that expose the built-in file editor feature to authenticated users.

Specifically, instances where users with file editor or similar elevated permissions can:

  • Create new files via HTTP endpoints
  • Save arbitrary content to those files within web-accessible directories
  • Reach those files via the web server to trigger execution

The issue is relevant wherever the CMS runs with PHP execution enabled in directories that are writable by the application and accessible over HTTP.

Exploit preconditions

  • Attack surface: Web-based administrative file editor endpoints in the CI4MS backend
  • Required access: Authenticated account with file editor permissions or equivalent ability to write files via the CMS
  • Trigger point: Creation and saving of a file containing attacker-controlled PHP code in a directory that the web server executes and serves
  • Why exploitation is possible: The file editor functionality does not sufficiently restrict file types, content, or write locations, allowing server-executable PHP code to be written into web-accessible paths (CWE-94 and CWE-434).

Why this happens

The core issue is that the application's file editor functionality trusts authenticated users with editor permissions to write arbitrary content to the filesystem without proper constraints.

From a vulnerability-class perspective, this combines:

  • CWE-94: Improper Control of Generation of Code ('Code Injection') — user-controlled input is allowed to become executable PHP code on the server.
  • CWE-434: Unrestricted Upload of File with Dangerous Type — the system permits the creation of files of dangerous types (e.g., .php) in locations where they will be executed by the web server.

The abstract insecure pattern is: a web-accessible, server-executable directory is writable by an application feature that accepts untrusted input, and no robust policy enforces safe file types, content, or separation between editable resources and executable code.

Potential impact

  • Execution of arbitrary PHP code on the server with the web server's permissions
  • Full compromise of the CMS, including reading and modifying content and configuration
  • Credential theft, session hijacking, or installation of web shells and backdoors
  • Lateral movement to adjacent systems or databases accessible from the compromised server
  • Data exfiltration or tampering, including defacement and content manipulation

General mitigation guidance

Effective mitigation focuses on separating content editing from executable code, tightening file operations, and minimizing privileges:

  • Restrict the file editor to non-executable directories (e.g., templates or static assets that are not interpreted as PHP).
  • Enforce strict allowlists for file extensions and paths, disallowing creation or modification of .php and other server-executable types through the editor.
  • Apply content validation and filtering where appropriate, avoiding acceptance of direct code constructs in locations that may be interpreted by the server.
  • Run the web application and web server under least-privilege accounts, and avoid granting them write access to directories where executable code is served.
  • Consider disabling the file editor in production or limiting it to highly trusted administrative workflows with additional approvals or out-of-band deployment processes.
  • Use defense-in-depth controls such as segregating writable directories from the web root and configuring the web server to treat those directories as non-executable.

How teams detect issues like this

Organizations can look for this class of issue through both code-centric and operational lenses:

  • Static analysis and code review:
  • Flag endpoints that write to the filesystem based on user-supplied parameters (file name, path, content).
  • Identify any controller or service that allows creation or editing of files under the web root or other executable directories.
  • Review permission checks around file-editing features to ensure they are narrow and role-appropriate.
  • Configuration and policy checks:
  • Enforce policies that writable directories must not be configured as executable in the web server.
  • Periodically scan the web root for unexpected executable files (e.g., new .php files) created at runtime.
  • Runtime monitoring:
  • Log and monitor use of file editor endpoints, including file paths and extensions being created or updated.
  • Alert on suspicious patterns such as sudden creation of PHP files in unusual locations or spikes in file-editor activity.
  • Automated security testing and code review tools may assist by flagging risky file-write patterns and unsafe upload/editor logic during CI.

Sources

SourceLink
github.comgithub.com/ci4-cms-erp/ci4ms/commit/86be2930d1c54eb7575102563302b2f3bafcb653
github.comgithub.com/ci4-cms-erp/ci4ms/security/advisories/GHSA-gp56-f67f-m4px

Frequently asked

questions

Yes, but only by authenticated users who possess file editor or equivalent permissions. Once such access is obtained, exploitation can be done remotely over HTTP by creating and executing a malicious PHP file.

The attacker needs a valid CI4MS account with file editor permissions or another role capable of creating and saving files via the affected endpoints. Without such permissions, direct exploitation via the described vector is not feasible.

The safest pattern is to ensure that no user-facing feature—regardless of authentication level—can write executable code to locations interpreted by the server. This means restricting file editors to non-executable areas, enforcing strict allowlists for file types and paths, and designing the deployment pipeline so that code changes require out-of-band deployment rather than in-app editing.

Adopt architectural patterns where runtime file writes are limited to non-executable storage (e.g., uploads, media, or cache directories), establish clear separation between code and content, and codify this separation in both application logic and web server configuration. Incorporate security reviews for any feature that handles file creation or upload, enforce least privilege for application roles, and use automated checks in CI to detect risky file-write or upload logic.

Find out what's already
exploitable in your codebase.