Summary
Open ISES Tickets before version 3.44.2 contains a SQL injection flaw in portal/ajax/list_requests.php, where user-controlled sort and dir GET parameters are concatenated directly into an ORDER BY clause without sanitization or validation.
Authenticated attackers who can access the portal request listing can manipulate these parameters to alter query semantics and potentially read, modify, or destroy database contents.
Affected context
The vulnerability occurs in the AJAX endpoint portal/ajax/list_requests.php, which builds SQL queries to list ticket requests in the Open ISES Tickets portal.
It affects deployments where:
- The portal is accessible to authenticated users, and
- The
sortanddirGET parameters are passed directly into the SQLORDER BYclause, and - There is no central sanitization or strict allowlisting of sortable columns and sort directions.
Under these conditions, a logged-in user who can load or interact with the request list can influence the SQL executed by the backend.
Exploit preconditions
- Attack surface: Web application over HTTP/HTTPS (portal AJAX endpoint).
- Required access: Valid authenticated account with access to the ticket listing interface.
- Controllable input:
sortanddirGET parameters supplied toportal/ajax/list_requests.php. - Trigger point: Backend construction of a SELECT query where the
ORDER BYclause is built by string concatenation from these parameters. - Why exploitation is possible: The code treats user-supplied values as trusted SQL fragments, without validation, escaping, or binding, allowing an attacker to inject arbitrary SQL into the query structure.
Why this happens
This issue is an instance of CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
The application constructs SQL dynamically by concatenating untrusted GET parameters (sort and dir) into an ORDER BY clause.
Instead of using parameterized queries or strictly mapping user input to predefined column names and directions, it directly embeds the raw strings into the SQL statement.
This insecure pattern enables attackers to break out of the intended syntax and inject additional SQL operations, because database interpreters treat the combined string as a single executable command.
Potential impact
- Attackers may read sensitive ticket or user information beyond what their role should allow.
- Attackers may modify existing records, such as changing ticket details, ownership, or status.
- Attackers may delete ticket data or entire tables, causing data loss and operational disruption.
- Attackers may infer or exfiltrate other database contents, depending on the underlying database and query structure.
- In certain environments, attackers could chain this with other weaknesses to escalate privileges or pivot to other systems.
General mitigation guidance
Effective mitigation focuses on eliminating direct concatenation of untrusted data into SQL and constraining how dynamic query parts are built.
Common defensive patterns include:
- Using parameterized queries or prepared statements for all user-controlled input, even for non-filter clauses where supported.
- Implementing strict allowlists for sortable columns and sort directions, mapping incoming
sortanddirvalues to predefined, constant SQL fragments. - Centralizing query-building logic so that dynamic ordering or filtering is handled by a safe abstraction rather than ad-hoc string concatenation.
- Applying least-privilege principles at the database layer so the application account has only the minimal permissions necessary for its operations.
- Validating and normalizing all HTTP parameters early, rejecting or defaulting invalid values before they reach the query-building code.
How teams detect issues like this
Organizations can detect similar SQL injection risks through multiple complementary approaches:
- Static analysis: Configure rules to flag string concatenation used in SQL query construction, especially around
ORDER BY,WHERE, andLIMITclauses, or whenever database APIs receive interpolated user input. - Code review: Look for places where HTTP parameters (
$_GET,$_POST, request objects) flow directly into SQL strings without passing through validation or an ORM/parameterization layer. - Security testing: Use dynamic application security testing (DAST) to send crafted
sortanddirvalues and observe for SQL errors, anomalous result sets, or response timing indicative of injection. - Policy enforcement: Establish secure coding guidelines requiring parameterized queries and allowlisted fields, and enforce them via pre-merge checks and automated code review tools integrated into CI/CD pipelines.
- Runtime monitoring: Inspect database logs for unusual query patterns, such as unexpected keywords in
ORDER BYor complex expressions originating from web traffic.

