NukeViet CMS CVE-2026-54065
HIGHSeverity by source
AV:N/AC:L/PR:H/UI:N/S:C/C:N/I:H/A:H
Admin login required so PR:H; network-reachable, deterministic payload gives AV:N/AC:L; deletion harms integrity and availability but not confidentiality, and impact stays within the app's authority so S:U.
Primary rating from GitHub Advisory.
CVSS VectorGitHub Advisory
Lifecycle Timeline
3DescriptionGitHub Advisory
Summary
Path Traversal to Arbitrary File Deletion in the Edit Comment admin function. An authenticated administrator can delete arbitrary files within the application root (e.g., config.php) by injecting a crafted attach parameter, rendering the application inoperable.
Affected Component
modules/comment/admin/edit.php
Root Cause
In the vulnerable version, the attach parameter received via HTTP POST was not validated before being processed:
// Vulnerable code (before fix)
$attach = $nv_Request->get_string('attach', 'post', '', true);
if (!empty($attach)) {
$attach = substr($attach, strlen(NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/'));
}substr() strips the first N characters (equal to the length of the upload URL prefix, e.g. 26 chars for /nukeviet/uploads/comment/). By padding the payload with exactly 26 arbitrary characters followed by a path traversal sequence, an attacker can store ../../<target> directly into the database.
When the comment is subsequently deleted, del.php reads attach from the database and calls:
nv_deletefile(NV_UPLOADS_REAL_DIR . '/' . $module_upload . '/' . $row['attach']);nv_deletefile() resolves the path via realpath() and only verifies the result is within NV_ROOTDIR - it does not restrict deletion to the uploads directory - allowing deletion of any file in the installation root.
Steps to Reproduce
- Log in as an administrator and navigate to Admin → Comment Management.
- Select any comment and open the Edit form.
- Intercept the POST request and set the
attachparameter to:
aaaaaaaaaaaaaaaaaaaaaaaaaa../../config.php*(26 padding characters + traversal path)*
- Submit the request. The value
../../config.phpis now stored in the database. - Delete the comment.
config.phpis deleted from the application root. - The application immediately redirects to the install wizard, confirming the file has been removed.
Impact
- Any file readable by the web server process within
NV_ROOTDIRcan be permanently deleted. - Deleting
config.phpcauses a full application outage and exposes the install wizard.
Severity
CVSS v3.1 Base Score: 8.7 (High)
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:N/I:H/A:H| Metric | Value |
|---|---|
| Attack Vector | Network |
| Attack Complexity | Low |
| Privileges Required | High (Admin required) |
| User Interaction | None |
| Scope | Changed |
| Confidentiality | None |
| Integrity | High |
| Availability | High |
Fix
Added nv_is_file() validation before processing the attach value. This function uses realpath() and a regex check to ensure the file resolves to a path within the intended upload directory, rejecting any traversal attempts.
// Fixed code
$attach = $nv_Request->get_string('attach', 'post', '');
if (!empty($attach) and nv_is_file($attach, NV_UPLOADS_DIR . '/' . $module_upload)) {
$attach = substr($attach, strlen(NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/'));
} else {
$attach = '';
}AnalysisAI
Arbitrary file deletion in NukeViet CMS (versions before 4.6.00) allows an authenticated administrator to permanently delete any file within the web application root via a path-traversal payload in the comment Edit function. By padding the POST 'attach' parameter with exactly 26 filler characters followed by '../../<target>', an attacker survives the naive substr() prefix-stripping and stores a traversal path in the database; deleting the comment then removes the referenced file (e.g. config.php), forcing the site into the install wizard and causing a full outage. No public exploit identified at time of analysis, though the GitHub Security Advisory (GHSA-c9xg-64p9-f2jj) includes a full working reproduction.
Technical ContextAI
NukeViet is an open-source PHP/MySQL CMS. The flaw (CWE-22, Improper Limitation of a Pathname to a Restricted Directory) lives in modules/comment/admin/edit.php. Attachment URLs are stored by stripping the known upload-URL prefix with substr(input, strlen(NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/')) - a fixed-length cut (e.g. 26 chars for '/nukeviet/uploads/comment/') rather than validation of the resolved path. Because the strip is purely positional, an attacker prepends dummy characters equal to that prefix length so their real traversal sequence lands intact in the database. The sink is nv_deletefile() in del.php, which resolves the path with realpath() but only checks containment within NV_ROOTDIR - the whole installation - instead of restricting to the uploads directory, so any web-server-writable file under the app root can be deleted. The fix adds nv_is_file() validation (realpath + regex) confirming the target resolves inside the intended upload directory before processing.
RemediationAI
Upgrade to NukeViet 4.6.00 or later, which adds nv_is_file() validation (realpath plus regex) to confirm the attach value resolves inside the intended uploads directory before it is stored; this is the primary and complete fix (Vendor-released patch: 4.6.00). See https://github.com/nukeviet/nukeviet/security/advisories/GHSA-c9xg-64p9-f2jj. If you cannot upgrade immediately, restrict the comment administration function to trusted admins only and audit/limit the number of accounts holding comment-management privileges, since exploitation requires an authenticated admin; additionally, tighten filesystem permissions so the web-server process cannot delete critical files such as config.php (e.g. make config.php read-only to the web user), which prevents the destructive outcome at the cost of blocking legitimate in-app config rewrites. Monitor for unexpected comment edits/deletions and for the appearance of the install wizard, which indicates config.php loss.
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
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
(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear
The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by
ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C
Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au
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
Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
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
The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1
Same weakness CWE-22 – Path Traversal
View allSame technique Path Traversal
View allShare
External POC / Exploit Code
Leaving vuln.today
GHSA-c9xg-64p9-f2jj