{"vuln_id":"GHSA-qvx3-q8vx-9q3c","aliases":[],"description":null,"published_at":null,"modified_at":null,"first_seen_at":"2026-11-21T19:15:19.293134Z","severity":"unknown","severity_source":null,"cvss_score":null,"cvss_vector":null,"cwe":[],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":null,"epss_percentile":null,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://github.com/advisories/GHSA-qvx3-q8vx-9q3c"},"matched_alias":null,"items":[{"id":10957,"source":{"id":"osv","name":"OSV.dev"},"title":"GHSA-v9v2-98xq-627c: pREST _groupby function-expression SQL injection (incomplete fix of CVE-2025-58450)","summary":"pREST _groupby function-expression SQL injection (incomplete fix of CVE-2025-58450)\n\nWhat the fix did and the gap\n----------------------------\nThe v2.3.0 fix (commit e88dabb) routed the _select field through a strict new gate, sanitizeSelectField (postgres.go:947/1003/2097). The sibling _groupby path was left on the far weaker isSafeSQLExpression. adapters/postgres/postgres.go, GroupByClause (line 1946): a _groupby field that contains balanced parens takes the raw-SQL-expression branch (around lines 1999-2006), gated only by isSafeSQLExpression (line 2001, defined at 2043). That gate validates only the OUTERMOST function name against a 13-entry allowlist and uses a character allowlist that permits spaces, single quotes and parens. It blocks ;, --, /* , unbalanced parens and an outer pg_ prefix, but NOT a trailing UNION SELECT ..., a nested (SELECT ...) subquery, or an inner pg_ function. sanitizeSelectField (the CVE fix) rejects exactly those.\n\nInput and attacker\n-------------------\nGET /{database}/{schema}/{table}?_select=id&_groupby=upper((SELECT+1))+UNION+SELECT+current_user. Sink trace: controllers/crud.go:131 calls GroupByClause unconditionally, concatenates it into sqlSelect (crud.go:133), executed at crud.go:176 with only the WHERE values parameterized. Reached after only a table read-permission check, passable unauthenticated in the default config (the same pipeline and attacker model as the anchor).\n\nVerification level\n------------------\nEXECUTED with negative controls (agent-run go test ./adapters/postgres/, PASS): isSafeSQLExpression wrongly accepts four payloads and GroupByClause emits them raw (e.g. GROUP BY upper((SELECT 1)) UNION SELECT current_user, and GROUP BY abs((SELECT 1 FROM pg_sleep(3)))); negative controls with ; and -- are rejected; and sanitizeSelectField (the CVE fix) rejects the exact UNION payload the sibling gate accepts. I independently re-confirmed at HEAD that _groupby is gated by isSafeSQLExpression (postgres.go:2001) while _select uses sanitizeSelectField (postgres.go:947). NOT verified: end-to-end UNION exfiltration against a live Postgres (needs column/type alignment, Postgres-gated). The pg_sleep DoS primitive is unconditional and needs no alignment; char-by-char blind extraction is constrained (commas are pre-split, and =/ are blocked).\n\nSuggested fix\n-------------\nRoute _groupby through the same strict gate as _select (sanitizeSelectField-style: reject nested subqueries, UNION, inner pg_ functions, and anything past a single allowlisted function call), or parameterize/whitelist the group-by columns.\n\nAlso checked and SOUND\n----------------------\nThe other builders (WhereByRequest, OrderByRequest, JoinByRequest, CountByRequest, the jsonb/tsquery paths, ->>having, ident.IsValid) are sound; only the _groupby non-having function branch is the weak sibling.\n\nAdvisory-source note\n--------------------\nFive-source enumeration: CVE-2025-58450 (GHSA-p46v-f2x8-qp98, \"Systemic SQL Injection\", GO-2025-3941) and the newer GHSA-qvx3-q8vx-9q3c (which covers _select, fixed v2.3.0). Neither mentions _grou\n\nAffected: Go:github.com/prest/prest, Go:github.com/prest/prest/v2\n\nFixed in: 2.4.0\n\nReferences:\nhttps://github.com/prest/prest/security/advisories/GHSA-v9v2-98xq-627c\nhttps://nvd.nist.gov/vuln/detail/CVE-2026-104129\nhttps://github.com/prest/prest/pull/1014\nhttps://github.com/prest/prest/commit/084348fa82701b098492fc520557ff290b7691e2\nhttps://github.com/prest/prest/commit/73e4b2aea81e2dbd33942efcb1a313fe3b151a41\nhttps://github.com/prest/prest\nhttps://github.com/prest/prest/releases/tag/v2.4.0","url":"https://osv.dev/vulnerability/GHSA-v9v2-98xq-627c","published_at":"2026-11-20T14:41:42Z","updated_at":"2026-11-20T15:00:07.782525Z","fetched_at":"2026-11-21T19:15:55.946329Z","severity":"critical","cvss_score":9.3,"epss":0.00442,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"github.com/prest/prest","vuln_id":"CVE-2026-104129","vuln_ids":["CVE-2025-58450","CVE-2026-104129","GHSA-P46V-F2X8-QP98","GHSA-QVX3-Q8VX-9Q3C","GHSA-V9V2-98XQ-627C"],"tags":["osv","go","fix-available"],"cluster_id":2043,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/10957","html":"https://vulnwatch.ve1ve2.com/item/10957"}},{"id":2312,"source":{"id":"ghsa","name":"GitHub Security Advisories"},"title":"GHSA-v9v2-98xq-627c / CVE-2026-104129: pREST _groupby function-expression SQL injection (incomplete fix of CVE-2025-58450)","summary":"pREST _groupby function-expression SQL injection (incomplete fix of CVE-2025-58450)\n\nWhat the fix did and the gap\n----------------------------\nThe v2.3.0 fix (commit e88dabb) routed the _select field through a strict new gate, sanitizeSelectField (postgres.go:947/1003/2097). The sibling _groupby path was left on the far weaker isSafeSQLExpression. adapters/postgres/postgres.go, GroupByClause (line 1946): a _groupby field that contains balanced parens takes the raw-SQL-expression branch (around lines 1999-2006), gated only by isSafeSQLExpression (line 2001, defined at 2043). That gate validates only the OUTERMOST function name against a 13-entry allowlist and uses a character allowlist that permits spaces, single quotes and parens. It blocks ;, --, /* , unbalanced parens and an outer pg_ prefix, but NOT a trailing UNION SELECT ..., a nested (SELECT ...) subquery, or an inner pg_ function. sanitizeSelectField (the CVE fix) rejects exactly those.\n\nInput and attacker\n-------------------\nGET /{database}/{schema}/{table}?_select=id&_groupby=upper((SELECT+1))+UNION+SELECT+current_user. Sink trace: controllers/crud.go:131 calls GroupByClause unconditionally, concatenates it into sqlSelect (crud.go:133), executed at crud.go:176 with only the WHERE values parameterized. Reached after only a table read-permission check, passable unauthenticated in the default config (the same pipeline and attacker model as the anchor).\n\nVerification level\n------------------\nEXECUTED with negative controls (agent-run go test ./adapters/postgres/, PASS): isSafeSQLExpression wrongly accepts four payloads and GroupByClause emits them raw (e.g. GROUP BY upper((SELECT 1)) UNION SELECT current_user, and GROUP BY abs((SELECT 1 FROM pg_sleep(3)))); negative controls with ; and -- are rejected; and sanitizeSelectField (the CVE fix) rejects the exact UNION payload the sibling gate accepts. I independently re-confirmed at HEAD that _groupby is gated by isSafeSQLExpression (postgres.go:2001) while _select uses sanitizeSelectField (postgres.go:947). NOT verified: end-to-end UNION exfiltration against a live Postgres (needs column/type alignment, Postgres-gated). The pg_sleep DoS primitive is unconditional and needs no alignment; char-by-char blind extraction is constrained (commas are pre-split, and =/ are blocked).\n\nSuggested fix\n-------------\nRoute _groupby through the same strict gate as _select (sanitizeSelectField-style: reject nested subqueries, UNION, inner pg_ functions, and anything past a single allowlisted function call), or parameterize/whitelist the group-by columns.\n\nAlso checked and SOUND\n----------------------\nThe other builders (WhereByRequest, OrderByRequest, JoinByRequest, CountByRequest, the jsonb/tsquery paths, ->>having, ident.IsValid) are sound; only the _groupby non-having function branch is the weak sibling.\n\nAdvisory-source note\n--------------------\nFive-source enumeration: CVE-2025-58450 (GHSA-p46v-f2x8-qp98, \"Systemic SQL Injection\", GO-2025-3941) and the newer GHSA-qvx3-q8vx-9q3c (which covers _select, fixed v2.3.0). Neither mentions _grou\n\nAffected packages: go:github.com/prest/prest, go:github.com/prest/prest/v2\nPatched: github.com/prest/prest/v2 2.4.0","url":"https://github.com/advisories/GHSA-v9v2-98xq-627c","published_at":"2026-11-20T14:41:42Z","updated_at":"2026-11-20T14:41:43Z","fetched_at":"2026-11-21T19:15:18.416741Z","severity":"critical","cvss_score":9.3,"epss":0.00442,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"github.com/prest/prest","vuln_id":"CVE-2026-104129","vuln_ids":["CVE-2025-58450","CVE-2026-104129","GHSA-P46V-F2X8-QP98","GHSA-QVX3-Q8VX-9Q3C","GHSA-V9V2-98XQ-627C"],"tags":["ghsa","go","CWE-89"],"cluster_id":2043,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/2312","html":"https://vulnwatch.ve1ve2.com/item/2312"}}]}