Summary
Guardian language-system contains an OS command injection flaw where a user-controlled GET parameter is passed directly into a PHP exec() call without sanitization.
An unauthenticated remote attacker can append shell metacharacters via the id parameter to execute arbitrary operating system commands on the server under vulnerable configurations.
Affected context
This vulnerability occurs in deployments of the Guardian language-system where text.php is accessible over HTTP and uses PHP's exec() to start background jobs.
The id GET parameter is concatenated into a shell command string alongside session-related values and executed without validation or escaping.
Environments that expose this script publicly, run PHP with sufficient OS privileges, and do not enforce additional access controls are most at risk.
Exploit preconditions
- Attack surface: Publicly reachable HTTP endpoint (text.php)
- Required access: None; exploitation is unauthenticated and remote
- Trigger point: Handling of requests to text.php that include a crafted id GET parameter
- Why exploitation is possible: User-controlled data is directly interpolated into a shell command passed to exec(), allowing injection of shell metacharacters and arbitrary command sequences
Why this happens
The root cause is the direct concatenation of untrusted input into a shell command string that is executed via PHP's exec() function.
This corresponds to CWE-78: Improper Neutralization of Special Elements used in an OS Command, where application input is not validated, escaped, or constrained before being incorporated into operating system commands.
Instead of treating user input as data, the implementation allows it to influence command structure, enabling attackers to break out of the intended command and run arbitrary OS-level instructions.
Potential impact
- Remote execution of arbitrary OS commands on the web server
- Installation of malware or backdoors on the host
- Reading, modifying, or deleting application and system files
- Pivoting to other internal systems from the compromised server
- Complete takeover of the affected application environment
General mitigation guidance
Effective mitigation focuses on eliminating direct command construction from user input and reducing the authority of any remaining command execution paths.
Common defensive patterns include:
- Avoiding use of shell-invoking APIs (such as exec, system, passthru) for routine application logic, preferring native language functions or libraries
- When command execution is unavoidable, strictly validating inputs against a fixed allowlist of safe values and avoiding free-form strings
- Using APIs that bypass the shell and pass arguments as structured parameters, preventing interpretation of metacharacters
- Running the application under least-privilege accounts and isolating command-executing components to minimize impact if misuse occurs
- Designing endpoints so that untrusted clients cannot influence command content at all, treating any user input as data rather than control
How teams detect issues like this
Detection typically involves a combination of code-level and operational checks:
- Static analysis rules that flag uses of exec(), system(), passthru(), or similar APIs where arguments include user-controlled variables
- Code review practices that scrutinize any OS-level command execution, checking for strict input validation and absence of shell metacharacter exposure
- Security linting and CI policies that enforce bans or strict patterns around command execution functions
- Runtime monitoring and logging to spot unusual command patterns, unexpected child processes, or anomalous outbound connections from the web server

