CVE-2026-54065: NukeViet Path Traversal Vulnerability

HIGH
Advisory Identifier: GHSA-c9xg-64p9-f2jj
CVSS 8.7
CWE-22
Published
Advisory Summary

CVE-2026-54065 is a HIGH (CVSS 8.7) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting NukeViet libraries in the Packagist ecosystem. The issue involves path traversal to arbitrary file deletion in edit comment function. Remediation is available by upgrading affected packages to version 4.6.00.

CVE-2026-54065 at a Glance

CVE Identifier CVE-2026-54065
GHSA Identifier GHSA-c9xg-64p9-f2jj
Severity HIGH
CVSS v3.1 Base Score 8.7
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product NukeViet
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 8.7

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:N/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality None (C:N)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-54065

To remediate this vulnerability, upgrade all affected NukeViet dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

nukeviet/nukeviet fixed: 4.6.00
Upgrade nukeviet/nukeviet to 4.6.00
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for nukeviet/nukeviet

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-54065, inspect your project dependencies for NukeViet:

inspect dependencies for nukeviet/nukeviet

Analyze the terminal output to locate any version of NukeViet in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.6.00), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In NukeViet, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## 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: ```php // 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: ```php 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 deleted. - Deleting `config.php` causes 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. ```php // 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 = ''; } ```

CVE-2026-54065 Affected NukeViet Versions

1 component(s)
Fixed Versions:
4.6.00
Product / Package Ecosystem Affected Versions Fixed Version
nukeviet/nukeviet
Packagist
< 4.6.00
4.6.00

References

Frequently Asked Questions

What is CVE-2026-54065?
CVE-2026-54065 is a security vulnerability in NukeViet involving Path Traversal to Arbitrary File Deletion in Edit Comment Function under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which NukeViet versions are affected?
Affected versions include releases prior to 4.6.00 across affected packages: nukeviet/nukeviet.
What version fixes CVE-2026-54065?
Upgrading to 4.6.00 (or the latest patched release for your respective branch) resolves the vulnerability.
Is nukeviet/nukeviet affected?
Yes, nukeviet/nukeviet is affected in releases prior to 4.6.00. Upgrade your dependency to 4.6.00 or later.
What is the CVSS score of CVE-2026-54065?
CVE-2026-54065 has a CVSS v3.1 base score of 8.7 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:N/I:H/A:H.
What CWE is associated with CVE-2026-54065?
CVE-2026-54065 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check Packagist dependencies for CVE-2026-54065?
Run the dependency tree command: 'inspect dependencies for nukeviet/nukeviet'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-c9xg-64p9-f2jj",
  "modified" : "2026-07-13T17:55:48Z",
  "published" : "2026-07-13T17:55:48Z",
  "aliases" : [ "CVE-2026-54065" ],
  "summary" : "NukeViet: Path Traversal to Arbitrary File Deletion in Edit Comment Function",
  "details" : "## Summary\n\nPath 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.\n\n## Affected Component\n\n`modules/comment/admin/edit.php`\n\n## Root Cause\n\nIn the vulnerable version, the `attach` parameter received via HTTP POST was not validated before being processed:\n\n```php\n// Vulnerable code (before fix)\n$attach = $nv_Request->get_string('attach', 'post', '', true);\nif (!empty($attach)) {\n    $attach = substr($attach, strlen(NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/'));\n}\n```\n\n`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.\n\nWhen the comment is subsequently deleted, `del.php` reads `attach` from the database and calls:\n\n```php\nnv_deletefile(NV_UPLOADS_REAL_DIR . '/' . $module_upload . '/' . $row['attach']);\n```\n\n`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.\n\n## Steps to Reproduce\n\n1. Log in as an administrator and navigate to **Admin → Comment Management**.\n2. Select any comment and open the Edit form.\n3. Intercept the POST request and set the `attach` parameter to:\n\n```\naaaaaaaaaaaaaaaaaaaaaaaaaa../../config.php\n```\n\n*(26 padding characters + traversal path)*\n\n4. Submit the request. The value `../../config.php` is now stored in the database.\n5. Delete the comment. `config.php` is deleted from the application root.\n6. The application immediately redirects to the install wizard, confirming the file has been removed.\n\n## Impact\n\n- Any file readable by the web server process within `NV_ROOTDIR` can be permanently deleted.\n- Deleting `config.php` causes a full application outage and exposes the install wizard.\n\n## Severity\n\n**CVSS v3.1 Base Score: 8.7 (High)**\n\n```\nCVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:N/I:H/A:H\n```\n\n| Metric | Value |\n|--------|-------|\n| Attack Vector | Network |\n| Attack Complexity | Low |\n| Privileges Required | High (Admin required) |\n| User Interaction | None |\n| Scope | Changed |\n| Confidentiality | None |\n| Integrity | High |\n| Availability | High |\n\n## Fix\n\nAdded `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.\n\n```php\n// Fixed code\n$attach = $nv_Request->get_string('attach', 'post', '');\nif (!empty($attach) and nv_is_file($attach, NV_UPLOADS_DIR . '/' . $module_upload)) {\n    $attach = substr($attach, strlen(NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/'));\n} else {\n    $attach = '';\n}\n```",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:N/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "nukeviet/nukeviet"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.6.00"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nukeviet/nukeviet/security/advisories/GHSA-c9xg-64p9-f2jj"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nukeviet/nukeviet"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-13T17:55:48Z",
    "nvd_published_at" : null
  }
}