GHSA-c9xg-64p9-f2jj: NukeViet: Path Traversal to Arbitrary File Deletion in Edit Comment Function
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
1. Log in as an administrator and navigate to Admin → Comment Management.
2. Select any comment and open the Edit form.
3. Intercept the POST request and set the attach parameter to:
aaaaaaaaaaaaaaaaaaaaaaaaaa../../config.php
*(26 padding characters + traversal path)*
4. Submit the request. The value ../../config.php is now stored in the database.
5. Delete the comment. config.php is deleted from the application root.
6. 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_ROOTDIR can be permanently del
Details
Original advisory: https://github.com/advisories/GHSA-c9xg-64p9-f2jj
Referenced CVEs
| CVE | CSIRTS overview | External |
|---|---|---|
| CVE-2026-54065 | coverage & exploitation status | NVD · CVE.org |
More from GitHub Security Advisories
- mediumGHSA-jr6p-8pjj-mfx6: Capsule has an incomplete fix of CVE-2026-22872: TenantResource RawItems and Generators s…2026-07-31
- mediumGHSA-68cj-mvg9-rgm2: Capsule: CapsuleConfiguration NodeMetadata regex fields lack webhook validation, allowing…2026-07-31
- mediumGHSA-ff84-5f28-78qj: re2: Out-of-bounds heap read in `exec`/`test`/`match` via attacker-influenced `lastIndex`…2026-07-31
- mediumGHSA-6hxr-mr5r-9836: re2: Global `String.prototype.match` with an empty-matchable pattern never advances → inf…2026-07-31
- mediumGHSA-x83g-979r-f5fh: Sylius Mollie Plugin has unauthenticated IDOR that leaks order token and customer PII2026-07-31