CVE-2026-33142

HIGH
2026-03-18 https://github.com/OneUptime/oneuptime GHSA-gcg3-c5p2-cqgg
8.1
CVSS 3.1
Share

CVSS Vector

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

Lifecycle Timeline

3
Patch Released
Mar 31, 2026 - 21:13 nvd
Patch available
Analysis Generated
Mar 18, 2026 - 16:45 vuln.today
CVE Published
Mar 18, 2026 - 16:34 nvd
HIGH 8.1

Description

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](https://clickhouse.com/docs/en/sql-reference/syntax#defining-and-using-query-parameters), 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: ```typescript 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: ```typescript // 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.

Analysis

SQL injection in PostgreSQL StatementGenerator allows authenticated attackers to execute arbitrary SQL commands through unsanitized object keys in sort, select, and groupBy parameters on analytics endpoints. The vulnerability exists because column name validation was incompletely applied during a previous fix, leaving three query construction methods vulnerable to direct identifier injection. …

Sign in for full analysis, threat intelligence, and remediation guidance.

Remediation

Within 24 hours: Inventory all OneUptime instances and identify those with analytics endpoints exposed to untrusted users; restrict API access to analytics list and aggregate endpoints to essential personnel only. Within 7 days: Implement WAF rules to block requests with suspicious sort, select, or groupBy parameters; enable detailed audit logging on all analytics API calls; consider disabling user-facing analytics features if feasible for your operational model. …

Sign in for detailed remediation steps.

Priority Score

41
Low Medium High Critical
KEV: 0
EPSS: +0.0
CVSS: +40
POC: 0

Share

CVE-2026-33142 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy