/

CVE-2026-49489

Severity:

HIGH RISK

(8.5)

SQL Injection in OpenCATS DataGrid sortDirection Parameter

CVE-2026-49489

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Sensitive Data Exposure via Authenticated SQL Injection

Severity:

HIGH RISK

(8.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

OpenCATS through version 0.9.7.4 contains a SQL injection vulnerability in the DataGrid component's sortDirection parameter, exposed via ajax/getDataGridPager.php.

An authenticated attacker can inject crafted SQL into this parameter to perform time-based blind SQL injection, enabling extraction of sensitive database contents under certain conditions.

Affected context

The vulnerability exists in OpenCATS installations that expose the DataGrid paging endpoint (ajax/getDataGridPager.php) and accept the sortDirection parameter from client requests.

It is relevant in deployments where authenticated users can trigger DataGrid views (for example, when browsing or sorting lists in the application UI) and where the backend constructs SQL queries directly from request parameters without robust validation or parameterization.

Environments with sensitive recruitment, candidate, or client data stored in the same database face heightened risk.

Exploit preconditions

  • Attack surface: HTTP(S) requests to the OpenCATS web application, specifically the ajax/getDataGridPager.php endpoint.
  • Required access: Valid, authenticated user account with access to views that use the DataGrid component.
  • Trigger point: Invocation of the DataGrid pagination/sorting functionality where sortDirection is passed from the client request into SQL query construction.
  • Why exploitation is possible: The sortDirection parameter is concatenated into SQL statements without proper parameterization or strict allowlisting, enabling time-based blind SQL injection when the database processes crafted input as part of the query.

Why this happens

The core issue is unsafe construction of SQL queries using untrusted input from the sortDirection parameter.

Instead of treating sortDirection as a constrained control value (e.g., limited to ASC or DESC via explicit checks or enumeration), the application incorporates it directly into the SQL string.

This pattern maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where user-controllable data is merged into query text without parameterization or strict validation.

The lack of a strong allowlist for sort direction, combined with dynamic query building, permits attackers to smuggle additional SQL operations, which can be probed via time-based behavior of the database.

Potential impact

  • Authenticated attackers may extract sensitive database contents, including candidate, client, and recruitment-related data.
  • Exposure of user account information, including email addresses and potentially hashed passwords, depending on schema.
  • Unauthorized access to business-sensitive information such as notes, resumes, and communication history.
  • Use of information gained from the database to pivot into further attacks (e.g., account takeover via credential reuse).
  • Potential for limited data manipulation if payloads can modify records, depending on the surrounding query and permissions.

General mitigation guidance

Effective mitigation focuses on eliminating direct concatenation of user input into SQL and tightly constraining control parameters:

  • Replace dynamic string-building for queries with parameterized statements or prepared queries, ensuring that user-controlled data is always bound as parameters rather than interpolated into query text.
  • Treat directional and sorting parameters (sortDirection, column names) as enumerated values and apply strict allowlists (e.g., only ASC or DESC), rejecting or defaulting any unexpected values.
  • Centralize query-building helpers so that sorting and pagination use a vetted, shared abstraction that enforces safe patterns by default.
  • Reduce the privileges of the database account used by the application so that even if a query is abused, access to non-essential tables or dangerous operations is limited.
  • Apply defense-in-depth validation at the controller or service layer to normalize and constrain all request parameters before they influence data access logic.

How teams detect issues like this

Organizations can look for this class of issue and evidence of exploitation using several approaches:

  • Static analysis: Use SAST tools or custom rules to detect concatenation of HTTP parameters (such as $_GET, $_POST, or framework request objects) into SQL strings, especially around sorting and pagination logic.
  • Code review: During manual reviews, flag any query construction that interpolates user input (including seemingly harmless control values like sort direction) into ORDER BY or other clauses without strict allowlists.
  • Runtime monitoring and logs: Inspect application and database logs for anomalous patterns, such as unusual sortDirection values, delayed responses indicative of time-based probing, or atypical query shapes triggered by UI operations.
  • Security testing: Incorporate automated and manual SQL injection testing into CI/CD or periodic assessments, focusing not only on obvious input fields but also on parameters used for sorting, filtering, and paging.

Sources

SourceLink
github.comgithub.com/opencats/OpenCATS/security/advisories/GHSA-8mc8-5gw6-c7w4
packetstorm.newspacketstorm.news/files/id/222200/
exploit-db.comexploit-db.com/exploits/52579
vulncheck.comvulncheck.com/advisories/opencats-sql-injection-in-datagrid-sortdirection-parameter

Frequently asked

questions

It is remotely exploitable over HTTP(S), but it requires authenticated access to the OpenCATS web interface where the DataGrid component is available.

The attacker needs a valid user account with permissions sufficient to load the affected DataGrid views. Guest or unauthenticated users cannot typically reach the vulnerable endpoint in a default configuration.

The most robust fix is to remove direct string concatenation using request parameters and instead use parameterized queries combined with strict allowlists for control parameters like sortDirection, defaulting to safe values when unrecognized input is received.

Adopt a standard data access layer that enforces parameterized queries, treat all external input as untrusted, restrict control parameters to enumerated sets, and integrate automated security checks—such as SAST and security-focused code review—into the development lifecycle.

Find out what's already
exploitable in your codebase.