Summary
Guardian language-system contains a critical SQL injection flaw where the id GET parameter is directly embedded into a SQL query in job_info.php without sanitization.
An unauthenticated attacker can leverage error-based SQL injection to enumerate database metadata and extract table contents simply by sending crafted HTTP requests.
Affected context
This vulnerability occurs in the Guardian language-system web application, specifically in the job_info.php endpoint that queries job details from a backend database.
It is present when the application:
- Accepts the
idparameter via HTTP GET - Directly concatenates this parameter into SQL queries
- Executes the resulting query on the database without parameterization or validation
The risk is highest in internet-exposed deployments where the job information page is reachable without authentication.
Exploit preconditions
- Attack surface: Public-facing web endpoint
job_info.php - Required access: None; the endpoint is reachable without authentication
- Trigger point: Supplying a crafted
idvalue in the query string of the HTTP request - Why exploitation is possible: The application builds SQL statements via string concatenation using untrusted user input, allowing attackers to manipulate the query structure and cause error-based responses that reveal database details.
Why this happens
The underlying bug is unsafe construction of SQL queries using direct string concatenation of user-controlled data.
In job_info.php, the id GET parameter is interpolated into the query SELECT * FROM jobs where id = '".$_GET['id']."' without any escaping or parameter binding.
This behavior maps to CWE-89: SQL Injection, where untrusted input is included in SQL commands, enabling attackers to alter the intended query, access unauthorized data, or interfere with database operations.
Potential impact
- Attackers may extract database version and configuration information.
- Attackers could enumerate schemas, tables, and columns in the database.
- Attackers can read sensitive table contents, including user or application data.
- Attackers may modify or delete records, impacting data integrity and availability.
- Attackers could pivot to application-level compromise if sensitive credentials or tokens are stored in the database.
General mitigation guidance
Effective mitigation centers on eliminating string-based query construction and reducing trust in user input before it reaches the database.
Pattern-based defensive measures include:
- Using parameterized queries (prepared statements) for all database interactions, ensuring user input is treated as data rather than executable query text.
- Applying strict input validation and normalization on identifiers and query parameters, constraining them to expected formats (such as numeric IDs).
- Centralizing database access through a data access layer that enforces safe query APIs and denies raw string concatenation.
- Implementing least-privilege database accounts so that even if a query is abused, accessible data and operations are limited.
- Returning generic error messages to the client while logging detailed errors server-side, reducing the usefulness of error-based injection techniques.
How teams detect issues like this
Detection generally focuses on identifying unsafe query construction patterns and anomalous query behavior.
Common approaches include:
- Static analysis rules that flag SQL strings built via concatenation with request parameters or other untrusted sources.
- Code review checklists requiring verification that all queries use parameterization, especially in request-handling scripts like
job_info.php. - Runtime monitoring of database queries to spot unusual patterns, such as queries referencing system tables or metadata schemas triggered by public endpoints.
- Enforcing secure coding policies in CI/CD pipelines that reject changes introducing raw SQL concatenation.
- Optional use of application security testing tools (DAST and SAST) to automatically probe and identify SQL injection vulnerabilities in web endpoints.

