{"id":"GHSA-3q6c-wfxw-7hj6","summary":"NukeViet CMS: Reflected XSS in news module search via double URL decoding of the q parameter","details":"### Impact\n\nThis is a reflected Cross-Site Scripting (XSS) vulnerability in the search function of the `news` module.\nIt is caused by the search keyword being URL-decoded after it has already been sanitized (CWE-174: Double Decoding of the Same Data).\n\nThe `q` parameter is read with `$nv_Request-\u003eget_title()`, which neutralizes `'`, `\"`, `\u003c` and `\u003e`.\nDuring that filtering, `%XX` sequences are resolved once more, so a value such as `%2522` becomes the literal text `%22` and passes the filter untouched.\n`modules/news/funcs/search.php` then called `urldecode()` on the filtered value, turning `%22` into a real `\"` after all sanitization had run.\nThe resulting raw keyword was passed to `search_theme()` and `search_result_theme()` and printed without escaping into:\n\n- the `value=\"{KEY}\"` attribute of the search input (attribute breakout, e.g. `autofocus onfocus=...`);\n- the `\u003cstrong\u003e{KEY}\u003c/strong\u003e` element of the \"no results\" message (full tag injection, e.g. `\u003csvg onload=...\u003e`).\n\nBoth the `default` and `mobile_default` themes are affected.\n\nProof of concept (the `autofocus` attribute makes the payload fire on page load without further interaction):\n\n```\nhttps://example.com/search/?q=%252522%252520autofocus%252520onfocus%25253D%252522alert(document.domain)\n```\n\nAn unauthenticated attacker can craft such a link and send it to any visitor.\nWhen the victim opens it, arbitrary JavaScript runs in the origin of the NukeViet site.\nSession cookies are `HttpOnly`, so they cannot be read directly.\nHowever, the script can perform any same-origin action on behalf of the victim, including reading CSRF tokens and submitting forms.\nIf the victim is a logged-in administrator, this can be used to perform administrative actions in the admin panel.\nThe default Content Security Policy allows `'unsafe-inline'`, so it does not mitigate the attack.\n\nAny site with the `news` module enabled is affected.\n\nAffected versions: `\u003e= 4.5.00, \u003c= 4.6.01`.\nThe vulnerable `urldecode()` call was introduced in commit `76ee0a8b9` (April 2021).\n\n### Patches\n\nThe vulnerability has been fixed in NukeViet `4.6.02`.\nUsers should upgrade to `4.6.02` or later.\n\nThe fix removes the extra `urldecode()` and the ad hoc filtering, and uses the output of `get_title()` directly.\nThat output is already decoded and HTML-escaped, so it is safe both for SQL (via `dblikeescape()`) and for output in templates.\nThe keyword length is still limited by `NV_MAX_SEARCH_LENGTH`.\n\n### Workarounds\n\nIf upgrading is not possible right away, apply the patch manually in `modules/news/funcs/search.php` by replacing:\n\n```php\n$key = $nv_Request-\u003eget_title('q', 'get', '');\n$key = str_replace([\"'\", '\"', '\u003c', '\u003e', '&#039;', '&quot;', '&lt;', '&gt;'], '', $key);\n$key = str_replace('+', ' ', urldecode($key));\n$key = trim(nv_substr($key, 0, NV_MAX_SEARCH_LENGTH));\n$keyhtml = nv_htmlspecialchars($key);\n```\n\nwith:\n\n```php\n$key = nv_substr($nv_Request-\u003eget_title('q', 'get', ''), 0, NV_MAX_SEARCH_LENGTH);\n```\n\nand replacing every use of `$dbkeyhtml` / `$_dbkeyhtml` with `$dbkey` / `$_dbkey` in the same file.\n\nAs a temporary mitigation, a WAF rule can reject requests to the `news` search page whose `q` parameter contains `%25` (an encoded `%`), which blocks the multi-encoded payloads.","aliases":["CVE-2026-94599"],"modified":"2026-11-30T21:45:08.714747923Z","published":"2026-11-30T21:13:33Z","database_specific":{"github_reviewed":true,"github_reviewed_at":"2026-11-30T21:13:33Z","nvd_published_at":"2026-11-20T19:18:57Z","cwe_ids":["CWE-174","CWE-79"],"severity":"MODERATE"},"references":[{"type":"WEB","url":"https://github.com/nukeviet/nukeviet/security/advisories/GHSA-3q6c-wfxw-7hj6"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-94599"},{"type":"WEB","url":"https://github.com/nukeviet/nukeviet/commit/3bfe2c541edf76dee309ffcdae7b1ecb91bf3467"},{"type":"WEB","url":"https://github.com/nukeviet/nukeviet/commit/de6b594b2bed0b6976293eec3815230e1f3ffe63"},{"type":"PACKAGE","url":"https://github.com/nukeviet/nukeviet"},{"type":"WEB","url":"https://github.com/nukeviet/nukeviet/blob/4.5.13/CHANGELOG.txt"},{"type":"WEB","url":"https://github.com/nukeviet/nukeviet/releases/tag/4.6.02"},{"type":"WEB","url":"https://nukeviet.vn/vi/news/Tin-tuc/thong-bao-phat-hanh-nukeviet-4-6-02-858.html"}],"affected":[{"package":{"name":"nukeviet/nukeviet","ecosystem":"Packagist","purl":"pkg:composer/nukeviet/nukeviet"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.5.00"},{"fixed":"4.5.13"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-3q6c-wfxw-7hj6/GHSA-3q6c-wfxw-7hj6.json"}},{"package":{"name":"nukeviet/nukeviet","ecosystem":"Packagist","purl":"pkg:composer/nukeviet/nukeviet"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.6.00"}]}],"versions":["4.6.00"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-3q6c-wfxw-7hj6/GHSA-3q6c-wfxw-7hj6.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"}]}