CVE-2026-33142: OneUptime: ClickHouse SQL Injection via unvalidated column identifiers in sort, select, and groupBy parameters

Published Mar 18, 2026
·
Updated

OneUptime is a solution for monitoring and managing online services. Prior to version 10.0.34, the fix for CVE-2026-32306 (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. This issue has been patched in version 10.0.34.

Other sources

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:

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.

— GitHub

Affected Software

2 affected componentsFixes available
npm/oneuptime<10.0.34
10.0.34
Hackerbay Oneuptime<10.0.34

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/oneuptime to a version that resolves this vulnerability.

    Fixed in 10.0.34
  2. Upgrade

    Upgrade OneUptime to a version that resolves this vulnerability.

    Fixed in 10.0.34

Event History

Mar 18, 2026
Advisory Published
via GitHub·04:34 PM
Data Sourced
via GitHub·04:34 PM
DescriptionSeverityWeaknessAffected Software
Mar 20, 2026
CVE Published
via MITRE·08:05 PM
Data Sourced
via MITRE·08:05 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·09:17 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-33142?

CVE-2026-33142 has been rated as a moderate severity vulnerability due to the potential for SQL injection.

2

How do I fix CVE-2026-33142?

To fix CVE-2026-33142, update to the latest version of the affected package that includes the necessary validation for query parameters.

3

What software is affected by CVE-2026-33142?

CVE-2026-33142 affects versions of the OneUptime package prior to version 10.0.34.

4

What type of vulnerability is CVE-2026-33142?

CVE-2026-33142 is classified as an SQL injection vulnerability related to aggregate query parameters.

5

Is there a workaround for CVE-2026-33142?

There are no known workarounds for CVE-2026-33142; users should upgrade to the fixed version to mitigate the risk.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203