/

CVE-2026-26186

Severity:

HIGH RISK

(8.8)

SQL Injection in Fleet Device Management

CVE-2026-26186

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Blind SQL Injection leading to information disclosure and potential denial of service

Severity:

HIGH RISK

(8.8)

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

A SQL injection vulnerability in Fleet's handling of the order_key query parameter allowed authenticated users to inject arbitrary SQL expressions into an ORDER BY clause.

By abusing unsafe use of goqu.I() during query construction, an attacker who can reach the affected endpoint could perform blind SQL injection to infer database information and potentially degrade performance or cause denial of service.

Affected context

This vulnerability occurs in Fleet deployments where authenticated users can call endpoints that accept an order_key query parameter used for result sorting.

The issue is tied to dynamic construction of SQL ORDER BY clauses using user-supplied values without strict allow‑listing of sortable columns.

It becomes relevant in environments where users can control sort keys or column names and the backend relies on MySQL with Fleet versions prior to 4.80.1.

Exploit preconditions

  • Attack surface: HTTP(S) API endpoints or web UI routes that accept order_key and forward it to the database layer.
  • Required access: Valid authenticated account with permission to access the affected listing or search endpoint.
  • Trigger point: Submission of a specially crafted order_key value that is incorporated into the ORDER BY clause via goqu.I().
  • Why exploitation is possible: The goqu.I() identifier helper is used on untrusted input without strict allow‑listing, allowing attackers to break out of identifier quoting and inject arbitrary SQL expressions into the ORDER BY context.

Why this happens

The root cause is unsafe dynamic SQL construction using user-controlled input as identifiers in the ORDER BY clause.

Instead of mapping a small, predefined set of logical sort options to hardcoded, parameterized column names, the implementation passed the raw order_key value into goqu.I(), which is intended to represent trusted identifiers.

This effectively bypassed the usual protections of parameterized queries, allowing attacker-provided fragments to be treated as SQL syntax rather than data.

This behavior aligns with CWE-89: SQL Injection, where application code fails to neutralize special elements in SQL commands composed from external input.

Potential impact

  • Authenticated attackers may infer contents of database tables using blind SQL injection techniques based on conditional expressions in ORDER BY.
  • Sensitive metadata (such as table/column structure or selected field values) could be gradually disclosed.
  • Crafted expressions can cause expensive sorting operations or complex computations, leading to performance degradation.
  • Repeated abusive requests may contribute to partial denial of service through increased database load or query timeouts.
  • Query errors can leak limited structural information about the schema or query behavior.

General mitigation guidance

Effective mitigation patterns focus on eliminating direct use of untrusted values in SQL identifiers and clauses:

  • Replace free-form order_key handling with an explicit allow‑list that maps user-facing sort options to fixed, hardcoded column names and directions.
  • Keep all user input in parameter positions only; avoid passing untrusted values into identifier constructors or direct SQL fragments.
  • Introduce a thin query-building layer or helper that only supports predefined sort and filter configurations, rejecting any unknown keys.
  • Apply least-privilege principles to the database account used by the application to limit damage if an injection flaw is present.
  • Implement centralized validation for all sorting and pagination parameters to ensure they adhere to a known, safe schema.

How teams detect issues like this

Detection typically involves a combination of code-centric and behavior-centric practices:

  • Static analysis: Flag any use of SQL builder APIs (such as goqu.I() or raw SQL fragments) that operate on unvalidated or non-allow‑listed request parameters, especially for ORDER BY, GROUP BY, or LIMIT/OFFSET clauses.
  • Code review: Look for patterns where request query parameters (e.g., order_key, sort, column) are passed directly into query builders without mapping through an explicit enumeration of allowed values.
  • Security testing: Use dynamic application security testing (DAST) or manual penetration testing to probe sort and column parameters with conditional expressions that could influence result ordering or timing.
  • Monitoring and logging: Record anomalous query patterns and errors, such as unexpected SQL syntax or unusually complex ORDER BY expressions, and set alerts for repeated failures tied to sorting parameters.

Sources

SourceLink
github.comgithub.com/fleetdm/fleet/security/advisories/GHSA-49xw-vfc4-7p43

Frequently asked

questions

Yes. Any remote user who can authenticate and reach the affected endpoint can attempt to exploit the vulnerability by manipulating the order_key parameter over HTTP(S).

The attacker must have a valid authenticated account with access rights to the endpoint that supports ordering via order_key. No elevated database privileges are required beyond what the application's DB user already possesses.

The most robust fix is to stop using arbitrary user input as SQL identifiers and instead map a limited set of allowed sort options to hardcoded column names and directions, keeping all user values in parameterized positions only.

Establish a standard query-construction pattern that strictly separates data from SQL structure, enforce allow‑lists for all sort and filter fields, and integrate secure code review or automated checks that flag dynamic SQL built from request parameters.

Find out what's already
exploitable in your codebase.