Skip to content
CVE-2026-77367 IBM QRadar · QRadar

Detect Daptin Unauthenticated SQL Injection via `sort` Parameter (CVE-2026-77367) in IBM QRadar

Detects exploitation of CVE-2026-77367, an unauthenticated SQL injection vulnerability in Daptin (github.com/daptin/daptin) versions <= 0.12.29. The `sort` query parameter on every entity list endpoint (e.g. GET /api/{entity}?sort=...) is concatenated directly into the ORDER BY clause of the backend SQL query without validation or allowlisting (CWE-20/CWE-89), allowing an unauthenticated attacker to inject arbitrary SQL. Because ORDER BY context forbids UNION directly, attackers typically weaponise this with subqueries, boolean/time-based blind techniques (e.g. CASE WHEN ... THEN ... ELSE), or stacked statements depending on the backend (SQLite/MySQL/Postgres). Detection focuses on anomalous `sort` parameter values on Daptin entity list endpoints containing SQL metacharacters and injection keywords from unauthenticated clients. Fixed in v0.12.30 (commit b0bcc1318832b9055781f032853ef9d2264652cf).

MITRE ATT&CK

Tactic
Initial Access Collection

QRadar Detection Query

IBM QRadar (QRadar)
sql
-- df00tech DF00-d8c004827c · https://df00tech.com/detections/CVE-2026-77367 · licence: https://df00tech.com/detections/licence
SELECT sourceip, url, "URL Path" AS urlpath, COUNT(*) AS hits FROM events WHERE LOGSOURCETYPENAME(devicetype) ILIKE '%web%' AND url ILIKE '%/api/%' AND url ILIKE '%sort=%' AND (url ILIKE '%select%' OR url ILIKE '%union%' OR url ILIKE '%case%when%' OR url ILIKE '%sleep(%' OR url ILIKE '%pg_sleep%' OR url ILIKE '%benchmark(%' OR url ILIKE '%randomblob%' OR url ILIKE '%sqlite_master%' OR url ILIKE '%information_schema%' OR url ILIKE '%27%' OR url ILIKE '%--%' OR url ILIKE '%2527%') GROUP BY sourceip, url, urlpath ORDER BY hits DESC LAST 24 HOURS
high severity medium confidence

QRadar AQL querying web/proxy events for SQL injection indicators in the `sort` parameter of Daptin /api/ requests over the last 24 hours, grouped by source IP and URL.

Data Sources

Web Proxy LogsWeb Server Access Logs

Required Tables

events

False Positives & Tuning

  • Legitimate URLs containing SQL keyword substrings in column or entity names
  • Authorized penetration testing engagements
  • Proxy log replays from threat feeds

Other platforms for CVE-2026-77367


Testing Methodology

Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are further down this page.

  1. Test 1 Boolean-based blind SQLi probe via sort parameter

    Expected signal: Web/proxy access log entry for GET /api/user_account with URL-encoded sort parameter containing 'CASE WHEN'

  2. Test 2 Time-based blind SQLi via sort parameter (SQLite)

    Expected signal: Access log entry with elevated response time and sort parameter containing 'randomblob'

  3. Test 3 Quote/comment metacharacter injection probe

    Expected signal: Web log entry with URL-encoded sort value name'-- and likely HTTP 500 response


Response Playbook

Triage

  1. Confirm the targeted host runs Daptin and determine its version; versions <= 0.12.29 are vulnerable. Check the release/banner or deployment manifest and compare against the fixed v0.12.30.
  2. Extract and URL-decode the full `sort` parameter value from the flagged request(s) and classify the injection technique (boolean-blind CASE WHEN, time-based sleep/pg_sleep/benchmark/randomblob, subquery data exfiltration, or stacked statements).
  3. Determine whether the request was unauthenticated (no/invalid session token), this CVE requires no authentication, so unauthenticated hits on entity list endpoints are high priority.
  4. Review response status codes and sizes/timing for the flagged requests: HTTP 500 errors or anomalously long response times indicate the injection was processed by the database.

Containment

  1. Deploy a WAF/reverse-proxy rule to reject requests to Daptin /api/ endpoints where the `sort` parameter does not match a strict column-name allowlist (alphanumeric, underscore, optional leading '-' and comma-separated fields only).
  2. Upgrade Daptin to v0.12.30 or later (commit b0bcc1318832b9055781f032853ef9d2264652cf) across all instances; if immediate patching is not possible, restrict network access to the Daptin API to trusted sources.
  3. Block the identified attacker source IP(s) at the perimeter and invalidate any sessions or API tokens observed from them.

Evidence Collection

  1. Preserve full web/proxy access logs containing the raw and decoded `sort` parameter values, source IPs, user agents, timestamps, and response codes/sizes.
  2. Capture the Daptin application and database query logs for the affected time window to identify which SQL statements executed and what data was read.
  3. Snapshot the backing database (SQLite file / MySQL / Postgres) and Daptin configuration to support damage assessment and determine whether credentials or sensitive entity data were exfiltrated.

Escalation Criteria

  • !Escalate to incident response if the injected payload demonstrates successful data retrieval (differential boolean responses, measurable time delays, or error-based data in responses) rather than mere probing.
  • !Escalate if evidence shows exfiltration of user credentials, API tokens, or administrative records, or if stacked-statement write/DDL activity is observed against the database.
  • !Escalate to the application owner and change management to expedite the v0.12.30 upgrade if any vulnerable internet-exposed Daptin instance is confirmed.

Investigation Guide

Forensic Artifacts

  • >Web/reverse-proxy access logs with the raw and URL-decoded `sort` query parameter
  • >Daptin application logs and database query/slow logs showing the executed ORDER BY clause
  • >Backing database audit trail and any error logs referencing malformed ORDER BY syntax

Tuning Guidance

Baseline the legitimate `sort` values produced by your Daptin front-end and whitelist them; most real traffic uses simple column names with an optional leading '-' for descending order. Tighten the metacharacter match (quotes, parentheses, semicolons, comment sequences) if commas/parentheses appear in legitimate multi-column sorts. Exclude known scanner source IPs used for authorized testing. Prioritise alerts where the source is unauthenticated and where response status is 500 or response timing is anomalous, which distinguish successful injection from benign keyword collisions.


Hunting Queries

Hunt for SQL injection payloads in the Daptin `sort` parameter across historical web logs, grouped by source IP to surface repeat offenders and blind-injection probing.

Hunting — KQL
kql
// df00tech DF00-d8c004827c · https://df00tech.com/detections/CVE-2026-77367 · licence: https://df00tech.com/detections/licence
W3CIISLog | where csUriStem has "/api/" and csUriQuery has "sort=" | extend sortVal = url_decode(extract(@"[?&]sort=([^&]+)", 1, csUriQuery)) | where sortVal matches regex @"(?i)(case\s+when|sleep\(|pg_sleep|benchmark\(|randomblob|'|--)" | summarize count(), make_set(sortVal) by cIP
Hunting — SPL
spl
``` df00tech DF00-d8c004827c · https://df00tech.com/detections/CVE-2026-77367 · licence: https://df00tech.com/detections/licence ```
index=web uri_query="*sort=*" uri_path="*/api/*" | rex field=uri_query "(?i)[?&]sort=(?<s>[^&]+)" | eval s=urldecode(s) | search s="*select*" OR s="*case when*" OR s="*sleep(*" OR s="*'*" OR s="*--*" | stats count values(s) by src_ip

Atomic Red Team Tests

Test 1 Boolean-based blind SQLi probe via sort parameter
linux

Sends a CASE WHEN conditional payload in the sort parameter to a lab Daptin instance to test whether differential responses reveal the injection.

Command

bash
curl -s -G 'http://daptin.lab.local:6336/api/user_account' --data-urlencode "sort=(CASE WHEN (1=1) THEN name ELSE email END)"

Cleanup

bash
echo 'No cleanup required; read-only request'

Expected Telemetry

Web/proxy access log entry for GET /api/user_account with URL-encoded sort parameter containing 'CASE WHEN'

Expected Detection

KQL/SPL/EQL rules match on the 'case when' keyword in the decoded sort parameter

Test 2 Time-based blind SQLi via sort parameter (SQLite)
linux

Injects a randomblob-based delay payload in the sort parameter against a lab Daptin instance using a SQLite backend to confirm time-based blind injection.

Command

bash
curl -s -o /dev/null -w '%{time_total}\n' -G 'http://daptin.lab.local:6336/api/world' --data-urlencode "sort=(CASE WHEN 1=1 THEN randomblob(100000000) ELSE 1 END)"

Cleanup

bash
echo 'No cleanup required; read-only request'

Expected Telemetry

Access log entry with elevated response time and sort parameter containing 'randomblob'

Expected Detection

Detection rules match 'randomblob' keyword; anomalous response timing corroborates successful injection

Test 3 Quote/comment metacharacter injection probe
windows

Sends a single-quote and comment-terminator payload in the sort parameter to trigger a SQL syntax error, confirming unsanitised concatenation.

Command

powershell
powershell -Command "Invoke-WebRequest -UseBasicParsing 'http://daptin.lab.local:6336/api/document?sort=name%27--'"

Cleanup

powershell
Write-Output 'No cleanup required; read-only request'

Expected Telemetry

Web log entry with URL-encoded sort value name'-- and likely HTTP 500 response

Expected Detection

Detection rules match the %27 (encoded quote) and -- comment indicators in the sort parameter

Related Detections