CVE-2026-104129: Github.com/prest/prest SQL Injection Vulnerability

HIGH
Advisory Identifier: GHSA-v9v2-98xq-627c
CVSS 8.1
CWE-89
Published
Advisory Summary

CVE-2026-104129 is a HIGH (CVSS 8.1) sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Github.com/prest/prest libraries in the Go ecosystem. The issue involves prest _groupby function-expression sql injection (incomplete fix of cve-2025-58450). Remediation is available by upgrading affected packages to version 2.4.0.

CVE-2026-104129 at a Glance

CVE Identifier CVE-2026-104129
GHSA Identifier GHSA-v9v2-98xq-627c
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product Github.com/prest/prest
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-104129

To remediate this vulnerability, upgrade all affected Github.com/prest/prest dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/prest/prest fixed: Latest secure release
Upgrade github.com/prest/prest to Latest secure release
github.com/prest/prest/v2 fixed: 2.4.0
Upgrade github.com/prest/prest/v2 to 2.4.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/prest/prest

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-104129, inspect your project dependencies for Github.com/prest/prest:

inspect dependencies for github.com/prest/prest

Analyze the terminal output to locate any version of Github.com/prest/prest in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.4.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In Github.com/prest/prest, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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 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). Suggested fix ------------- Route _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. Also checked and SOUND ---------------------- The 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. Advisory-source note -------------------- Five-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 _groupby / GROUP BY. The systemic advisory's own "nested queries can be performed" note supports the incomplete-fix framing. Not contested. Dedup ----- Dedup gate clean: no prest/prest blocking verdict in COVERED-INDEX, DISCLOSURE-INDEX or SCOUT-EXCLUDE. Tooling ------- AI assistance wsa used while investigating. The injection is executed-verified with negative controls (isSafeSQLExpression accepts four UNION/subquery/pg_sleep payloads that GroupByClause emits raw, while ;/-- are rejected and the _select gate rejects the same UNION payload), and I confirmed at HEAD that _groupby uses the weak isSafeSQLExpression while _select was hardened with sanitizeSelectField.

CVE-2026-104129 Affected Github.com/prest/prest Versions

2 component(s)
Fixed Versions:
2.4.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/prest/prest
Go
≤ 1.5.5
github.com/prest/prest/v2
Go
< 2.4.0
2.4.0

References

Frequently Asked Questions

What is CVE-2026-104129?
CVE-2026-104129 is a security vulnerability in Github.com/prest/prest involving pREST _groupby function-expression SQL injection (incomplete fix of CVE-2025-58450) under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which Github.com/prest/prest versions are affected?
Affected versions include releases prior to 2.4.0 across affected packages: github.com/prest/prest, github.com/prest/prest/v2.
What version fixes CVE-2026-104129?
Upgrading to 2.4.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/prest/prest affected?
Yes, github.com/prest/prest is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
Is github.com/prest/prest/v2 affected?
Yes, github.com/prest/prest/v2 is affected in releases prior to 2.4.0. Upgrade your dependency to 2.4.0 or later.
What is the CVSS score of CVE-2026-104129?
CVE-2026-104129 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2026-104129?
CVE-2026-104129 is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.).
How can I check Go dependencies for CVE-2026-104129?
Run the dependency tree command: 'inspect dependencies for github.com/prest/prest'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-v9v2-98xq-627c",
  "modified" : "2026-11-20T14:41:42Z",
  "published" : "2026-11-20T14:41:42Z",
  "aliases" : [ "CVE-2026-104129" ],
  "summary" : "pREST _groupby function-expression SQL injection (incomplete fix of CVE-2025-58450)",
  "details" : "What 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 _groupby / GROUP BY. The systemic advisory's own \"nested queries can be performed\" note supports the incomplete-fix framing. Not contested.\n\nDedup\n-----\nDedup gate clean: no prest/prest blocking verdict in COVERED-INDEX, DISCLOSURE-INDEX or SCOUT-EXCLUDE.\n\nTooling\n-------\nAI assistance wsa used while investigating. The injection is executed-verified with negative controls (isSafeSQLExpression accepts four UNION/subquery/pg_sleep payloads that GroupByClause emits raw, while ;/-- are rejected and the _select gate rejects the same UNION payload), and I confirmed at HEAD that _groupby uses the weak isSafeSQLExpression while _select was hardened with sanitizeSelectField.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/prest/prest"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "1.5.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/prest/prest/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.4.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.3.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/prest/prest/security/advisories/GHSA-v9v2-98xq-627c"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-104129"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/prest/prest/pull/1014"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/prest/prest/commit/084348fa82701b098492fc520557ff290b7691e2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/prest/prest/commit/73e4b2aea81e2dbd33942efcb1a313fe3b151a41"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/prest/prest"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/prest/prest/releases/tag/v2.4.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-89" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-11-20T14:41:42Z",
    "nvd_published_at" : "2026-11-19T19:17:17Z"
  }
}