GHSA-rw2c-8rfq-gwfv
HIGHGHSA-rw2c-8rfq-gwfv is a high-severity (CVSS 8.3) vulnerability in github.com/daptin/daptin. O3 Security confirms whether GHSA-rw2c-8rfq-gwfv is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.
Daptin: SQL injection via unvalidated goqu.L() calls in aggregate API
Blast Radius
github.com/daptin/daptinReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
Description
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 allowedTablesscope 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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/daptin/daptin | all versions | 0.11.4 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/daptin/daptin. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update github.com/daptin/daptin to 0.11.4 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-rw2c-8rfq-gwfv is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether GHSA-rw2c-8rfq-gwfv is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-rw2c-8rfq-gwfv. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-rw2c-8rfq-gwfv in your dependencies?
O3 detects GHSA-rw2c-8rfq-gwfv across Go dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.