Summary
Guardian language-system contains an OS command injection flaw where the untrusted id GET parameter is passed directly into a PHP exec() call.
An unauthenticated remote attacker can craft a malicious request that appends shell metacharacters to this parameter, resulting in arbitrary command execution on the server.
Affected context
The vulnerability occurs in the Guardian language-system within translate.php, where a PHP exec() call is built by concatenating user input from the id GET parameter.
It is relevant in deployments where this script is exposed over HTTP, no authentication or access control is enforced, and the underlying PHP process has permission to execute shell commands.
The risk increases in environments where the web server or PHP user has broad system privileges or access to sensitive data and internal network resources.
Exploit preconditions
- Attack surface: Publicly exposed
translate.phpendpoint accessible over HTTP/HTTPS. - Required access: No authentication; any remote user can send requests with a custom
idparameter. - Trigger point: The vulnerable
exec("php jobs/translate.php ".$login_session." ".$_GET['id']." ...")call on line 14 oftranslate.php. - Why exploitation is possible: The application directly interpolates the unvalidated
idparameter into a shell command, allowing attackers to inject shell metacharacters (such as;,&&,|) that the shell interprets as additional commands, matching CWE-78: Improper Neutralization of Special Elements used in an OS Command.
Why this happens
The root cause is the insecure construction of shell commands by string-concatenating untrusted HTTP parameters into a call to PHP's exec() function.
No sanitization, escaping, or validation is applied to the id parameter, and the code relies on the shell to interpret the final command line string.
This pattern aligns with CWE-78, where special elements (shell metacharacters) in untrusted input are not properly neutralized before inclusion in OS-level commands, enabling attackers to break out of intended arguments and execute arbitrary commands.
Potential impact
- Remote execution of arbitrary OS commands under the PHP/web server user context.
- Reading, modifying, or deleting application data and configuration files.
- Planting webshells or backdoors to maintain long-term access.
- Pivoting into internal networks reachable from the affected server.
- Exfiltration of credentials, API keys, and other secrets stored on the system.
- Full server takeover if the PHP/web server user has elevated privileges.
General mitigation guidance
Effective mitigation focuses on avoiding direct shell invocation with user-controlled input and constraining any necessary command execution.
Recommended defensive patterns include:
- Replacing
exec()and other shell-based functions with safer, high-level APIs or language-native functions that do not invoke a shell. - If command-line tools must be used, building argument lists using APIs that bypass the shell and treating each argument as a separate parameter.
- Strictly validating the
idparameter against an allowlist of expected formats (for example, numeric IDs or predefined tokens) and rejecting any value that does not conform. - Applying least-privilege principles to the web server and PHP runtime so that, even if a command is executed, the resulting damage is constrained.
- Centralizing and reviewing any command-execution logic to ensure consistent sanitization and secure patterns across the application.
How teams detect issues like this
Detection efforts can combine code-level inspection with runtime monitoring:
- Static analysis rules targeting PHP functions such as
exec,system,shell_exec,passthru, and backtick operators when concatenated with$_GET,$_POST, or other superglobals. - Manual code reviews that flag any dynamic shell command construction, especially where user input is concatenated into command strings without validation or escaping.
- Secure coding policies that require justification and security review for any OS command execution in web-exposed code paths.
- Runtime monitoring and logging to detect suspicious command patterns, unexpected child processes, or anomalous behavior originating from the web server process.
- Integration of automated SAST/DAST tools into CI/CD pipelines to regularly scan for command injection patterns and regressions.

