Summary
WWBN AVideo's standalone encoder remains vulnerable to OS command injection due to incomplete sanitization of shell metacharacters in ffmpeg command handling.
An attacker able to craft a valid encrypted payload for the encoder API can chain backgrounded shell commands, leading to arbitrary code execution under the encoder's OS account.
Affected context
The vulnerability appears in WWBN AVideo deployments that use the standalone encoder and expose the ffmpeg JSON API endpoint accepting encrypted command payloads.
It manifests when user-controlled, encrypted input is decrypted and interpolated into a shell command that is executed via sh -c without fully neutralizing shell control characters, particularly the single & background operator.
The risk is most relevant where the encoder is network-accessible and the encryption scheme or keys can be abused or controlled by an attacker.
Exploit preconditions
- Attack surface: Network-exposed ffmpeg JSON API endpoint on the standalone encoder server.
- Required access: Ability to craft or supply a valid encrypted
codeToExecEncryptedpayload that the server will accept. - Trigger point: The decrypted payload is passed into
sanitizeFFmpegCommand(), then concatenated into a shell string and executed viaexecAsync()usingsh -c. - Why exploitation is possible: The sanitization function denylists some dangerous characters but fails to neutralize the single
&, allowing attackers to append additional shell commands that execute in the background.
Why this happens
The root cause is a classic OS Command Injection pattern where partially sanitized input is embedded into a shell command string and executed.
The sanitization logic follows a character-denylist approach that focuses on specific metacharacters ($, (, ), etc.) but overlooks the single & operator.
Because sh -c interprets & as a background command separator, an attacker can inject additional commands even when other metacharacters are blocked, aligning with CWE-78: Improper Neutralization of Special Elements used in an OS Command.
Potential impact
- Attackers may execute arbitrary OS commands under the encoder server's user account.
- The encoder host could be used as a pivot point for further network attacks.
- Malicious binaries or scripts can be downloaded, dropped, and executed on the server.
- System integrity and confidentiality of video assets and configuration data can be compromised.
- The encoder infrastructure may be co-opted into botnets or used for data exfiltration.
General mitigation guidance
Effective mitigation centers on removing shell interpretation from the execution path and treating command components as data, not code.
Recommended patterns include:
- Avoid building commands as strings for
sh -c; instead, use APIs that accept argument arrays and bypass shell parsing. - Replace character denylist filtering with strict allowlists or structured representations of valid ffmpeg options.
- Separate user-controlled parameters from the command template and validate them against a known-safe schema or whitelist.
- Introduce a narrow, declarative configuration model for encoder tasks, preventing arbitrary flags or subcommands.
- Run the encoder under a minimally privileged account and, where feasible, in an isolated environment (e.g., containers, jails) to limit blast radius.
How teams detect issues like this
Detection typically focuses on surfacing shell-embedded user input and incomplete sanitization routines.
Useful approaches include:
- Static analysis rules that flag uses of
sh -c,exec, or similar functions receiving concatenated or decrypted user input. - Code review checklists that call out denylist-based sanitization and encourage allowlist or structured approaches.
- Configuration and CI policies that disallow shell execution of dynamically constructed commands in API paths.
- Runtime monitoring or EDR solutions tuned to detect unusual process trees spawned by the encoder service (e.g., curl, nc, or shell interpreters).

