/

CVE-2026-77367

Severity:

CRITICAL RISK

(9.4)

SQL Injection (CWE-89) in Daptin Generic List Endpoint

CVE-2026-77367

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-20, CWE-89

Impact:

Unauthorized data exposure and query disruption

Severity:

CRITICAL RISK

(9.4)

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

Daptin's generic list endpoint uses attacker-controlled sort values when building SQL identifiers without checking them against the table schema. An unauthenticated attacker may exploit this behavior to access unauthorized table data or repeatedly cause query failures when the endpoint is reachable.

Affected context

The issue occurs in Daptin's generic GET /api/{entity} list endpoint, where pagination and sorting logic constructs SELECT and ORDER BY identifiers from requested sort values. Deployments may be at risk when this endpoint is reachable and those values are incorporated into SQL without safe identifier handling or schema validation.

Exploit preconditions

  • Attack surface: The generic GET /api/{entity} list endpoint
  • Required access: The description indicates that authentication is not required
  • Trigger point: A list request that supplies attacker-controlled sort values
  • Why exploitation is possible: Sort values are used to construct SQL identifiers without validating them against the table schema, allowing identifier quoting to be disrupted

Why this happens

The underlying issue is insufficient validation and unsafe construction of SQL identifiers from untrusted input. An embedded identifier quote can change how the database parses the constructed query. This maps primarily to CWE-89: SQL Injection and is also related to CWE-20: Improper Input Validation. SQL parameters generally protect values, but identifiers such as column names require separate allowlisting or safe identifier handling.

Potential impact

  • An attacker may extract unauthorized table data through blind or error-based behavior
  • Repeated malformed queries could cause query failures or disrupt endpoint availability
  • Exposed data could contribute to further compromise, depending on its sensitivity and the deployment's controls

General mitigation guidance

Defensive patterns focus on ensuring untrusted input cannot control SQL structure:

  • Accept sort fields only from an explicit allowlist derived from permitted schema fields
  • Use database-library support for safely quoting identifiers where available; value parameterization alone may not protect identifiers
  • Validate sort direction and other query options against narrow, documented choices
  • Keep database credentials and permissions limited to the data and operations the application needs
  • Prefer secure-by-default query-building abstractions that separate SQL structure from user-supplied values

How teams detect issues like this

  • Use static analysis to identify SQL statements whose identifiers or clauses are assembled from request parameters
  • Review list, sorting, and pagination code for missing schema allowlists and unsafe identifier construction
  • Enforce code-review or CI policies requiring safe query-building patterns for database access
  • Monitor for unusual sorting parameters, database syntax errors, and repeated failed list queries

Sources

SourceLink
github.comgithub.com/daptin/daptin/commit/b0bcc1318832b9055781f032853ef9d2264652cf
github.comgithub.com/daptin/daptin/releases/tag/v0.12.30
github.comgithub.com/daptin/daptin/security/advisories/GHSA-hq2p-f2vj-v3cm

Frequently asked

questions

The described attack surface is an HTTP GET endpoint. If it is reachable, an unauthenticated attacker may be able to submit crafted sort values.

The vulnerability description identifies the issue as unauthenticated, so an account is not indicated as a prerequisite.

Restrict sortable fields to an explicit allowlist and use safe identifier-handling APIs when building SQL. Parameterize data values separately.

Use secure query-building abstractions, validate request options against narrow allowed choices, and review database code for untrusted input affecting SQL structure.

Find out what's already
exploitable in your codebase.