{"id":"CVE-2026-41422","aliases":["CVE-2026-41422","GHSA-rw2c-8rfq-gwfv","GO-2026-5640"],"related":[],"kind":"vulnerability","state":"published","title":"Daptin vulnerable to SQL injection via unvalidated goqu.L() calls in aggregate API","summary":"Daptin is a GraphQL/JSON-API headless CMS. Prior to version 0.11.4, 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. This issue has been patched in version 0.11.4.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Daptin is a GraphQL/JSON-API headless CMS. Prior to version 0.11.4, 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. This issue has been patched in version 0.11.4.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nThe `/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.\n\n## Impact\n\nAn authenticated low-privilege user could:\n- Extract data from any table via subquery: `(SELECT group_concat(email) FROM user_account) as leak`\n- Disclose database internals: `sqlite_version()`, `(SELECT sql FROM sqlite_master)`\n- Exfiltrate cross-table data via correlated subqueries\n\nThe vulnerability was confirmed locally; `user_account.email` values were extracted via a crafted `column` parameter by a non-admin user.\n\n## Root Cause\n\n`goqu.L(userInput)` in `server/resource/resource_aggregate.go` inserted user-supplied query parameters directly into the SQL string with no validation.\n\n## Fix (v0.11.4)\n\nAll `goqu.L()` calls on user-controlled input were eliminated and replaced with:\n- Structural expression parsing supporting all documented API forms\n- Schema-based column validation (column names checked against entity schema via `TableInfo().GetColumnByName()`)\n- Exact-match allowlist for aggregate functions (`count`, `sum`, `avg`, `min`, `max`, `first`, `last`) and scalar functions (`date`, `strftime`, `upper`, `lower`, etc.)\n- Safe goqu constructors (`goqu.I()`, `goqu.SUM()`, `goqu.Func()`) for all generated expressions\n- `allowedTables` scope enforcement: qualified column refs (`table.col`) validated against root entity + explicitly joined tables only\n\nTwo 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.\n\n## Credits\n\nReported by @VashuVats.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Daptin: SQL injection via unvalidated goqu.L() calls in aggregate API in github.com/daptin/daptin","format":"markdown","source":"go"}],"published":"2026-04-22T17:38:02.000Z","modified":"2026-06-25T23:11:35.232Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:L","score":8.3,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:L","score":8.3,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:L","score":8.3,"rating":"HIGH"}],"cwes":["CWE-89"],"affected":[{"ranges":[{"version":"< 0.11.4","status":"affected"}],"vendor":"daptin","product":"daptin","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.11.4"}],"ecosystem":"Go","package":"github.com/daptin/daptin","purl":"pkg:golang/github.com/daptin/daptin","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.11.4"}],"ecosystem":"Go","package":"github.com/daptin/daptin","purl":"pkg:golang/github.com/daptin/daptin","source":"go"}],"references":[{"url":"https://github.com/daptin/daptin/security/advisories/GHSA-rw2c-8rfq-gwfv","tags":["advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/daptin/daptin/releases/tag/v0.11.4","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41422","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/daptin/daptin","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-05-07T14:55:58.874Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-41422","url":"https://www.cve.org/CVERecord?id=CVE-2026-41422","licence":"CVE Terms of Use","modified":"2026-05-07T14:57:04.226Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-rw2c-8rfq-gwfv","url":"https://github.com/advisories/GHSA-rw2c-8rfq-gwfv","licence":"CC-BY-4.0","modified":"2026-06-25T23:11:35.232Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5640","url":"https://pkg.go.dev/vuln/GO-2026-5640","licence":"CC-BY-4.0","modified":"2026-06-25T23:01:37.473Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-41422","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41422","licence":"Public domain","modified":"2026-06-17T10:46:42.163Z"}],"updatedAt":"2026-11-25T22:59:20.885Z","epss":{"score":0.00345,"percentile":0.30034,"date":"2026-12-01T12:00:22.000Z"}}