CVE-2026-33142: Oneuptime SQL Injection Vulnerability
HIGHCVE-2026-33142 is a HIGH (CVSS 8.1) sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Oneuptime libraries in the npm ecosystem. The issue involves oneuptime clickhouse vulnerable to sql injection via unvalidated column identifiers in sort, select, and groupby parameters. Remediation is available by upgrading affected packages to version 10.0.34.
CVE-2026-33142 at a Glance
Security Impact
CVSS: 8.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N).
How to Fix CVE-2026-33142
To remediate this vulnerability, upgrade all affected Oneuptime dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install oneuptime@10.0.34
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls oneuptime
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-33142, inspect your project dependencies using npm:
npm ls oneuptime
Analyze the terminal output to locate any version of Oneuptime in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 10.0.34), your application is affected.
Note: The npm ls oneuptime command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In Oneuptime, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-33142 Affected Oneuptime Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
oneuptime
|
npm |
< 10.0.34
|
10.0.34
|
References
Frequently Asked Questions
What is CVE-2026-33142?
Which Oneuptime versions are affected?
What version fixes CVE-2026-33142?
Is oneuptime affected?
What is the CVSS score of CVE-2026-33142?
What CWE is associated with CVE-2026-33142?
How can I check npm dependencies for CVE-2026-33142?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-gcg3-c5p2-cqgg",
"modified" : "2026-03-20T21:33:25Z",
"published" : "2026-03-18T16:34:18Z",
"aliases" : [ "CVE-2026-33142" ],
"summary" : "OneUptime ClickHouse vulnerable to SQL Injection via unvalidated column identifiers in sort, select, and groupBy parameters",
"details" : "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.\n\nClickHouse 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.\n\n## Details\n\n### Root cause\n\n`StatementGenerator.ts` has four methods that iterate over user-provided object keys to build SQL:\n\n| Method | Validates keys? |\n|--------|----------------|\n| `toWhereStatement` (line 292) | Yes - calls `this.model.getTableColumn(key)` |\n| `toSortStatement` (line 467) | **No** |\n| `toSelectStatement` (line 483) | **No** |\n| `toGroupByStatement` (line 451) | **No** |\n\nIn `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.\n\n### Input flow\n\n`BaseAnalyticsAPI.ts` deserializes `sort`, `select`, and `groupBy` directly from `req.body` (lines 239-253) and passes them to the service layer without column validation:\n\n```typescript\nsort = JSONFunctions.deserialize(req.body[\"sort\"]) as Sort<AnalyticsDataModel>;\nselect = JSONFunctions.deserialize(req.body[\"select\"]) as Select<AnalyticsDataModel>;\ngroupBy = JSONFunctions.deserialize(req.body[\"groupBy\"]) as GroupBy<AnalyticsDataModel>;\n```\n\n### Affected endpoints\n\nAny endpoint backed by `BaseAnalyticsAPI.getList()` or `BaseAnalyticsAPI.getAggregate()` - this includes analytics queries for logs, metrics, spans, and exceptions.\n\n## Impact\n\nAn 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).\n\n## Suggested Fix\n\nAdd the same `getTableColumn()` validation already present in `toWhereStatement` to the three unvalidated methods:\n\n```typescript\n// toSortStatement, toSelectStatement, toGroupByStatement\nfor (const key in sort) {\n if (!this.model.getTableColumn(key)) {\n throw new BadDataException(`Unknown column: ${key}`);\n }\n // existing logic\n}\n```\n\nThis matches the pattern used in the GHSA-p5g2 fix for `_aggregateBy` and the existing `toWhereStatement` validation.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "oneuptime"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "10.0.34"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/OneUptime/oneuptime/security/advisories/GHSA-gcg3-c5p2-cqgg"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-33142"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/OneUptime/oneuptime"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-89" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-03-18T16:34:18Z",
"nvd_published_at" : "2026-03-20T21:17:14Z"
}
}