- Severity: HIGH
- CVE: CVE-2026-104129
- Ecosystems: go, go
- Packages: github.com/prest/prest, github.com/prest/prest/v2
What the fix did and the gap
—————————-
The 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.
Input and attacker
——————-
GET /{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).
Verification level
——————
EXECUTED with negative controls (agent-run go test ./adapters/postgres/, PASS): isSafeSQLExpression wrongly accept…
Source: GitHub Security Advisories · 2026-11-20