HighGHSA-rw2c-8rfq-gwfvCVE-2026-41422GO-2026-5640

Daptin: SQL injection via unvalidated goqu.L() calls in aggregate API

Published 22 Apr 2026 · Updated 25 Jun 2026

Is your project on an affected github.com/daptin/daptin?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several Go apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Affected package

Affected
<0.11.4
Fixed in
0.11.4
Update to the fixed version for your release line, for example:go get github.com/daptin/daptin@v0.11.4

Details

Summary

The /aggregate/:typename endpoint accepted column and group query parameters that were passed verbatim to goqu.L() — a raw SQL literal expression builder — without any validation. This bypassed all parameterization and allowed authenticated users with any valid session to inject arbitrary SQL expressions.

Impact

An authenticated low-privilege user could:

  • Extract data from any table via subquery: (SELECT group_concat(email) FROM user_account) as leak
  • Disclose database internals: sqlite_version(), (SELECT sql FROM sqlite_master)
  • Exfiltrate cross-table data via correlated subqueries

The vulnerability was confirmed locally; user_account.email values were extracted via a crafted column parameter by a non-admin user.

Root Cause

goqu.L(userInput) in server/resource/resource_aggregate.go inserted user-supplied query parameters directly into the SQL string with no validation.

Fix (v0.11.4)

All goqu.L() calls on user-controlled input were eliminated and replaced with:

  • Structural expression parsing supporting all documented API forms
  • Schema-based column validation (column names checked against entity schema via TableInfo().GetColumnByName())
  • Exact-match allowlist for aggregate functions (count, sum, avg, min, max, first, last) and scalar functions (date, strftime, upper, lower, etc.)
  • Safe goqu constructors (goqu.I(), goqu.SUM(), goqu.Func()) for all generated expressions
  • allowedTables scope enforcement: qualified column refs (table.col) validated against root entity + explicitly joined tables only

Two additional DoS bugs were fixed in the same commit: uuid.MustParse panic on malformed UUID input and an index-out-of-range panic in ToOrderedExpressionArray on empty sort expressions.

Credits

Reported by @VashuVats.

Is GHSA-rw2c-8rfq-gwfv in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected github.com/daptin/daptin, and gives you the command that fixes it.

More advisories for github.com/daptin/daptin

  • LowCVE-2026-62160Daptin: ParseAcceptLanguage `_` separator bypass enables >250x CPU amplification via Accept-Language header in LanguageMiddleware in github.com/daptin/daptin · 5 Nov 2026
  • HighCVE-2026-62160Daptin: ParseAcceptLanguage `_` separator bypass enables >250x CPU amplification via Accept-Language header in LanguageMiddleware · 29 Oct 2026
  • LowCVE-2026-44349Daptin fuzzy search injects unvalidated column name into raw SQL in github.com/daptin/daptin · 25 Jun 2026
  • LowGO-2026-5285Daptin has Unauthenticated Path Traversal and Zip Slip in github.com/daptin/daptin · 25 Jun 2026
  • LowGO-2026-4991Daptin's Session Management Vulnerability Leads to Insufficient Session Expiration After Password Change in github.com/daptin/daptin · 20 May 2026
  • MediumGHSA-258c-965c-p3hcDaptin's Session Management Vulnerability Leads to Insufficient Session Expiration After Password Change · 7 May 2026
All 9 advisories for github.com/daptin/daptin

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.