high

CVE-2026-94598

Packagist · nukeviet/nukeviet

Summary

NukeViet CMS: Stored XSS via internal marker injection in iframe srcdoc sanitization

Severity
high
CVSS
8.2
EPSS
0.6% (p51)
CWE
CWE-79
Also known as
GHSA-p7cw-whjw-crcm
Published
2026-11-30
Updated
2026-11-30

Advisory details

Impact

A stored cross-site scripting (XSS) vulnerability exists in the HTML sanitizer of NukeViet\Core\Request (filterTags() and filterAttr()).

When an attribute contains HTML content (the srcdoc attribute of <iframe>), the sanitizer decodes its value and filters it again with filterTags(). Internally, filterTags() rebuilds allowed tags with placeholder markers ({@[, ]@}, [@{, }@]) and converts them back to <, > and " at the end. The input was never checked for these markers.

The characters [ and ] can be sent as HTML entities (for example &#91;, &#x5b; or &lbrack;), and they are decoded before the recursive call.

An attacker can therefore place markers inside a srcdoc value. These markers skip all tag and attribute filtering and are turned into real HTML tags.

A marker can also be formed by joining a marker generated by the sanitizer with attacker-controlled characters. In that case a generated tag is left unclosed, and the text that follows becomes attributes of that tag.

Example input:

<iframe srcdoc="{@[img src=x onerror=alert(document.domain)]@}"></iframe>

Stored output:

<iframe srcdoc="&lt;img src=x onerror=alert(document.domain)&gt;"></iframe>

The browser decodes the srcdoc attribute and renders <img src=x onerror=alert(document.domain)>. An srcdoc iframe without the sandbox attribute has the same origin as the parent page. The injected script can read the page and send requests with the victim's session.

The only requirement is that iframe is in the allowed HTML tags list (NV_ALLOWED_HTML_TAGS). iframe is allowed in the default configuration.

Every input read with $nv_Request->get_editor() is affected, for example:

Through the contact form, an unauthenticated attacker can run JavaScript in the administration origin when an administrator opens the message. The script can read data from the admin panel and perform administrative actions on the administrator's behalf. Session cookies are HttpOnly, so they cannot be read directly. The default Content-Security-Policy allows 'unsafe-inline' and does not block this attack.

Patches

The issue has been fixed in NukeViet 4.6.02.

Users should upgrade to version 4.6.02 or later.

Workarounds

If upgrading is not possible right away:

These steps only block new payloads. Content that was stored before remains in the database. Search stored content (comments, contact messages, articles) for srcdoc and remove any suspicious entries.

Resources

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.