Summary
AVideo up to version 29.0 exposes an OS command injection flaw in the ffmpeg.json.php endpoint, where user-controlled parameters are concatenated directly into a shell command.
An attacker who can craft a valid encrypted payload for this API can inject shell metacharacters via the notifyCode and callback fields, leading to arbitrary command execution as the web-server user.
Affected context
The vulnerability arises in AVideo deployments that:
- Use the ffmpeg.json.php endpoint to trigger or manage ffmpeg processing
- Accept encrypted request payloads that include notifyCode and callback parameters
- Construct shell commands by concatenating these parameters without proper escaping or argument separation
It is relevant where attackers can obtain or forge valid encrypted payloads, for example through compromised API clients, misconfigurations, or key leakage.
Exploit preconditions
- Attack surface: HTTP(S) interface exposing ffmpeg.json.php
- Required access: Ability to submit requests with correctly encrypted payloads recognized by the AVideo instance
- Trigger point: Invocation of ffmpeg.json.php that builds a shell command using notifyCode and callback
- Why exploitation is possible: The application passes unvalidated, user-controlled values directly into a shell command string, allowing shell metacharacters to alter command structure and inject additional commands.
Why this happens
This issue stems from building shell commands by string concatenation with attacker-influenced input and then executing them through a shell interpreter.
Instead of treating notifyCode and callback as opaque data or sanitized command arguments, the code embeds them directly into the command line.
This pattern aligns with CWE-78: Improper Neutralization of Special Elements used in an OS Command, where input is not adequately constrained or escaped before being interpreted by the operating system shell.
Potential impact
- Execution of arbitrary OS commands as the web-server user
- Reading or modifying files accessible to the application account
- Pivoting to other services or internal systems reachable from the server
- Deployment of webshells or backdoors for persistent access
- Disruption of video processing workflows or denial of service
General mitigation guidance
Effective mitigation focuses on removing direct shell interpretation of user-controlled data and narrowing what commands can run:
- Prefer safe process execution APIs that pass arguments as arrays and do not invoke a shell.
- Treat notifyCode, callback, and similar parameters as data, enforcing strict whitelists or format validation.
- Avoid building command lines through string concatenation; map high-level actions to predefined, parameterized commands.
- Run the web application and ffmpeg processes under least-privilege accounts with minimal filesystem and network access.
- Isolate video-processing components in separate containers or sandboxes to limit blast radius if command execution occurs.
How teams detect issues like this
Detection typically combines code-level analysis with runtime monitoring:
- Use static analysis or linters to flag shell execution functions that accept concatenated strings with user input (e.g., exec, system, shell_exec, backticks).
- During code review, look for ffmpeg invocation code that interpolates request parameters into command strings, especially notifyCode and callback.
- Apply security policies that prohibit direct shell execution of user-controlled data and require argument-based process invocation.
- Monitor logs and process activity for unusual ffmpeg invocations, unexpected shell processes, or outbound connections originating from the web-server user.

