{"vuln_id":"CVE-2026-62361","aliases":["GHSA-xgjr-7j9q-2h4r"],"description":"listmonk: SQL Injection in `/api/subscribers/export` bypasses table access control, leaking admin password hashes and SMTP credentials","published_at":"2026-11-06T18:15:17Z","modified_at":"2026-11-23T20:41:04.525986Z","first_seen_at":"2026-11-23T21:06:31.538371Z","severity":"medium","severity_source":"native","cvss_score":5.5,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:L/A:N","cwe":["CWE-89"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":0.00297,"epss_percentile":0.2264,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-62361"},"matched_alias":null,"items":[{"id":16662,"source":{"id":"osv","name":"OSV.dev"},"title":"GO-2026-6931: listmonk: SQL Injection in `/api/subscribers/export` bypasses table access control, leaking admin password hashes and SMTP credentials in github.com/knadh/listmonk","summary":"listmonk: SQL Injection in `/api/subscribers/export` bypasses table access control, leaking admin password hashes and SMTP credentials in github.com/knadh/listmonk\n\nAffected: Go:github.com/knadh/listmonk\n\nFixed in: 1.1.1-0.20260619102436-c0a6525009a6\n\nReferences:\nhttps://github.com/knadh/listmonk/security/advisories/GHSA-xgjr-7j9q-2h4r\nhttps://nvd.nist.gov/vuln/detail/CVE-2026-62361\nhttps://github.com/knadh/listmonk/commit/c0a6525009a65265230185f16e8674dcc83aa024\nhttps://github.com/knadh/listmonk/releases/tag/v6.2.0","url":"https://osv.dev/vulnerability/GO-2026-6931","published_at":"2026-11-23T20:02:19Z","updated_at":"2026-11-23T20:30:11.991318Z","fetched_at":"2026-11-23T21:06:31.109654Z","severity":"medium","cvss_score":5.5,"epss":0.00297,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"github.com/knadh/listmonk","vuln_id":"CVE-2026-62361","vuln_ids":["CVE-2026-62361","GHSA-XGJR-7J9Q-2H4R","GO-2026-6931"],"tags":["osv","go","fix-available"],"cluster_id":14759,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/16662","html":"https://vulnwatch.ve1ve2.com/item/16662"}},{"id":16582,"source":{"id":"osv","name":"OSV.dev"},"title":"GHSA-xgjr-7j9q-2h4r: listmonk: SQL Injection in `/api/subscribers/export` bypasses table access control, leaking admin password hashes and SMTP credentials","summary":"listmonk: SQL Injection in `/api/subscribers/export` bypasses table access control, leaking admin password hashes and SMTP credentials\n\n### Summary\n\nA SQL injection vulnerability in `GET /api/subscribers/export` allows an authenticated user with the `subscribers:sql_query` permission to bypass the table access control that exists on the regular query endpoint (`GET /api/subscribers`) and read arbitrary tables from the database — including `users` (bcrypt password hashes) and `settings` (SMTP credentials, API keys). Both error-based and time-based exfiltration techniques are confirmed to work. This creates a privilege escalation path: `subscribers:sql_query` → hash exfiltration → offline bcrypt crack (cost factor 6) → Super Admin account takeover.\n\n---\n\n### Details\n\nThe subscriber query feature accepts a user-controlled `query` parameter that is injected directly into a SQL template via `strings.ReplaceAll`. The regular query endpoint `GET /api/subscribers` correctly calls `validateQueryTables` to block access to sensitive tables before execution. The export endpoint `GET /api/subscribers/export` **omits this call entirely**, creating an asymmetric bypass of an intentional security control.\n\n**`internal/core/subscribers.go` — protected path (regular query):**\n\n```go\n// QuerySubscribers — table validation present\nstmt := strings.ReplaceAll(c.q.QuerySubscribersTpl, \"%query%\", cond)\nif err := validateQueryTables(c.db, stmt, allowedSubQueryTables); err != nil {\n    return nil, 0, echo.NewHTTPError(http.StatusBadRequest,\n        fmt.Sprintf(\"Error preparing subscriber query: %v\", err))\n}\n```\n\n**`internal/core/subscribers.go` — vulnerable path (export):**\n\n```go\n// ExportSubscribers — NO table validation\nstmt := strings.ReplaceAll(c.q.QuerySubscribersForExport, \"%query%\", cond)\ntx, err := c.db.Preparex(stmt)  // executes directly without restriction\n```\n\n**`queries/subscribers.sql` — the `%query%` placeholder is injected into a WHERE clause:**\n\n```sql\nSELECT subscribers.id, subscribers.email, ...\nFROM subscribers\nLEFT JOIN subscriber_lists ON ...\nWHERE (subscribers.status != 'blocklisted') AND %query%\nORDER BY subscribers.id ASC LIMIT ...\n```\n\nBecause the export path does not run inside a `ReadOnly` transaction (unlike the dry-run used in `QuerySubscribers`), PostgreSQL CTEs with data-modifying statements (`WITH ... UPDATE ... RETURNING`) are also executable, enabling write operations beyond read-only exfiltration.\n\n---\n\n### PoC\n\n**Prerequisites:** Authenticated session with `subscribers:sql_query` and `subscribers:get_all` permissions.\n\n**Step 1 — Confirm the bypass (blocked on query, open on export):**\n\n```bash\n# Blocked on regular endpoint:\ncurl -s \"http://TARGET:9000/api/subscribers?query=(SELECT+1+FROM+users+LIMIT+1)+IS+NOT+NULL\" \\\n  -H \"Cookie: session=SESSION_TOKEN\"\n# → HTTP 400: {\"message\":\"Error preparing subscriber query: table 'users' is not allowed\"}\n\n# Bypassed on export endpoint:\ncurl -s \"http://TARGET:9000/api/subscribers/export?query=(SELECT+1+FROM+users+LIMIT+1)+IS+NOT+NULL\" \\\n  -H \"Cookie: session=SESSION_TOKEN\"\n# → HTTP 200: returns subscriber rows with no error\n```\n\n\n\nAffected: Go:github.com/knadh/listmonk\n\nFixed in: 1.1.1-0.20260619102436-c0a6525009a6\n\nReferences:\nhttps://github.com/knadh/listmonk/security/advisories/GHSA-xgjr-7j9q-2h4r\nhttps://nvd.nist.gov/vuln/detail/CVE-2026-62361\nhttps://github.com/knadh/listmonk/commit/c0a6525009a65265230185f16e8674dcc83aa024\nhttps://github.com/knadh/listmonk\nhttps://github.com/knadh/listmonk/releases/tag/v6.2.0","url":"https://osv.dev/vulnerability/GHSA-xgjr-7j9q-2h4r","published_at":"2026-11-06T18:15:17Z","updated_at":"2026-11-23T20:41:04.525986Z","fetched_at":"2026-11-23T21:06:31.109583Z","severity":"medium","cvss_score":5.5,"epss":0.00297,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"github.com/knadh/listmonk","vuln_id":"CVE-2026-62361","vuln_ids":["CVE-2026-62361","GHSA-XGJR-7J9Q-2H4R","GO-2026-6931"],"tags":["osv","go","fix-available"],"cluster_id":14758,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/16582","html":"https://vulnwatch.ve1ve2.com/item/16582"}}]}