/

CVE-2026-94143

Severity:

HIGH RISK

(7.3)

SQL Injection (CWE-89) in Drogon ORM Mapper::orderBy

CVE-2026-94143

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-74, CWE-89

Impact:

Database Query Manipulation

Severity:

HIGH RISK

(7.3)

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 high-severity SQL injection vulnerability in Drogon's ORM Mapper component allows remotely supplied sorting input to influence SQL query construction through Mapper::orderBy.

Under conditions where an attacker can reach an application endpoint that passes insufficiently trusted input to this function, they may alter query behavior or access, modify, or interfere with database operations.

Affected context

The vulnerability occurs in applications using Drogon's ORM Mapper and invoking Mapper::orderBy with values derived from remote requests. Risk depends on whether sorting arguments can reach query construction without strict allowlisting, normalization, or separation from SQL syntax. Applications that expose database-backed endpoints and directly forward user-controlled ordering parameters may be particularly affected.

Exploit preconditions

  • Attack surface: A remotely accessible application endpoint that uses Drogon's ORM Mapper.
  • Required access: The ability to send requests containing or influencing a sort argument.
  • Trigger point: Processing the supplied value through Mapper::orderBy while constructing a database query.
  • Why exploitation is possible: If the value is incorporated into SQL structure without strict validation or safe identifier handling, attacker-controlled content may alter the intended query.

Why this happens

The underlying bug is improper neutralization of externally influenced input during SQL statement construction. Ordering expressions often represent SQL identifiers or keywords rather than ordinary bindable values, so passing them through a generic query-building path without strict allowlisting can allow syntax to be interpreted as part of the statement.

This maps primarily to CWE-89: Improper Neutralization of Special Elements used in an SQL Command (SQL Injection). It also relates to CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component, because input is transferred into a downstream SQL interpreter without adequate context-aware controls.

Potential impact

  • An attacker may alter the logic of database queries.
  • Sensitive records could be disclosed.
  • Data could be modified or deleted, depending on database permissions and query context.
  • Database availability or application functionality could be disrupted.
  • The application service account could enable broader compromise if it has excessive database privileges.

General mitigation guidance

Mitigation generally focuses on ensuring that externally influenced sorting input cannot become executable SQL syntax.

Common defensive patterns include:

  • Accepting only predefined sort fields and directions through an explicit allowlist.
  • Mapping public sort names to trusted, server-defined database identifiers.
  • Using parameterization for values wherever supported, while recognizing that identifiers and ordering clauses typically require allowlisting rather than ordinary bind parameters.
  • Keeping query construction APIs separate from raw SQL fragments and avoiding concatenation of untrusted input.
  • Applying strict input normalization and rejecting unexpected characters, clauses, or operators.
  • Running the application with a minimally privileged database account and limiting access to sensitive tables and operations.
  • Using safe-by-default ORM interfaces that do not accept arbitrary SQL expressions from request parameters.

How teams detect issues like this

Detection approaches may include:

  • Static analysis rules that identify request-derived data flowing into orderBy, raw query builders, or SQL string concatenation.
  • Code review checks for dynamic ordering fields, direction values, and other query fragments assembled from external input.
  • Runtime monitoring for anomalous sorting parameters, unexpected SQL operators, database errors, or unusual query patterns.
  • Database audit logging and alerts for unexpected read, write, schema, or administrative activity.
  • Policy enforcement requiring allowlisted query fields and prohibiting raw SQL fragments in externally reachable request paths.
  • Automated security review tools can help identify tainted data flows, but findings should be validated against actual query construction and deployment controls.

Sources

SourceLink
gist.github.comgist.github.com/2H-K/33f46c954fd3ed16b32eeddd598f90cf
github.comgithub.com/drogonframework/drogon/
github.comgithub.com/drogonframework/drogon/issues/2575
vuldb.comvuldb.com/cve/CVE-2026-94143
vuldb.comvuldb.com/submit/893923
vuldb.comvuldb.com/vuln/408058
vuldb.comvuldb.com/vuln/408058/cti

Frequently asked

questions

It may be remotely exploitable when a reachable application endpoint passes attacker-influenced sorting input to Mapper::orderBy without adequate validation. Exploitability depends on the application's request routing, query construction, and database permissions.

Not necessarily. Authentication requirements are determined by the endpoint exposing the vulnerable behavior. A publicly accessible endpoint may require no account, while protected functionality may require a valid session or API credential.

Replace arbitrary sort expressions with a server-side allowlist that maps permitted public values to trusted database fields and directions. Avoid inserting request data directly into SQL structure.

Use parameterized queries where applicable, apply context-aware validation for identifiers and clauses, conduct taint-flow reviews of query builders, and enforce least-privilege database accounts.

Find out what's already
exploitable in your codebase.