Summary
WWBN AVideo versions up to and including 29.0 contain an OS command injection risk in test.php due to incomplete input sanitization on multiple download code paths.
While escapeshellarg is applied to the wget branch, the file_get_contents and curl branches still accept loosely validated URLs, enabling crafted inputs that bypass the /^http/ regex check and potentially lead to command execution in certain environments.
Affected context
The vulnerability manifests in AVideo deployments that expose test.php and allow user-controlled URLs to be passed into that script.
The protection added with escapeshellarg only hardens the wget invocation, while alternative retrieval paths using file_get_contents and curl still rely on a weak regular expression (/^http/) to vet URLs.
Environments where these functions interact with shell commands, system utilities, or follow redirects in unsafe ways are particularly at risk.
Exploit preconditions
- Attack surface: Web-accessible
test.phpendpoint (or any code path using the same logic). - Required access: Ability to send HTTP requests that control the URL parameter consumed by
test.php. - Trigger point: Submission of a crafted URL that passes the
/^http/regex but is interpreted in a way that influences downstream command or system interactions. - Why exploitation is possible: Input validation is limited to checking that the string starts with
http, which does not robustly constrain the scheme, host, or structure.
Unsanitized values are then passed through file_get_contents and curl code paths, leaving room for unexpected behavior and command injection where these workflows ultimately invoke or influence shell commands.
Why this happens
At its core, this is an OS Command Injection (CWE-78) issue caused by incomplete input sanitization across multiple execution paths.
An earlier fix correctly recognized the risk of passing user-supplied URLs into wget and wrapped that argument in escapeshellarg, but did not apply equivalent hardening or structural validation to the file_get_contents and curl branches.
Combined with a permissive regex (/^http/) that allows malformed or attacker-controlled URLs like httpevil[.]com, the application continues to treat loosely validated external input as safe, leaving room for user-controlled data to influence security-sensitive operations.
Potential impact
- Remote execution of arbitrary OS commands under the web server's privileges in vulnerable configurations
- Download and execution of attacker-controlled payloads on the server
- Unauthorized access to internal network resources via server-side request forgery (SSRF)-style behavior
- Exfiltration or manipulation of sensitive data accessible from the AVideo server
- Service disruption or denial of service by forcing resource-intensive or malicious external calls
General mitigation guidance
Mitigation should focus on strictly constraining and decoupling user input from any command or network-sensitive operations:
- Treat all user-provided URLs as untrusted and apply strict allowlists for schemes (e.g.,
http/https) and hostname patterns. - Use robust URL parsing APIs to validate host, scheme, and path instead of relying on simple regular expressions like
/^http/. - Avoid constructing shell commands with user input altogether; rely on high-level HTTP client libraries that do not invoke shells.
- When shell interaction is unavoidable, ensure every parameter is independently escaped and avoid building commands via string concatenation.
- Run the web server and associated helper processes with the least privileges needed, and minimize outbound network permissions to restrict where the server can connect.
- Consider disabling or tightly controlling diagnostic endpoints like
test.phpin production environments.
How teams detect issues like this
Detection can leverage both code-focused and behavior-focused approaches:
- Static analysis: Flag any use of
shell_exec,exec,system, backticks, or similar functions where arguments incorporate request parameters, especially URLs, without strict validation and escaping. - Code review: Look for weak validation patterns such as
/^http/or other minimal regex checks guarding security-sensitive operations, and identify duplicated logic where some branches are sanitized and others are not. - Policy enforcement: Enforce secure coding guidelines that prohibit building command-line strings directly from user input and that mandate centralized URL validation helpers.
- Runtime monitoring: Use application and web server logs to detect abnormal outbound connections or repeated calls to
test.phpwith malformed URLs, which may indicate probing or exploitation attempts.

