# NukeViet CMS: Unauthenticated Stored XSS in the Contact Module via HTML Sanitizer Bypass

Unauthenticated stored XSS in NukeViet Contact module: sanitizer's numeric-entity decoder capped leading zeros at 8, so 9+ zeros smuggled a javascript: URI past scheme checks into admin panel.

- Payout: Research
- Severity: high
- Program: NukeViet CMS
- Found by: dkoazw
- Disclosed: 2026-11-30
- CVE: CVE-2026-94564
- Write-up quality: 7/10
- Original: https://github.com/advisories/GHSA-7pv3-g7fw-7xhq
- Library page: https://bugbountylibrary.com/r/ghsa%3AGHSA-7pv3-g7fw-7xhq
- Tags: area:web domain:web impact:ato impact:integrity kind:research platform:ghsa sev:high tech:php technique:parser-differential technique:source-review vuln:xss

**Target:** Contact module message field (fcon) rendered in admin panel
**Root cause:** The numeric HTML-entity decoding regex used `0{0,8}`, so entities with 9+ leading zeros were not decoded before javascript: scheme checks; the original un-canonicalized value was stored, and browsers decode unlimited leading zeros.
**Steps:**
1. Open public form `index.php?language=vi&nv=contact` unauthenticated.
2. Submit `fcon` with `%3Ciframe%20src%3D%22%26%23x0000000006a%3Bavascript%3Aparent.location.href%3D%27https%3A%2F%2Fexample.com%2F%27%22%3E%3C%2Fiframe%3E`.
3. Sanitizer fails to decode `j` (9 zeros > `0{0,8}`), scheme check passes, payload stored.
4. Admin opens message; browser decodes entity to `javascript:` and executes in admin origin.
**How found:** Code review of Request.php sanitizer: noticed entity-decoding regex bounded leading zeros at 8 while browsers accept unlimited, and that checks ran on canonicalized copy but original was stored.
**Exploitation:** Anonymous submission of iframe with entity-encoded javascript: URI; executes on admin viewing the Contact message, enabling same-origin data reads and CSRF-token-harvesting admin writes (bounded by HttpOnly session cookie and password re-auth gates).
**Escalation:** Session-riding in admin origin: read DOM anti-CSRF tokens to perform admin write actions without password re-auth.
**Insight:** When auditing sanitizers, compare the decoder's exact grammar (quantifier bounds, entity forms) against browser parsing; any mismatch between the checked copy and the stored copy is a bypass primitive.

## Proof of concept (copied exactly from the original report)

**URL-encoded iframe payload for fcon field**

```
%3Ciframe%20src%3D%22%26%23x0000000006a%3Bavascript%3Aparent.location.href%3D%27https%3A%2F%2Fexample.com%2F%27%22%3E%3C%2Fiframe%3E
```

