Summary
A command injection flaw in the /stream-to-vlc Express route of Zenshin before version 2.7.0 allows untrusted user input from the url parameter to be incorporated into operating system commands.
Remote attackers can leverage this to execute arbitrary commands on the underlying server when the vulnerable route is exposed over the network.
Affected context
This vulnerability appears in Zenshin deployments that:
- Run a Node.js/Express server exposing the
/stream-to-vlcendpoint - Use the
urlquery parameter to build or pass arguments to system-level tools (e.g., VLC or shell commands) - Do not robustly validate, sanitize, or safely parameterize the
urlparameter before invoking OS commands
The risk is highest when the route is reachable from untrusted networks such as the public internet.
Exploit preconditions
- Attack surface: HTTP interface, specifically the
/stream-to-vlcExpress route - Required access: Ability to send HTTP requests to the vulnerable endpoint (no special privileges implied)
- Trigger point: Supplying crafted values via the
urlparameter in a request to/stream-to-vlc - Why exploitation is possible: The handler appears to concatenate or embed the
urlparameter directly into a shell or process execution call without proper escaping or use of a safe API, enabling injection of additional OS commands or arguments.
Why this happens
The underlying issue maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command.
In the /stream-to-vlc Express route, user-controlled data from the url parameter is likely passed into a command execution function (such as child_process.exec or similar) as part of a shell command string.
Because this data is not strictly validated, normalized, or passed as separate, safely-escaped arguments, shell metacharacters and additional commands can be interpreted by the OS, turning simple input into executable instructions.
Potential impact
- Execution of arbitrary commands on the server hosting Zenshin
- Unauthorized access to local files and sensitive data
- Installation of malware, backdoors, or cryptominers
- Use of the compromised server as a pivot point for lateral movement
- Service disruption or denial of service by terminating processes or exhausting resources
General mitigation guidance
Effective mitigation focuses on removing the ability for user input to influence shell parsing and on hardening the execution environment:
- Prefer safe process execution APIs that avoid invoking a shell, and pass user input as strictly-typed arguments rather than interpolated strings.
- Apply strict allowlists for acceptable
urlvalues, including protocol, host, and path constraints, and reject any input that does not match expected patterns. - Normalize and validate input thoroughly, stripping or rejecting shell metacharacters and unexpected characters instead of attempting ad-hoc sanitization.
- Apply the principle of least privilege to the process executing external commands, reducing file system, network, and system-level permissions.
- Isolate the component that interacts with external tools (e.g., VLC) inside a constrained environment such as a container, jail, or sandbox.
How teams detect issues like this
Detection typically combines code-centric and operational approaches:
- Use static analysis or linting rules to flag any use of shell-based execution functions (e.g.,
exec,execSync) that combine string concatenation with request parameters likereq.query.url. - During code review, look for routes that pass user-controlled data into command-line utilities, particularly where template literals or string concatenation are used to build commands.
- Enforce secure coding policies that require parameterized process execution and prohibit shell invocation with untrusted input.
- Monitor runtime logs and telemetry for unusual command patterns originating from the Zenshin process (e.g., unexpected shells, package managers, or network tools being invoked).

