critical

CVE-2026-94565

Packagist · nukeviet/nukeviet

Summary

NukeViet CMS: Unauthenticated Stored XSS in the Contact Module

Severity
critical
CVSS
9.3
EPSS
0.8% (p59)
CWE
CWE-79
Also known as
GHSA-662q-v5rm-78gm
Published
2026-11-30
Updated
2026-11-30

Advisory details

Summary

A stored-XSS vulnerability in the Contact module allows any unauthenticated user to inject malicious Javascript.

Details

NukeViet's central input filter (NukeViet\Core\Request::filterTags), applied to virtually all POST data, is a denylist HTML sanitizer. Its most important rule strips any attribute whose name matches /^on/i (event handlers). This rule is bypassable through an HTML parser differential: the filter tokenizes a tag's attributes by splitting on ASCII space (0x20) only, whereas browsers also separate attributes on /. By inserting a / immediately before an event-handler name, the attacker makes the filter read the attribute name as /onerror — which does not start with on, so the denylist misses it — while the browser parses it as onerror and fires it.

The payload survives the entire filter chain unmodified and is stored and served raw (no output encoding) into the administration panel, which sends no Content-Security-Policy:

INPUT  : <img src=x /onerror=alert(document.domain)>
STORED : <img src="x" /onerror="alert(document.domain)" />
ADMIN  : <td colspan="2"><img src="x" /onerror="alert(document.domain)" /></td>

Because the handler executes in the same origin as the admin panel, an unauthenticated attacker who submits a crafted contact message obtains arbitrary JavaScript execution in the session of any administrator who opens it — enabling administrator account takeover.

PoC

Minimal payload

<img src=x /onerror=alert(document.domain)>

alert(document.domain) displays the site's real origin (e.g. the target host), proving same-origin execution.

Manual reproduction (fresh 4.6.00 install, default config)

  1. As an anonymous visitor open /contact/; set the message field to the payload above.
  2. Solve the CAPTCHA and submit (form returns status: ok).
  3. Log in to the admin panel; open Admin → Contact and view the message (admin/index.php?nv=contact&op=view&id=<id>).
  4. onerror fires on view; alert() shows the panel's own origin.

Impact

An unauthenticated attacker achieves arbitrary JavaScript execution in the same origin as the NukeViet admin panel, running in the session of any administrator who views the malicious contact message. Possible attacks:

  1. Super admin account persistence
  2. RCE via admin functions

Mitigation

  1. Tokenize attributes the way the HTML spec does. In filterTags(), treat / (and all HTML whitespace: tab, LF, FF, CR, space) as attribute separators, so /onerror is parsed as the token onerror and caught by the existing denylist. Equivalently, strip leading / and other non-name characters from the attribute name before the ^on test.
  2. Do not preserve non-conforming attribute names. Reject/normalize any attribute whose name is not [A-Za-z][A-Za-z0-9-]* after normalization, rather than emitting /onerror verbatim.
  3. Prefer an allowlist of attributes over the ^on denylist; drop anything not explicitly permitted for the element.

References

Related advisories

Is your project exposed to this? Stateward checks every dependency on every pull request and flags it only if your code actually reaches it.

Check my repo

Summarize with AI

ChatGPTClaudePerplexity

Sources: CISA KEV (public domain), OSV.dev & GitHub Advisory Database (CC-BY-4.0), FIRST EPSS, NVD/CWE (public domain). Served live from the Stateward advisory database.