Summary
Guardian language-system contains a command injection flaw where the id GET parameter is passed directly into a PHP exec() call without sanitization.
Because no authentication is required, a remote attacker can append shell metacharacters to the id parameter and execute arbitrary operating system commands on the server.
Affected context
This vulnerability occurs in the Guardian language-system within translate_text.php, where user-supplied request data is used to construct a shell command.
It is relevant in deployments that expose this script over HTTP without additional authentication or input validation, and where the underlying OS command execution environment is available and has access to system resources.
Exploit preconditions
- Attack surface: Public-facing web endpoint handling
translate_text.php - Required access: Network access to the application; no login or prior authentication needed
- Trigger point: Supplying a crafted
idparameter that is concatenated into theexec("php jobs/translate_text.php ".$login_session." ".$_GET['id']." ...")call - Why exploitation is possible: The application directly interpolates untrusted input into a shell command string, enabling injection of shell metacharacters and arbitrary command execution.
Why this happens
The underlying bug is an instance of CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
The application constructs a command line string by concatenating user-supplied data ($_GET['id']) into a call to exec() without any sanitization, escaping, or argument separation.
This pattern treats untrusted input as part of executable shell syntax, allowing attackers to break out of the intended command structure and append arbitrary commands.
Potential impact
- Remote execution of arbitrary OS commands with the privileges of the web server process
- Reading, modifying, or deleting application and system files
- Installing backdoors or persistent malware on the host
- Pivoting to other internal systems reachable from the compromised server
- Disruption of service availability through resource exhaustion or destructive commands
General mitigation guidance
Effective mitigation centers on eliminating direct use of untrusted input in shell commands and constraining execution environments.
Recommended patterns include:
- Avoiding shell-based invocation entirely, and calling internal application logic or libraries directly instead of via
exec(). - When OS-level commands are truly necessary, using APIs that pass arguments as arrays rather than concatenated strings, and applying strict whitelist validation to each argument.
- Performing rigorous input validation and normalization on request parameters, restricting them to expected formats (e.g., numeric IDs or fixed tokens) before use.
- Running the application and any command execution under least-privilege accounts, limiting filesystem and network access so that a successful injection has reduced impact.
- Designing the system so that external command execution is disabled by default and only enabled in carefully controlled contexts.
How teams detect issues like this
Detection efforts generally focus on identifying unsafe command construction patterns and monitoring runtime behavior:
- Static analysis rules that flag uses of
exec(),shell_exec(),system(), or backticks where user input influences the command string. - Code review checklists emphasizing the separation of data from command syntax, and verifying that all parameters passed to OS commands are validated or derived from trusted sources.
- Application security policies that prohibit dynamic shell command construction and require the use of safer APIs or internal function calls.
- Runtime monitoring for unusual command executions, outbound connections, or file operations originating from the web application process that may indicate exploitation attempts.
Automated security scanning tools and CI-integrated linters can help systematically surface command injection patterns during development.

