NukeViet CMS CVE-2026-49259
HIGHSeverity by source
AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N
Any low-privileged member can store the payload (PR:L, AC:L, AV:N); a victim must click Reply (UI:R); script runs in the victim's browser crossing a trust boundary (S:C) enabling session/content compromise (C:H/I:H), with no availability impact.
Primary rating from GitHub Advisory.
CVSS VectorGitHub Advisory
Lifecycle Timeline
3DescriptionGitHub Advisory
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.tplline 27 (top-level comments)themes/default/modules/comment/comment.tplline 64 (nested/reply comments)
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 (' → ', ( → (, ) → ), / → /) 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, ' 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:
a');alert(document.domain);//The value is stored as a');alert(document.domain);//.
When a visitor clicks the Reply link on the comment, the browser renders:
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-
HttpOnlycookies.
> 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
AnalysisAI
Stored cross-site scripting in NukeViet CMS 4.x through 4.5.08 lets a low-privileged authenticated member embed a JavaScript payload in their profile display name (first_name/last_name), which then executes when any visitor - including administrators - clicks the Reply/Answer link on that member's comment. The flaw stems from HTML-entity encoding being applied where JavaScript-string escaping is required, so the payload runs in the victim's session context and can drive admin session actions, credential phishing, and data exfiltration. Publicly available exploit code exists (a working PoC is published in the GHSA advisory), though there is no public exploit identified as actively used in the wild.
Technical ContextAI
NukeViet is an open-source PHP/MySQL content management system (distributed as the composer package nukeviet/nukeviet). The vulnerability lives in the comment module template themes/default/modules/comment/comment.tpl (lines 27 and 64), where the {COMMENT.post_name} variable is interpolated into an inline onclick handler: onclick="nv_commment_feedback(event, {COMMENT.cid}, '{COMMENT.post_name}')". The display name is sanitized via Request::_get_title() with $specialchars=true, which converts characters such as the apostrophe to HTML numeric character references (' → '). This is a textbook CWE-79/CWE-116 output-encoding mismatch: browsers decode HTML entities in attribute values before the JavaScript engine parses the embedded string literal, so ' is decoded back to a real apostrophe that terminates the JS string early and the remainder executes as script. Contributing factors include a CSP script-src of 'unsafe-inline', which permits inline onclick handlers to run.
RemediationAI
Upgrade NukeViet CMS to a fixed release - the advisory metadata lists the fix in 4.5.09 (patched range < 4.5.09) with the change carried forward to 4.6.00; treat 4.5.09 as the minimum patched version and confirm against the vendor advisory at https://github.com/nukeviet/nukeviet/security/advisories/GHSA-w2w5-w2pw-r929. The vendor-recommended code fix is to remove post_name from the inline onclick handler entirely and have nv_commment_feedback read the display name from the already-rendered DOM (the adjacent <strong class="cm_item"> element); if the value must be passed inline, encode it with PHP json_encode($post_name) to produce a proper JavaScript string literal rather than relying on HTML numeric character references. Where immediate patching is not possible, compensating controls include enforcing a stricter Content-Security-Policy that removes 'unsafe-inline' from script-src (side effect: existing inline onclick handlers across the theme will break and must be refactored to external handlers), enabling comment moderation by disabling auto_postcomm and enabling active_editinfo_censor so profile edits and comments are admin-reviewed before publication (side effect: added moderation workload and delayed publishing), and keeping captcha_area_comm at its default of 1 so anonymous comment posting cannot be abused for unauthenticated delivery. Teams should also audit other code paths that place get_title(..., true) output inside JavaScript string contexts.
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-79 – Cross-site Scripting (XSS)
View allShare
External POC / Exploit Code
Leaving vuln.today
GHSA-w2w5-w2pw-r929