AVideo OS Command Injection via Unescaped m3u8 URL (CVE-2026-45578)
AVideo is vulnerable to OS command injection (CVE-2026-45578) in the `on_publish.php` file due to improper sanitization of the m3u8 URL, allowing attackers to execute arbitrary commands by injecting shell metacharacters.
AVideo, a video-sharing platform, is susceptible to a critical OS command injection vulnerability (CVE-2026-45578) within the on_publish.php file. The issue stems from constructing a command line for execAsync() by directly concatenating strings, single-quoting arguments without proper escaping using escapeshellarg(). This flaw, located in the YPTSocket notification branch of the Live plugin, enables a malicious actor to inject arbitrary commands by embedding a single quote (') within the $m3u8 URL or other command parameters. Successful exploitation allows the attacker to execute arbitrary OS commands with the privileges of the web server runtime user. This vulnerability affects AVideo versions up to and including 29.0. The lack of input sanitization and direct web accessibility to on_publish.php are key factors enabling this attack.
Attack Chain
- Attacker gains a
canStreamaccount on the AVideo platform. - Attacker crafts a malicious stream key containing a single quote and shell metacharacters (e.g.,
evilkey';id>/tmp/pwn;#) and persists it viasaveLive.php. - Attacker sends a POST request directly to
https://target/plugin/Live/on_publish.phpwith the crafted stream key in thenameparameter and a valid password in thepparameter. on_publish.phpprocesses the POST request, strips&and=, but permits the single quote and other shell metacharacters in the stream key.Live::getM3U8Fileconstructs the m3u8 URL with the injected payload (e.g.,https://server/live/evilkey';id>/tmp/pwn;#.m3u8).- The command string is built using string concatenation without proper escaping, resulting in a vulnerable command.
execAsync()executes the command, leading to OS command injection.- Attacker achieves arbitrary OS command execution with the privileges of the web server user.
Impact
Successful exploitation of this vulnerability (CVE-2026-45578) grants the attacker the ability to execute arbitrary OS commands on the AVideo server. This could lead to several consequences, including unauthorized access to sensitive data such as database credentials, exfiltration of user information, deployment of a webshell for persistent access, lateral movement to other plugin credentials (PayPal/Stripe API keys, AWS keys), or privilege escalation via local sudoers entries. The impact is significant, potentially leading to complete compromise of the AVideo platform.
Recommendation
- Apply the provided patch that utilizes
escapeshellarg()on all variables interpolated into the command string inplugin/Live/on_publish.phpto prevent shell injection (see code diff in Overview). - Implement an
.htaccessor nginxlocationrule to restrict access to/plugin/Live/on_publish.phpto127.0.0.1and authorized RTMP server IPs as a defense-in-depth measure (see Overview). - Deploy the Sigma rule “Detect AVideo on_publish.php Command Injection Attempt” to identify potential exploitation attempts by monitoring for POST requests to
on_publish.phpwith shell metacharacters in thenameparameter (see Rules). - Enable webserver logging to capture HTTP requests, which are essential for detecting and investigating exploitation attempts (see Rules - logsource).
Detection coverage 2
Detect AVideo on_publish.php Command Injection Attempt
highDetects CVE-2026-45578 exploitation — HTTP POST to /plugin/Live/on_publish.php with shell metacharacters in the name parameter indicating a command injection attempt.
Detect AVideo on_publish.php Socket Notification Process Creation
mediumDetects process creation events where the on_publish_socket_notification.php script is executed with suspicious arguments.
Detection queries are available on the platform. Get full rules →