Summary
NukeViet CMS's Comment module can render attacker-controlled, base64-encoded content without escaping it. Because the required check token can be reused across sessions, an unauthenticated attacker may craft a URL that causes HTML or JavaScript to run in a victim's browser.
Affected context
The issue affects NukeViet CMS Comment module deployments before version 4.5.09 where comment status content is decoded and assigned for rendering without output escaping. The checkss token is based on the site-wide NV_CACHE_PREFIX rather than the session-specific NV_CHECK_SESSION, which can make a token exposed in public comment markup reusable across sessions.
Exploit preconditions
- Attack surface: The Comment module's status_comment handling and rendering path
- Required access: No authenticated account is required; the attacker must be able to provide attacker-controlled content and induce a victim to visit a crafted URL
- Trigger point: The victim's browser renders the decoded status_comment content
- Why exploitation is possible: The content is not escaped before rendering, and the checkss token may be reused across sessions
Why this happens
The application decodes attacker-controlled input and assigns it to content that is rendered without context-appropriate output encoding. This is a cross-site scripting flaw mapped to CWE-79. The checkss token's derivation from a site-wide cache prefix also weakens the session boundary by allowing a token disclosed in public markup to be reused across sessions.
Potential impact
- Attacker-controlled JavaScript could run in a victim's browser in the context of the NukeViet site
- Victims could be shown convincing phishing content
- Script could perform actions available to the victim's browser session
- The issue could undermine user trust in content served by the site
General mitigation guidance
Mitigation generally focuses on treating submitted content as untrusted and protecting session-sensitive operations.
Common defensive patterns include:
- Applying context-appropriate output encoding to all user-controlled content before rendering
- Avoiding direct rendering of decoded input as HTML; use safe text rendering or a restrictive sanitization policy when rich content is required
- Binding anti-CSRF or request validation tokens to the user's session rather than a site-wide value
- Keeping token values out of public markup where possible and validating them at the point of use
- Limiting the privileges available to user accounts and applying browser-side defenses such as a restrictive Content Security Policy as defense in depth
How teams detect issues like this
High-level detection approaches include:
- Static analysis for decoded or otherwise transformed user input reaching HTML output without context-aware encoding
- Code review of comment rendering paths, especially assignments to output variables and template contexts
- Reviewing token generation and validation for session binding and exposure in public markup
- Enforcing policies that require output encoding or approved sanitization for untrusted content
- Using automated security review tools to help identify unsafe input-to-output flows

