CVE-2026-33142

CVE-2026-33142 is a high-severity SQL injection vulnerability in oneuptime (npm), affecting versions < 10.0.34. It is fixed in 10.0.34.

Summary

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:

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).

Untrusted input alters a database query, allowing the attacker to read or modify data the query was not intended to access. Typical impact: data disclosure or modification.

CVE-2026-33142 has a CVSS score of 8.1 (High). The vector is network-reachable, low privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (10.0.34); upgrading removes the vulnerable code path.

Affected versions

oneuptime (< 10.0.34)

Security releases

oneuptime → 10.0.34 (npm)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

See it in your environment

Remediation advice

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

// 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.

Frequently Asked Questions

  1. What is CVE-2026-33142? CVE-2026-33142 is a high-severity SQL injection vulnerability in oneuptime (npm), affecting versions < 10.0.34. It is fixed in 10.0.34. Untrusted input alters a database query, allowing the attacker to read or modify data the query was not intended to access.
  2. How severe is CVE-2026-33142? CVE-2026-33142 has a CVSS score of 8.1 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of oneuptime are affected by CVE-2026-33142? oneuptime (npm) versions < 10.0.34 is affected.
  4. Is there a fix for CVE-2026-33142? Yes. CVE-2026-33142 is fixed in 10.0.34. Upgrade to this version or later.
  5. Is CVE-2026-33142 exploitable, and should I be worried? Whether CVE-2026-33142 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2026-33142 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2026-33142? Upgrade oneuptime to 10.0.34 or later.

Other vulnerabilities in oneuptime

CVE-2026-33143CVE-2026-33142CVE-2026-32598CVE-2026-32308

Stop the waste.
Protect your environment with Kodem.