Skip to main content
COSMICBYTEZLABS
NewsSecurityHOWTOsToolsStudyTraining
ProjectsNewsletterHire MeAbout
Subscribe

Press Enter to search or Esc to close

News
Security
HOWTOs
Tools
Study
Training
Projects
Newsletter
Hire Me
About
RSS Feed
Reading List
Subscribe

Stay in the Loop

Get the latest security alerts, tutorials, and tech insights delivered to your inbox.

Subscribe NowFree forever. No spam.
COSMICBYTEZLABS

Your trusted source for IT intelligence, cybersecurity insights, and hands-on technical guides.

1310+ Articles
157+ Guides

CONTENT

  • Latest News
  • Security Alerts
  • HOWTOs
  • Checklists
  • Projects
  • Exam Prep

RESOURCES

  • Search
  • Browse Tags
  • Newsletter Archive
  • Reading List
  • RSS Feed

COMPANY

  • About Us
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CosmicBytez Labs. All rights reserved.

System Status: Operational
  1. Home
  2. Security
  3. CVE-2026-49489: OpenCATS ATS SQL Injection via sortDirection Parameter
CVE-2026-49489: OpenCATS ATS SQL Injection via sortDirection Parameter
SECURITYHIGHCVE-2026-49489

CVE-2026-49489: OpenCATS ATS SQL Injection via sortDirection Parameter

A SQL injection vulnerability in OpenCATS through 0.9.7.4 allows authenticated attackers to extract database contents by injecting malicious SQL via the sortDirection parameter in the DataGrid component.

Dylan H.

Security Team

June 1, 2026
5 min read

Affected Products

  • OpenCATS 0.9.7.4 and earlier

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

AttributeValue
CVE IDCVE-2026-49489
CVSS Score8.5 (High)
CWE ClassificationCWE-89 — SQL Injection
Affected Componentajax/getDataGridPager.php (DataGrid component)
Vulnerable ParametersortDirection
Attack VectorNetwork (Remote)
Authentication RequiredYes (authenticated user)
Privileges RequiredLow
Injection TypeTime-Based Blind SQL Injection
PublishedMay 31, 2026

Affected Products

ProductAffected Versions
OpenCATSThrough 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=3

Data Available for Extraction

From the OpenCATS database schema, an attacker can access:

  • candidates — Full applicant profiles including names, emails, phone numbers, addresses
  • user — System user credentials (username, password hashes, email)
  • joborder — Open and closed job postings with internal notes
  • activity — Recruiter activity logs and communication history
  • attachment — 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:

  1. It cannot be mitigated with standard parameterized query patterns
  2. Developers often assume only WHERE clauses require sanitization
  3. The parameter appears innocuous — it accepts only ASC or DESC in normal use
  4. 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

AreaImpact
Candidate PrivacyFull applicant PII including contact info and employment history exposed
Credential TheftSystem user accounts and password hashes extractable
Business IntelligenceInternal job postings, pipeline status, and hiring notes accessible
Legal/RegulatoryGDPR, PIPEDA, CCPA applicant data protection obligations implicated
Attacker Skill RequirementLow — 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

  1. Upgrade OpenCATS — Check the official OpenCATS GitHub repository for patches addressing CVE-2026-49489
  2. Enable query logging — Review MySQL/MariaDB slow query logs for anomalous patterns such as SLEEP() calls
  3. Apply a WAF rule — Block requests where sortDirection contains characters beyond [A-Za-z]
  4. Review related parameters — The sortColumn parameter (which controls the ORDER BY column) may be similarly vulnerable and should be audited alongside sortDirection

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

  1. CVE-2026-49489 is a CVSS 8.5 time-based blind SQL injection in OpenCATS through version 0.9.7.4
  2. The vulnerable parameter is sortDirection in ajax/getDataGridPager.php — an ORDER BY injection, which cannot be fixed with prepared statements alone
  3. The fix requires allowlist validation of the sort direction value before it reaches the query
  4. Exploitation is straightforward for authenticated users and fully automatable
  5. ATS databases contain highly sensitive applicant PII — organizations should treat this as a priority remediation

Sources

  • CVE-2026-49489 — NIST NVD
  • OpenCATS GitHub Repository
#CVE-2026-49489#OpenCATS#SQL Injection#ATS#CWE-89#Authenticated#Vulnerability

Related Articles

CVE-2026-10184: SourceCodester Hospital Records SQL Injection via Delete

A SQL injection vulnerability in SourceCodester Hospitals Patient Records Management System 1.0 allows remote attackers to extract database contents by manipulating the ID parameter in the user delete endpoint.

4 min read

CVE-2026-10185: SourceCodester Hospital Records SQL Injection via Save

A SQL injection vulnerability in SourceCodester Hospitals Patient Records Management System 1.0 enables remote attackers to extract database contents by manipulating the ID parameter in the user save endpoint.

5 min read

CVE-2026-10178: SQL Injection in Online Music Site 1.0 Admin Panel

A remotely exploitable SQL injection vulnerability has been disclosed in code-projects Online Music Site 1.0, affecting the Administrator PHP AdminEditAlbum endpoint. A public exploit is available and no patch exists.

5 min read
Back to all Security Alerts