CVE-2026-49489: SQL Injection in OpenCATS via DataGrid sortDirection
A SQL injection vulnerability tracked as CVE-2026-49489 has been disclosed in OpenCATS, a popular open-source Applicant Tracking System (ATS). The flaw exists in the sortDirection parameter of the DataGrid component, accessible via ajax/getDataGridPager.php. Authenticated attackers can inject malicious SQL to perform time-based blind injection, enabling extraction of the full database contents.
The vulnerability was published on May 31, 2026, with a CVSS v3.1 score of 8.5 (High).
Vulnerability Overview
| Attribute | Value |
|---|---|
| CVE ID | CVE-2026-49489 |
| CVSS Score | 8.5 (High) |
| CWE Classification | CWE-89 — SQL Injection |
| Affected Component | ajax/getDataGridPager.php (DataGrid component) |
| Vulnerable Parameter | sortDirection |
| Attack Vector | Network (Remote) |
| Authentication Required | Yes (authenticated user) |
| Privileges Required | Low |
| Injection Type | Time-Based Blind SQL Injection |
| Published | May 31, 2026 |
Affected Products
| Product | Affected Versions |
|---|---|
| OpenCATS | Through 0.9.7.4 |
OpenCATS is a widely deployed open-source ATS used by HR departments, recruiting agencies, and enterprises to manage job applications, candidate pipelines, and hiring workflows. The software stores sensitive information including applicant resumes, personal contact details, employment history, and internal recruiter notes.
Technical Details
Root Cause
The DataGrid component in OpenCATS provides paginated, sortable data tables used throughout the application. The sortDirection parameter controls the sort order (ASC or DESC) for query results. The parameter is passed directly into a SQL ORDER BY clause without sanitization:
// Vulnerable pattern in getDataGridPager.php
$sortDirection = $_GET['sortDirection']; // or POST
$query = "SELECT * FROM candidates ORDER BY last_name " . $sortDirection . " LIMIT ...";ORDER BY clauses are not parameterizable in standard SQL — prepared statements cannot be used to bind ORDER BY direction. This requires explicit allowlist validation, which is absent in the vulnerable code.
Exploitation
Time-Based Blind Injection
The vulnerability supports time-based blind injection, allowing attackers to extract data character by character by measuring response delays:
GET /ajax/getDataGridPager.php?sortDirection=ASC%20AND%20SLEEP(5)--
A 5-second delay in the response confirms the injection is successful.
Automated Extraction with sqlmap
sqlmap -u "http://target/ajax/getDataGridPager.php?sortDirection=ASC" \
--technique=T \
--cookie="PHPSESSID=<session>" \
--dbs \
--level=3Data Available for Extraction
From the OpenCATS database schema, an attacker can access:
candidates— Full applicant profiles including names, emails, phone numbers, addressesuser— System user credentials (username, password hashes, email)joborder— Open and closed job postings with internal notesactivity— Recruiter activity logs and communication historyattachment— Resume and document file references
Why ORDER BY Injection is Underestimated
SQL injection via ORDER BY parameters is frequently overlooked during code reviews and security audits because:
- It cannot be mitigated with standard parameterized query patterns
- Developers often assume only
WHEREclauses require sanitization - The parameter appears innocuous — it accepts only
ASCorDESCin normal use - Automated scanners may miss it if they focus on error-based or union-based payloads
The correct fix is a whitelist validation before the value reaches any query:
// Secure replacement
$allowedDirections = ['ASC', 'DESC'];
$sortDirection = strtoupper($_GET['sortDirection'] ?? 'ASC');
if (!in_array($sortDirection, $allowedDirections, true)) {
$sortDirection = 'ASC';
}Impact Assessment
| Area | Impact |
|---|---|
| Candidate Privacy | Full applicant PII including contact info and employment history exposed |
| Credential Theft | System user accounts and password hashes extractable |
| Business Intelligence | Internal job postings, pipeline status, and hiring notes accessible |
| Legal/Regulatory | GDPR, PIPEDA, CCPA applicant data protection obligations implicated |
| Attacker Skill Requirement | Low — time-based SQLi is fully automatable with sqlmap |
Remediation
Fix the sortDirection Parameter
The immediate fix is allowlist validation of the sortDirection parameter before it is used in any database query:
$allowed = ['ASC', 'DESC'];
$dir = strtoupper(trim($_REQUEST['sortDirection'] ?? 'ASC'));
$sortDirection = in_array($dir, $allowed, true) ? $dir : 'ASC';Audit All DataGrid Usages
The getDataGridPager.php file may be used by multiple DataGrid instances across the application. Audit every caller to verify that all sort column and direction parameters are validated before use in SQL.
Additional Hardening
- Upgrade OpenCATS — Check the official OpenCATS GitHub repository for patches addressing CVE-2026-49489
- Enable query logging — Review MySQL/MariaDB slow query logs for anomalous patterns such as
SLEEP()calls - Apply a WAF rule — Block requests where
sortDirectioncontains characters beyond[A-Za-z] - Review related parameters — The
sortColumnparameter (which controls the ORDER BY column) may be similarly vulnerable and should be audited alongsidesortDirection
OpenCATS in Production Environments
OpenCATS is often self-hosted by organizations that lack dedicated security teams. Many deployments run outdated versions with limited monitoring. Factors that increase real-world risk include:
- Public-facing deployments — Recruiting portals are often internet-accessible for external applicants
- Long-lived sessions — If an attacker obtains any user's session cookie, exploitation is straightforward
- Rich data stores — ATS databases are high-value targets for data brokers, competitors, and ransomware operators
Key Takeaways
- CVE-2026-49489 is a CVSS 8.5 time-based blind SQL injection in OpenCATS through version 0.9.7.4
- The vulnerable parameter is
sortDirectioninajax/getDataGridPager.php— anORDER BYinjection, which cannot be fixed with prepared statements alone - The fix requires allowlist validation of the sort direction value before it reaches the query
- Exploitation is straightforward for authenticated users and fully automatable
- ATS databases contain highly sensitive applicant PII — organizations should treat this as a priority remediation