Descrizione
pREST (PostgreSQL REST) is an API that delivers an application on top of a Postgres database. Prior to 2.4.0, the vulnerable parameter is _groupby, handled by GroupByClause in adapters/postgres/postgres.go. adapters/postgres/postgres.go uses the weaker isSafeSQLExpression check for this function-expression branch instead of the stricter single-field validator used for _select. That check validates only the outer function name against a 13-function allowlist and permits nested subqueries, trailing UNION syntax, and inner pg_ functions. controllers/crud.go concatenates the GROUP BY expression while parameterizing only WHERE values, allowing attacker-controlled SQL structure into the clause. Default configuration permits unauthenticated access; a restricted installation may require a low-privilege table reader. UNION-based extraction requires compatible column counts and types and was not verified end to end, but a delay-producing function can cause denial of service without that alignment. This issue is fixed in 2.4.0.
Come correggere
Priorità: Media — correggere nel prossimo ciclo di patch. Motivazione: CVSS 8.1, EPSS 0.4% (percentile 38).
Versioni da aggiornare
- prest prest: vulnerabile la versione
< 2.4.0→ installare l'ultima release supportata dal vendor.
Mitigazioni temporanee
Da applicare solo se non è possibile aggiornare subito:
- Attivare regole WAF anti SQL injection, ridurre i privilegi dell'utente del database e monitorare query anomale.
Verifica
- Individuare tutti gli asset con il prodotto interessato (inventario, scanner di vulnerabilità, CMDB).
- Confrontare la versione installata con quelle indicate sopra.
- Applicare l'aggiornamento in un ambiente di test, poi in produzione; riavviare i servizi se richiesto.
- Ripetere la scansione per confermare la correzione.
Configurazioni interessate
| Vendor | Prodotto | Versioni vulnerabili | Corretta in |
|---|---|---|---|
| prest | prest | < 2.4.0 | — |
Riferimenti
- Riferimentohttps://github.com/prest/prest/commit/084348fa82701b098492fc520557ff290b7691e2
- Riferimentohttps://github.com/prest/prest/commit/73e4b2aea81e2dbd33942efcb1a313fe3b151a41
- Riferimentohttps://github.com/prest/prest/pull/1014
- Riferimentohttps://github.com/prest/prest/releases/tag/v2.4.0
- Riferimentohttps://github.com/prest/prest/security/advisories/GHSA-v9v2-98xq-627c