Nov 20, 2026·9 min read·1 visit
Daptin versions below 0.12.30 allow unauthenticated remote attackers to inject arbitrary SQL syntax via the sort query parameter on any GET /api/{entity} endpoint due to missing schema validation and improper identifier quoting in goqu.I().
An unauthenticated SQL injection vulnerability exists in Daptin prior to version 0.12.30. The generic entity listing handler fails to validate user-supplied sort parameters against the table schema before passing them to the goqu SQL query builder, enabling remote attackers to break out of SQL identifier quoting and execute arbitrary SQL subqueries.
Daptin is an open-source headless content management system (CMS) and backend framework written in Go that exposes registered database schemas through RESTful JSON-API and GraphQL interfaces. To handle data retrieval across dynamic models, Daptin provides a generic entity listing endpoint under the route pattern GET /api/{entity}. This endpoint supports pagination, filtering, and result ordering through standard URL query parameters.
In Daptin versions prior to 0.12.30, the pagination and sorting logic implemented inside PaginatedFindAllWithoutFilters in server/resource/resource_findallpaginated.go contains an unauthenticated SQL injection vulnerability (tracked as CVE-2026-77367 and GHSA-hq2p-f2vj-v3cm). The vulnerability is classified under CWE-89 (SQL Injection) and CWE-20 (Improper Input Validation).
When processing an incoming GET /api/{entity} request, the server extracts the sort query parameter directly from the client request and passes the parsed string slices to the underlying goqu SQL builder to construct SELECT and ORDER BY clauses. Because the application neither validates the requested sort columns against the entity's registered database schema nor sanitizes embedded identifier quotes, an attacker can terminate the SQL identifier context prematurely.
This flaw exposes every publicly accessible entity listing endpoint to unauthenticated SQL injection. A remote attacker with network access to the Daptin API can craft malicious sort payloads to extract sensitive data from arbitrary tables (such as user_account password hashes, tokens, or configuration secrets) via blind boolean, time-based, or error-based extraction techniques, or trigger database query failures resulting in a denial of service.
The root cause of CVE-2026-77367 lies in the combination of missing schema validation in Daptin's request handler and the identifier quoting behavior of the goqu SQL builder library. When a client sends a request such as GET /api/world?sort=created_at, the PaginatedFindAllWithoutFilters method in server/resource/resource_findallpaginated.go parses the sort parameter into a slice of column strings (sortOrder).
Before version 0.12.30, PaginatedFindAllWithoutFilters did not verify whether the string elements inside sortOrder corresponded to legitimate columns defined in dbResource.tableInfo. Instead, the code iterated over the raw user-supplied strings, checked for a leading - or + direction prefix, prepended the table prefix, and passed the resulting string directly into goqu.I().
In the goqu library, goqu.I(ident) creates an identifier expression that wraps the column or table name in dialect-specific delimiter characters during SQL generation—backticks (`) for MySQL/MariaDB, or double quotes (") for PostgreSQL and SQLite. If the input string contains a dot (.), goqu.I() splits the string into table and column components and wraps each segment in dialect quotes.
Crucially, passing untrusted input to goqu.I() without prior column whitelist validation allows an attacker to inject the dialect's closing identifier quote character directly inside the sort value. When the SQL string is rendered, the embedded quote closes the identifier early, and all subsequent characters in the attacker's payload are interpreted by the database engine as raw SQL syntax inside the SELECT and ORDER BY clauses.
In vulnerable versions of Daptin, PaginatedFindAllWithoutFilters in server/resource/resource_findallpaginated.go assigned default sorting if none was provided, and then immediately proceeded to filter and query construction without inspecting the elements of sortOrder. Later in the function (around line 933), the raw sort values were appended to the orders slice:
// Vulnerable code path in server/resource/resource_findallpaginated.go (prior to 0.12.30)
if len(req.QueryParams["sort"]) > 0 {
sortOrder = req.QueryParams["sort"]
} else {
sortOrder = []string{"-created_at"}
}
// ... [No validation performed on sortOrder] ...
for _, so := range sortOrder {
if len(so) == 0 {
continue
}
if so[0] == '-' {
orders = append(orders, goqu.I(prefix+so[1:]).Desc())
} else if so[0] == '+' {
orders = append(orders, goqu.I(prefix+so[1:]).Asc())
} else {
ord := prefix + so
if strings.ToLower(so) == "rand()" || strings.ToLower(so) == "random()" {
ord = so
}
orders = append(orders, goqu.I(ord).Asc())
}
}Commit b0bcc1318832b9055781f032853ef9d2264652cf resolves this vulnerability by introducing a dedicated validation method, validateSortOrder, on the DbResource struct and invoking it immediately after sortOrder is populated. The patch also removes the ad-hoc check for rand() and random().
// Patched code in server/resource/resource_findallpaginated.go (version 0.12.30)
func (dbResource *DbResource) validateSortOrder(sortOrder []string) ([]string, error) {
validSortOrder := make([]string, 0, len(sortOrder))
for _, sort := range sortOrder {
if len(sort) == 0 {
continue
}
direction := ""
columnName := sort
// 1. Strip optional direction prefix (+ or -)
if columnName[0] == '-' || columnName[0] == '+' {
direction = columnName[:1]
columnName = columnName[1:]
}
// 2. Reject direction-only inputs such as "+" or "-"
if len(columnName) == 0 {
log.Warnf("Table [%v] invalid sort column [%v]", dbResource.model.GetName(), sort)
return nil, fmt.Errorf("table [%v] invalid sort column [%v]", dbResource.model.GetName(), sort)
}
// 3. Enforce strict schema lookup against the entity's TableInfo
columnInfo, ok := dbResource.tableInfo.GetColumnByName(columnName)
if !ok {
log.Warnf("Table [%v] invalid sort column [%v]", dbResource.model.GetName(), columnName)
return nil, fmt.Errorf("table [%v] invalid sort column [%v]", dbResource.model.GetName(), columnName)
}
// 4. Reconstruct sort string using the trusted schema ColumnName rather than user input
validSortOrder = append(validSortOrder, direction+columnInfo.ColumnName)
}
return validSortOrder, nil
}> [!NOTE]
> Fix Completeness Assessment: The remediation in commit b0bcc1318832b9055781f032853ef9d2264652cf is structurally complete for the sort parameter path. Instead of attempting to blacklist or escape quote characters, validateSortOrder implements strict allowlist validation against dbResource.tableInfo.GetColumnByName(columnName). Furthermore, it discards the user-supplied string entirely when constructing validSortOrder, substituting the canonical columnInfo.ColumnName from the internal schema definition. The unit tests added in server/resource/resource_findallpaginated_sort_test.go verify rejection of backtick breakouts, double-quote breakouts, SQL comments, qualified table.column references, and leading/trailing whitespace.
Exploiting CVE-2026-77367 requires no authentication provided at least one entity listing endpoint is reachable by unauthenticated clients, which is a common configuration for public resources or metadata endpoints in Daptin deployments. The attacker targets the GET /api/{entity} endpoint and supplies a crafted sort query parameter tailored to the backend SQL dialect (MySQL, PostgreSQL, or SQLite).
When targeting a MySQL or MariaDB backend (which uses backticks for identifier quoting) or SQLite (which supports both double quotes and backticks), an attacker can inject a backtick to close the column identifier, followed by a comma and an arbitrary scalar subquery inside the ORDER BY or SELECT list:
GET /api/world?sort=id`,(select%20password%20from%20user_account%20limit%201) HTTP/1.1
Host: target.example.com
Accept: application/vnd.api+jsonWhen targeting PostgreSQL or SQLite using standard ANSI double-quote identifiers, the attacker substitutes a double quote (") and uses an inline SQL comment (--) or boolean expression to alter query execution:
GET /api/world?sort=email"%20-- HTTP/1.1
Host: target.example.com
Accept: application/vnd.api+jsonDepending on whether the injected expression is reflected in the SELECT projection or evaluated solely in the ORDER BY clause, the attacker can extract data through two primary mechanisms:
CASE WHEN (subquery) THEN colA ELSE colB END expression into the ORDER BY clause, the attacker observes changes in the returned JSON array element ordering to infer character values from restricted tables such as user_account.CVE-2026-77367 carries a CVSS v3.1 base score of 9.4 (Critical) with the vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:H. The vulnerability is remotely exploitable over the network (AV:N) with low attack complexity (AC:L), requiring neither authentication (PR:N) nor user interaction (UI:N).
The primary security impact is to Confidentiality (C:H). Because Daptin stores user accounts, Bcrypt password hashes, OAuth tokens, cloud storage credentials, and application data within the same underlying relational database accessible to the database driver connection, an unauthenticated attacker can read arbitrary records across any database table regardless of Daptin's application-layer permission model.
If an attacker exfiltrates administrator password hashes or active session tokens from the user_account or token tables, they can escalate their access to full administrative control over the Daptin instance. In Daptin, administrative access allows configuring system actions, managing sub-sites, and potentially executing arbitrary commands depending on enabled integrations.
The Availability (A:H) impact stems from the ability to repeatedly execute malformed queries or resource-exhausting SQL expressions, causing connection pool exhaustion or database denial of service. Integrity (I:L) is rated Low because the injection occurs within a read query context (SELECT / ORDER BY), which restricts direct UPDATE or DELETE statements unless the database driver configuration explicitly enables multi-statement execution.
Administrators and developers running Daptin must upgrade to version 0.12.30 or later to remediate CVE-2026-77367. Version 0.12.30 includes commit b0bcc1318832b9055781f032853ef9d2264652cf, which enforces strict schema validation on all sort parameter values before query generation.
> [!NOTE]
> Upgrading to 0.12.30 removes undocumented support for sorting by rand() or random() via the sort query parameter, as well as sorting by cross-table qualified column names (e.g., table.column). Any client applications relying on sort=rand() or sort=random() must be updated to use valid schema column names.
If an immediate upgrade to 0.12.30 is not possible, organizations should implement the following compensating controls at the reverse proxy or Web Application Firewall (WAF) layer:
sort query parameter on all /api/* routes and block any request where the sort parameter does not strictly match a safe column name pattern such as ^[+-]?[a-zA-Z0-9_]+(,[+-]?[a-zA-Z0-9_]+)*$.`), double quotes ("), single quotes ('), parentheses ((, )), spaces, or SQL comment sequences (--, /*) inside the sort query parameter./api/{entity} endpoints is not required for business operations, enforce authentication at the API gateway or reverse proxy layer.CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
Daptin daptin | < 0.12.30 | 0.12.30 |
| Attribute | Detail |
|---|---|
| CVE / GHSA ID | CVE-2026-77367 / GHSA-hq2p-f2vj-v3cm |
| Weakness Class | CWE-89 (SQL Injection) / CWE-20 (Improper Input Validation) |
| CVSS v3.1 Score | 9.4 Critical (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:H) |
| Attack Vector | Unauthenticated HTTP GET request to /api/{entity}?sort=... |
| Affected Component | PaginatedFindAllWithoutFilters in server/resource/resource_findallpaginated.go |
| Affected / Fixed Versions | Affected: < 0.12.30 | Patched: >= 0.12.30 |
| CISA KEV Status | Not Listed |
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when sent to a downstream database engine.
CVE-2026-77369 is a broken access control and Insecure Direct Object Reference (IDOR) vulnerability in Daptin, an open-source headless CMS. Affected versions from 0.11.4 through 0.12.29 expose a generic YJS real-time collaboration WebSocket endpoint (`GET /yjs/:documentName`) that verifies user authentication but fails to enforce row-level authorization when supplied with a canonical database room identifier (`{typename}.{referenceId}.{columnName}`). This allows any low-privileged authenticated user to read or modify restricted database columns of type `file.*` across all entities.
CVE-2026-77376 is an open redirect vulnerability (CWE-601) in the core framework of Bolt CMS prior to version 6.1.4. The vulnerability resides within the LoginFormAuthenticator class, which processes post-authentication redirection for both successful and failed login attempts. Due to a lack of destination validation, the application accepts untrusted target paths from user sessions and directly reflects unvalidated HTTP Referer headers into HTTP Location response headers. Attackers can exploit this behavior to redirect users to arbitrary external domains after interacting with the Bolt login endpoint, facilitating credential harvesting and phishing attacks.
Bolt CMS (bolt/core) versions prior to 6.1.4 contain a Server-Side Request Forgery (SSRF) vulnerability in the authenticated URL-upload (/async/upload-url) and media embed (/async/embed) endpoints. Backend users with file upload or media embedding privileges can supply arbitrary URLs that the application fetches without destination IP validation. This allows authenticated attackers to force the server to initiate HTTP requests to loopback interfaces, RFC 1918 private networks, and cloud instance metadata services.
Bolt CMS prior to version 6.1.4 contains an information disclosure vulnerability in its public Relation API endpoints. The Doctrine ORM query extension (ContentExtension) fails to filter out unpublished, draft, or viewless content when querying the Relation entity. Because the Relation resource is configured with public read access (PUBLIC_ACCESS) via API Platform REST and GraphQL endpoints, unauthenticated remote attackers can enumerate relationship graphs, entity identifiers, and metadata associated with private content.
Bolt CMS prior to version 6.1.5 is vulnerable to Server-Side Request Forgery (SSRF) in its asynchronous URL upload and media embed endpoints. While the application validates the initial user-supplied URL against internal network ranges using UrlSafetyChecker, the underlying HTTP transport libraries automatically follow HTTP 3xx redirects and HTML meta refresh directives without re-validating the target destinations. An authenticated user with editor privileges can exploit this discrepancy via an open redirector or DNS rebinding to access internal network resources and cloud metadata services.
CVE-2026-77378 (GHSA-r7h9-qx4h-77j5) is an authenticated SQL injection vulnerability affecting the bolt/core package of Bolt CMS in versions prior to 6.1.4. The flaw resides in the ListFormatHelper utility class, where content-type slugs are dynamically interpolated into raw SQL query strings via sprintf rather than bound as parameterized inputs. When the general/caching/list_format configuration directive is enabled, an authenticated user with upload privileges can exploit the /async/select-options endpoint to inject arbitrary SQL commands and query the underlying database.