CVE-2026-63305 — AVideo API FFmpeg process permits OS command injection via notifyCode/callback

### Summary The standalone FFmpeg execution endpoint `plugin/API/standAlone/ffmpeg.json.php` builds a shell command string that is passed to `execAsync()` and run via `nohup sh -c ""`. When the decrypted `codeToExec` payload produces a non-empty `avideoPath`, the endpoint appends a completion hook of the form: ``` && php notify= notifyCode=notifyCode> callback=callback> ``` The `notify` value on this line is wrapped with `escapeshellarg()`, but the two adjacent fields `notifyCode` and `callback` are concatenated raw. Both fields originate from the same decrypted, attacker-controlled `codeToExec` object as `ffmpegCommand`, but neither passes through the `sanitizeFFmpegCommand()` denylist (only `ffmpegCommand` does) and neither is shell-escaped. An attacker who can craft a valid encrypted payload can therefore inject arbitrary shell commands into the `sh -c` context by placing shell metacharacters in `callback` or `notifyCode`, achieving OS command execution as the web-server user. This is a residual sibling of the recently hardened `sanitizeFFmpegCommand()` denylist: the denylist now strips `; | ` < > & $ ( ) \n \r { }` from `ffmpegCommand`, but the two sibling fields on the same completion-hook line were never routed through it nor escaped, even though the `notify` value beside them on the very same line already is escaped. ### Vulnerable code `plugin/API/standAlone/ffmpeg.json.php` (master HEAD, around lines 406-412): ```php if (!empty($output['avideoPath'])) { if (file_exists($output['avideoPath'])) { unlink($output['avideoPath']); } $outputJson = escapeshellarg(json_encode($output)); $ffmpegCommand .= " && php " . escapeshellarg(__DIR__ . "/ffmpeg.json.php") . " notify={$outputJson} notifyCode={$codeToExec->notifyCode} callback={$codeToExec->callback}"; } ``` `$outputJson` is escaped; `$codeToExec->notifyCode` and `$codeToExec->callback` are interpolated raw. The only field that is sanitized earlier is `ffmpegCommand` (line ~129): ```php $ffmpegCommand = !empty($codeToExec->ffmpegCommand) ? sanitizeFFmpegCommand($codeToExec->ffmpegCommand) : ''; ``` `sanitizeFFmpegCommand()` (`plugin/API/standAlone/functions.php`, line ~105) strips shell metacharacters: ```php $command = preg_replace('/[;|`&$()\n\r{}]/', '', $command); ``` `notifyCode` / `callback` never touch this function. The composed string flows to `execAsync()` in `objects/functionsExec.php` (around line 705), which runs it via `sh -c`: ```php $commandWithKeyword = "nohup sh -c \"$command & echo \\$! > /tmp/$keyword.pid\" > /dev/null 2>&1 &"; exec($commandWithKeyword, $output, $retval); ``` `addcslashes($command, '"')` earlier in `execAsync()` escapes only double quotes, not `;`, `$(...)`, backticks, etc., so injected metacharacters in `notifyCode` / `callback` reach the shell intact. ### Reachability The completion-hook branch (`&& php ... notify=`) runs only when `$output['avideoPath']` is non-empty. `avideoPath` is set by the regex at line ~146: ```php preg_match('/ [\'"]?(\/[0-9a-z_\/-]+\/videos\/([0-9a-z_\/-]+)\/([0-9a-z_-]+\.(mp4|mp3)))[\'"]?/i', $ffmpegCommand, $matches); ``` This is trivially satisfied by including a benign `/.../videos//.mp4` output path in `ffmpegCommand` (a normal FFmpeg command already contains one). The malicious `callback` / `notifyCode` need no metacharacter-free constraint because they bypass the denylist entirely. ### Privilege required Same trust boundary as the parent command-injection fix in this file: an attacker who can craft a valid encrypted `codeToExec` payload with a valid `APISecret`. `_decryptString()` calls the platform `decryptString` API, which runs `encrypt_decrypt()` (AES-256-CBC; key = `hash('sha256', $global['saltV2'])`, iv = `substr(hash('sha256', $global['systemRootPath']), 0, 16)`). The decrypted payload is accepted when `payload->time` is within the last 30 seconds. The endpoint requires no interactive login. ### Reproduction (end-to-end, against master HEAD) Deployed the master HEAD source (commit `8eaca9d5`, da

Published

CVSS 3.1 score 8.1 out of 10.

Reported versions and fixes

  • Source-reported product — Reported version range < 29.1.0 — Fixed in 29.1.0

Source evidence