Summary
Guardian language-system exposes a critical OS command injection flaw where a GET parameter is concatenated directly into a PHP exec() call without sanitization.
An unauthenticated remote attacker can send crafted requests with shell metacharacters in the id parameter, leading to arbitrary command execution on the server.
Affected context
The vulnerability occurs in Guardian language-system within transcribe.php, where user-controlled request data is passed into a shell command.
It manifests when PHP exec() builds its command string by concatenating the id GET parameter and session data without any validation, escaping, or use of safer execution patterns.
Any deployment that exposes transcribe.php over HTTP and allows direct access to the id parameter is potentially affected, especially if the web server user has broad system privileges.
Exploit preconditions
- Attack surface: HTTP endpoint invoking transcribe.php
- Required access: Unauthenticated ability to send requests with an id GET parameter
- Trigger point: The exec("php jobs/transcribe.php " . $login_session . " " . $_GET['id'] . "...") call in transcribe.php
- Why exploitation is possible: The id parameter is directly concatenated into a shell command string, allowing injection of shell metacharacters and arguments interpreted by the underlying OS command processor.
Why this happens
The root cause is the direct use of untrusted input in constructing an operating system command, mapped to CWE-78: Improper Neutralization of Special Elements used in an OS Command (OS Command Injection).
Instead of treating the id value as data, the code dynamically builds a shell command line with PHP exec(), allowing user-supplied content to alter command structure.
This pattern bypasses any logical separation between data and executable instructions, enabling attackers to append additional commands or arguments.
Potential impact
- An attacker may execute arbitrary OS commands under the web server's account.
- An attacker could read, modify, or delete application and system files accessible to the PHP process.
- An attacker can pivot to other internal services or perform lateral movement within the host or network.
- An attacker may install backdoors, drop malicious scripts, or fully compromise the affected server.
- An attacker could disrupt service availability through destructive commands or resource exhaustion.
General mitigation guidance
Effective mitigation focuses on removing direct shell command construction from untrusted input flows and minimizing the need for OS-level invocation.
Common patterns include:
- Replacing shell calls with native PHP or application APIs where possible, avoiding exec() and similar functions entirely.
- If OS commands are unavoidable, using argument-vector execution (e.g., escapeshellarg-equivalent patterns) to strictly separate command and arguments.
- Applying rigorous validation on all external inputs, constraining id to expected formats and values before use.
- Running the web application under a least-privilege account and isolating execution environments to limit blast radius.
- Designing the system so that HTTP endpoints cannot influence low-level shell operations directly, favoring message or job abstractions instead.
How teams detect issues like this
Detection typically combines code-level and operational approaches:
- Static analysis rules targeting uses of exec(), shell_exec(), system(), and backtick operators with concatenated or unsanitized user input.
- Manual code reviews focused on request-handling paths that build command strings, especially where GET or POST parameters are used in exec calls.
- Policy-based checks in CI/CD pipelines that flag risky function usage or require justification and hardening patterns.
- Runtime monitoring and logging of command execution, anomalous subprocess activity, and unexpected CLI invocations by the web application.

