Alta

OneUptime ClickHouse vulnerable to SQL Injection via unvalidated column identifiers in sort, select, and groupBy parameters

  • Publicada: 18.03.2026
  • Actualizado: 11.10.2026 10:22

The fix for GHSA-p5g2-jm85-8g35 (ClickHouse SQL injection via aggregate query parameters) added column name validation to the _aggregateBy method but did not apply the same validation to three other query construction paths in StatementGenerator. The toSortStatement, toSelectStatement, and toGroupByStatement methods accept user-controlled object keys from API request bodies and interpolate them as ClickHouse Identifier parameters without verifying they correspond to actual model columns.

ClickHouse Identifier parameters are substituted directly into queries without escaping, so an attacker who can reach any analytics list or aggregate endpoint can inject arbitrary SQL through crafted sort, select, or groupBy keys.

Details

Root cause

StatementGenerator.ts has four methods that iterate over user-provided object keys to build SQL:

Method Validates keys?
toWhereStatement (line 292) Yes - calls this.model.getTableColumn(key)
toSortStatement (line 467) No
toSelectStatement (line 483) No
toGroupByStatement (line 451) No

In Statement.ts, when a value passed to the SQL tagged template is a string, it receives the Identifier data type (line 40). Per ClickHouse documentation, Identifier parameters are substituted directly into the query without quoting or escaping. This is correct for trusted column names but unsafe for user input.

Input flow

BaseAnalyticsAPI.ts deserializes sort, select, and groupBy directly from req.body (lines 239-253) and passes them to the service layer without column validation:

ts
sort = JSONFunctions.deserialize(req.body["sort"]) as Sort<AnalyticsDataModel>;
select = JSONFunctions.deserialize(req.body["select"]) as Select<AnalyticsDataModel>;
groupBy = JSONFunctions.deserialize(req.body["groupBy"]) as GroupBy<AnalyticsDataModel>;

Affected endpoints

Any endpoint backed by BaseAnalyticsAPI.getList() or BaseAnalyticsAPI.getAggregate() - this includes analytics queries for logs, metrics, spans, and exceptions.

Impact

An authenticated user can inject arbitrary ClickHouse SQL through crafted column names in sort, select, or groupBy request parameters. This allows reading, modifying, or deleting analytics data (logs, metrics, traces) stored in ClickHouse. PostgreSQL data is not affected (separate query path).

Suggested Fix

Add the same getTableColumn() validation already present in toWhereStatement to the three unvalidated methods:

ts
// toSortStatement, toSelectStatement, toGroupByStatement
for (const key in sort) {
  if (!this.model.getTableColumn(key)) {
    throw new BadDataException(`Unknown column: ${key}`);
  }
  // existing logic
}

This matches the pattern used in the GHSA-p5g2 fix for _aggregateBy and the existing toWhereStatement validation.

Software afectado

Haz clic en una tecnología para ver todas sus vulnerabilidades.

PlataformaPaqueteVersiones vulnerablesCorregida en
Paquete de npm oneuptime < 10.0.34 10.0.34

Referencias

Puntuación CVSS 8.1/10
Vector CVSS
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
Debilidad (CWE)
CWE-89
Plataforma
npm
Paquete
oneuptime
Publicada
18.03.2026
Actualizado
11.10.2026 10:22

Fuentes y licencias

OSV / GitHub Advisory Database - GHSA-gcg3-c5p2-cqgg - CC BY 4.0

Historial de vulnerabilidades: oneuptime

Todas las vulnerabilidades publicadas de este paquete (Paquete de npm), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.

Entradas en total
5
Primera → última
03.2026 03.2026
Sin corrección
0
Explotada en ataques
0

Distribución por gravedad

  • Crítica 1
  • Alta 3
  • Media 1

Divulgaciones por año

  1. 2026: 5
  1. Alta CVE-2026-33143 < 10.0.34 10.0.34
  2. OneUptime ClickHouse vulnerable to SQL Injection via unvalidated column identifiers in sort, select, and groupBy parameters esta entrada
    Alta · 8.1 CVE-2026-33142 < 10.0.34 10.0.34
  3. Media CVE-2026-32598 < 10.0.23 10.0.23
  4. Crítica · 9.9 CVE-2026-32306 < 10.0.23 10.0.23

Identifica las vulnerabilidades de tu aplicación

Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.

Conectar tu aplicación
Newsletter DockRay

La seguridad de tus aplicaciones en tu correo

Vulnerabilidades importantes, recomendaciones concretas y consejos prácticos para tus aplicaciones. Elige tus tecnologías y sigue lo que importa para tu proyecto.

  • Un resumen diario de nuevas vulnerabilidades, también las críticas.
  • Avisos sobre actualizaciones importantes.
  • Consejos prácticos sobre seguridad y monitorización de aplicaciones.

Déjalo vacío para recibir avisos de todas las tecnologías.

Suscripción gratuita. Date de baja con un clic en cualquier correo.