/

CVE-2026-41422

Severity:

HIGH RISK

(8.3)

SQL Injection in Daptin :typename API Endpoint

CVE-2026-41422

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Authenticated SQL Injection Leading to Data Exposure and Modification

Severity:

HIGH RISK

(8.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

An SQL injection vulnerability in Daptin's /aggregate/:typename endpoint allowed user-supplied column and group query parameters to be passed directly into a raw SQL literal builder without validation or parameterization.

Any authenticated user with a valid session could inject arbitrary SQL expressions into aggregate queries, potentially leading to data exposure, data modification, or disruption of the underlying database.

Affected context

The vulnerability appears in Daptin deployments that expose the /aggregate/:typename endpoint as part of the GraphQL/JSON-API interface.

It is relevant when:

  • Clients can control the column and group query parameters for aggregate requests
  • These parameters are passed into goqu.L() or similar raw SQL literal builders
  • Database queries are executed with significant read/write permissions

The risk increases in multi-tenant or externally exposed CMS setups where numerous authenticated user accounts can reach this endpoint.

Exploit preconditions

  • Attack surface: HTTP(S) API, specifically the /aggregate/:typename endpoint in the Daptin CMS.
  • Required access: Any authenticated user with a valid session; no special roles or elevated privileges are required beyond being logged in.
  • Input control: Ability to set or manipulate the column and group query parameters in aggregate requests.
  • Trigger point: When the server builds and executes SQL queries using goqu.L() with these parameters as raw SQL literals.
  • Why exploitation is possible: The application interpolates unvalidated, user-controlled strings directly into SQL fragments, bypassing parameterization and syntactic constraints, enabling attackers to craft arbitrary SQL expressions.

Why this happens

This issue stems from constructing SQL statements using raw string concatenation patterns instead of parameterized queries.

By passing user-controlled column and group parameters directly into goqu.L(), the code effectively treated untrusted input as trusted SQL syntax.

This maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where dynamic SQL construction fails to separate code from data, allowing attackers to alter query structure, logic, and scope.

Potential impact

  • Access to data that the authenticated account should not normally see, including other users' records.
  • Unauthorized modification or deletion of database records through injected SQL.
  • Bypassing of application-level authorization checks enforced outside the database layer.
  • Extraction of sensitive metadata about the schema, tables, and columns.
  • Potential denial of service at the database level by issuing expensive or disruptive queries.

General mitigation guidance

Mitigation should focus on eliminating the pattern of treating user input as raw SQL and enforcing strict separation of data and code.

Recommended defensive approaches include:

  • Using parameterized query builders or ORM methods that do not accept arbitrary SQL fragments from user input.
  • Whitelisting allowed column and group-by fields, resolving them to known-safe identifiers instead of trusting client-supplied names.
  • Applying rigorous server-side validation and normalization for any dynamic query components, rejecting unsupported or malformed values.
  • Implementing least-privilege database accounts so that even if a query is abused, its impact on the database is constrained.
  • Designing APIs so that clients request higher-level operations (e.g., "group by field X") rather than constructing raw query clauses.

How teams detect issues like this

Detection can be approached at both code and runtime levels:

  • Static analysis: Configure rules or linters to flag uses of raw SQL builders (e.g., goqu.L() or similar APIs) when they are passed user-controlled parameters.
  • Code review: Look for endpoints where query parameters or request fields are mapped directly into SQL fragments, especially for ORDER BY, GROUP BY, or column lists.
  • Security testing: Use automated and manual testing to send crafted input in column and group parameters to see if errors, unexpected results, or database responses expose injection behavior.
  • Runtime monitoring: Enable SQL logging or database activity monitoring to detect anomalous or syntactically suspicious queries originating from API endpoints.
  • Policy enforcement: Integrate secure coding guidelines into CI/CD, requiring developers to use safe query builders and documented whitelisting patterns for dynamic query parts.

Sources

SourceLink
github.comgithub.com/daptin/daptin/releases/tag/v0.11.4
github.comgithub.com/daptin/daptin/security/advisories/GHSA-rw2c-8rfq-gwfv

Frequently asked

questions

It is remotely exploitable through the HTTP API as long as the Daptin instance is network-accessible and an attacker can obtain any valid authenticated session.

The attacker must be an authenticated user, but does not necessarily need elevated roles; any account able to reach /aggregate/:typename and control the column and group parameters can attempt exploitation.

The most robust fix is to remove all raw SQL construction from user-controlled values, use parameterized query interfaces exclusively, and restrict dynamic query parts to a predefined, server-side whitelist of allowed columns and groupings.

They can standardize on safe query-building patterns, enforce input validation and whitelisting for dynamic query fields, adopt static analysis rules targeting raw SQL APIs, and include SQL injection tests in their regular security testing and code review processes.

Find out what's already
exploitable in your codebase.