CVE-2026-49259: NukeViet Cross-Site Scripting Vulnerability

HIGH
Advisory Identifier: GHSA-w2w5-w2pw-r929
CVSS 8.7
CWE-79
Published
Advisory Summary

CVE-2026-49259 is a HIGH (CVSS 8.7) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting NukeViet libraries in the Packagist ecosystem. The issue involves improper neutralization of input during web page generation ('cross-site scripting'). Remediation is available by upgrading affected packages to version 4.6.00.

CVE-2026-49259 at a Glance

CVE Identifier CVE-2026-49259
GHSA Identifier GHSA-w2w5-w2pw-r929
Severity HIGH
CVSS v3.1 Base Score 8.7
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
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:L/UI:R/S:C/C:H/I:H/A:N).

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

How to Fix CVE-2026-49259

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-49259, 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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. 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 A stored cross-site scripting (XSS) vulnerability exists in NukeViet CMS versions 4.x through 4.5.08. A low-privileged authenticated user can store a JavaScript payload in their profile's display name fields. The payload executes in the browser of any visitor — including administrators — who clicks the **Reply** ("Answer") link on a comment posted by that user. ## Affected Component The `{COMMENT.post_name}` template variable is interpolated without JavaScript-context escaping into an inline `onclick` handler in both comment block positions: - `themes/default/modules/comment/comment.tpl` line 27 (top-level comments) - `themes/default/modules/comment/comment.tpl` line 64 (nested/reply comments) ```html onclick="nv_commment_feedback(event, {COMMENT.cid}, '{COMMENT.post_name}')" ``` ## Root Cause The `first_name` and `last_name` profile fields are sanitized with HTML numeric character references (`'` → `&#039;`, `(` → `&#40;`, `)` → `&#41;`, `/` → `&#x002F;`) via `Request::_get_title()` with `$specialchars = true`. This encoding is correct for plain HTML attribute and element contexts, but **insufficient for a JavaScript string literal embedded inside an HTML attribute**. Browsers decode HTML entities in attribute values **before** the JavaScript engine parses the string. As a result, `&#039;` is decoded back to `'`, which terminates the JS string early and allows the remainder of the value to be executed as JavaScript. The combined display name (`nv_show_name_user(first_name, last_name)`) is what reaches the template, giving an attacker up to ~200 encoded characters across both fields — sufficient for any practical payload. ## Proof of Concept Set `first_name` to the following value in profile settings (`/index.php?nv=users&op=editinfo`), then post any comment: ```text a');alert(document.domain);// ``` The value is stored as `a&#039;&#41;;alert&#40;document.domain&#41;;&#x002F;&#x002F;`. When a visitor clicks the Reply link on the comment, the browser renders: ```js nv_commment_feedback(event, 1, 'a');alert(document.domain);// Tester') ``` causing `alert(document.domain)` to execute in the visitor's browser context. A data-exfiltration variant (split across both name fields) navigates the victim's browser to an attacker-controlled URL carrying `document.cookie` as a query parameter. End-to-end verification was performed using a local listener. ## Exploitation Conditions (default configuration) | Condition | Default value | Effect | |---|---|---| | `captcha_area_comm` | `1` | No CAPTCHA for logged-in users — payload delivery requires no CAPTCHA solve | | `auto_postcomm` | enabled | Comments are published immediately without moderation | | `active_editinfo_censor` | `0` | Profile edits take effect immediately without admin review | | CSP `script-src` | `'unsafe-inline'` | Inline `onclick` handlers execute normally | Any registered member can set the payload and post a comment with no additional steps. If `captcha_area_comm` is set to `0`, the `name` field of anonymous comments (`modules/comment/funcs/post.php`) is processed by the same `get_title(..., 1)` call, making exploitation possible without authentication. ## Impact An attacker with a regular user account can execute arbitrary JavaScript in the browser of any visitor who interacts with the Reply button on their comment, including site administrators. Practical consequences include: - **Privilege escalation via admin session hijacking** — forging administrative actions (content modification, account manipulation) in the context of an authenticated admin. - **Credential phishing** — injecting a fake login form into the page. - **Data exfiltration** — reading page content and non-`HttpOnly` cookies. > Note: NukeViet session cookies carry the `HttpOnly` flag, so they are not directly readable via `document.cookie`; however, the above attack vectors remain fully viable. ## Remediation **Preferred fix:** Remove `post_name` from the inline handler entirely. Pass only `cid` to `nv_commment_feedback` and have the function retrieve the display name from the already-rendered DOM (e.g., the adjacent `<strong class="cm_item">` element). **Alternative fix:** If the value must be passed inline, encode it with `json_encode($post_name)` (PHP) so that the output is a properly escaped JavaScript string literal, not an HTML-entity-encoded one. HTML numeric character references must not be relied upon for JavaScript string escaping. As a general note, the result of `get_title(..., $specialchars=true)` is safe for HTML element content and quoted HTML attribute values, but **unsafe when placed inside a JavaScript string literal within an attribute**. Other locations in the codebase using the same pattern should be audited. ## Resources - OWASP: Cross Site Scripting Prevention — Rule 2: Attribute Encoding is Not Sufficient for JS Contexts - CWE-79: Improper Neutralization of Input During Web Page Generation - CWE-116: Improper Encoding or Escaping of Output

CVE-2026-49259 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-49259?
CVE-2026-49259 is a security vulnerability in NukeViet involving Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which NukeViet versions are affected?
Affected versions include releases prior to 4.6.00 across affected packages: nukeviet/nukeviet.
What version fixes CVE-2026-49259?
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-49259?
CVE-2026-49259 has a CVSS v3.1 base score of 8.7 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N.
What CWE is associated with CVE-2026-49259?
CVE-2026-49259 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check Packagist dependencies for CVE-2026-49259?
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-w2w5-w2pw-r929",
  "modified" : "2026-07-13T17:22:26Z",
  "published" : "2026-07-13T17:22:26Z",
  "aliases" : [ "CVE-2026-49259" ],
  "summary" : "NukeViet: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')",
  "details" : "## Summary\n\nA stored cross-site scripting (XSS) vulnerability exists in NukeViet CMS versions 4.x through 4.5.08. A low-privileged authenticated user can store a JavaScript payload in their profile's display name fields. The payload executes in the browser of any visitor — including administrators — who clicks the **Reply** (\"Answer\") link on a comment posted by that user.\n\n## Affected Component\n\nThe `{COMMENT.post_name}` template variable is interpolated without JavaScript-context escaping into an inline `onclick` handler in both comment block positions:\n\n- `themes/default/modules/comment/comment.tpl` line 27 (top-level comments)\n- `themes/default/modules/comment/comment.tpl` line 64 (nested/reply comments)\n\n```html\nonclick=\"nv_commment_feedback(event, {COMMENT.cid}, '{COMMENT.post_name}')\"\n```\n\n## Root Cause\n\nThe `first_name` and `last_name` profile fields are sanitized with HTML numeric character references (`'` → `&#039;`, `(` → `&#40;`, `)` → `&#41;`, `/` → `&#x002F;`) via `Request::_get_title()` with `$specialchars = true`. This encoding is correct for plain HTML attribute and element contexts, but **insufficient for a JavaScript string literal embedded inside an HTML attribute**.\n\nBrowsers decode HTML entities in attribute values **before** the JavaScript engine parses the string. As a result, `&#039;` is decoded back to `'`, which terminates the JS string early and allows the remainder of the value to be executed as JavaScript.\n\nThe combined display name (`nv_show_name_user(first_name, last_name)`) is what reaches the template, giving an attacker up to ~200 encoded characters across both fields — sufficient for any practical payload.\n\n## Proof of Concept\n\nSet `first_name` to the following value in profile settings (`/index.php?nv=users&op=editinfo`), then post any comment:\n\n```text\na');alert(document.domain);//\n```\n\nThe value is stored as `a&#039;&#41;;alert&#40;document.domain&#41;;&#x002F;&#x002F;`.\n\nWhen a visitor clicks the Reply link on the comment, the browser renders:\n\n```js\nnv_commment_feedback(event, 1, 'a');alert(document.domain);// Tester')\n```\n\ncausing `alert(document.domain)` to execute in the visitor's browser context.\n\nA data-exfiltration variant (split across both name fields) navigates the victim's browser to an attacker-controlled URL carrying `document.cookie` as a query parameter. End-to-end verification was performed using a local listener.\n\n## Exploitation Conditions (default configuration)\n\n| Condition | Default value | Effect |\n|---|---|---|\n| `captcha_area_comm` | `1` | No CAPTCHA for logged-in users — payload delivery requires no CAPTCHA solve |\n| `auto_postcomm` | enabled | Comments are published immediately without moderation |\n| `active_editinfo_censor` | `0` | Profile edits take effect immediately without admin review |\n| CSP `script-src` | `'unsafe-inline'` | Inline `onclick` handlers execute normally |\n\nAny registered member can set the payload and post a comment with no additional steps.\n\nIf `captcha_area_comm` is set to `0`, the `name` field of anonymous comments (`modules/comment/funcs/post.php`) is processed by the same `get_title(..., 1)` call, making exploitation possible without authentication.\n\n## Impact\n\nAn attacker with a regular user account can execute arbitrary JavaScript in the browser of any visitor who interacts with the Reply button on their comment, including site administrators.\n\nPractical consequences include:\n\n- **Privilege escalation via admin session hijacking** — forging administrative actions (content modification, account manipulation) in the context of an authenticated admin.\n- **Credential phishing** — injecting a fake login form into the page.\n- **Data exfiltration** — reading page content and non-`HttpOnly` cookies.\n\n> Note: NukeViet session cookies carry the `HttpOnly` flag, so they are not directly readable via `document.cookie`; however, the above attack vectors remain fully viable.\n\n## Remediation\n\n**Preferred fix:** Remove `post_name` from the inline handler entirely. Pass only `cid` to `nv_commment_feedback` and have the function retrieve the display name from the already-rendered DOM (e.g., the adjacent `<strong class=\"cm_item\">` element).\n\n**Alternative fix:** If the value must be passed inline, encode it with `json_encode($post_name)` (PHP) so that the output is a properly escaped JavaScript string literal, not an HTML-entity-encoded one. HTML numeric character references must not be relied upon for JavaScript string escaping.\n\nAs a general note, the result of `get_title(..., $specialchars=true)` is safe for HTML element content and quoted HTML attribute values, but **unsafe when placed inside a JavaScript string literal within an attribute**. Other locations in the codebase using the same pattern should be audited.\n\n## Resources\n\n- OWASP: Cross Site Scripting Prevention — Rule 2: Attribute Encoding is Not Sufficient for JS Contexts\n- CWE-79: Improper Neutralization of Input During Web Page Generation\n- CWE-116: Improper Encoding or Escaping of Output",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "nukeviet/nukeviet"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.6.00"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "< 4.5.09"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nukeviet/nukeviet/security/advisories/GHSA-w2w5-w2pw-r929"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nukeviet/nukeviet"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-13T17:22:26Z",
    "nvd_published_at" : null
  }
}