/

CVE-2026-32306

Severity:

CRITICAL RISK

(9.9)

SQL Injection in OneUptime Telemetry Aggregation API

CVE-2026-32306

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Arbitrary SQL execution with potential multi-tenant data exposure, data modification, and remote code execution via database functions

Severity:

CRITICAL RISK

(9.9)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

The telemetry aggregation API in OneUptime prior to 10.0.23 constructs ClickHouse SQL queries by directly interpolating user-controlled parameters without validation or parameterization.

An authenticated user can inject arbitrary SQL, potentially reading telemetry data across tenants, modifying database contents, and in some configurations achieving remote code execution via ClickHouse table functions.

Affected context

This vulnerability occurs in OneUptime deployments using the telemetry aggregation API backed by ClickHouse.

It is relevant when:

  • The API exposes aggregationType, aggregateColumnName, and aggregationTimestampColumnName as client-controlled parameters
  • The backend composes ClickHouse queries by building SQL strings directly and treating them as "trusted SQL"
  • There is no strict allowlist, input validation, or parameterized query enforcement for these parameters

In such contexts, authenticated users with access to telemetry aggregation endpoints can influence the structure of the underlying SQL queries.

Exploit preconditions

  • Attack surface: OneUptime telemetry aggregation HTTP API endpoints.
  • Required access: Authenticated user account with permissions to invoke telemetry aggregation (e.g., standard user in a tenant).
  • Trigger point: Requests that specify aggregationType, aggregateColumnName, or aggregationTimestampColumnName, which are appended directly into SQL strings.
  • Why exploitation is possible:
  • The application treats user-supplied values as trusted SQL fragments.
  • Queries are assembled via string concatenation using .append() without parameter binding.
  • No allowlist or schema-based restriction constrains which columns, functions, or SQL constructs can be referenced.
  • ClickHouse-specific features (e.g., table functions) can be invoked as part of injected SQL, potentially escalating impact.

Why this happens

The core issue is the direct inclusion of user-controlled input into SQL query strings without any structural safeguards, a textbook case of CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

Rather than treating API parameters as data to be bound via parameterized queries, the implementation appends them as raw SQL fragments, assuming they are trustworthy.

This breaks the separation between code and data, allowing an attacker to alter the intended query, inject arbitrary clauses, or introduce additional statements.

Because ClickHouse supports powerful table functions and operations, the impact of arbitrary SQL execution extends beyond simple data reads to cross-tenant disclosure, data tampering, and, in some environments, execution of commands through database-level facilities.

Potential impact

  • Read access to telemetry and monitoring data belonging to other tenants.
  • Exposure of internal metrics, logs, and performance data not intended for the requesting user.
  • Unauthorized modification or deletion of telemetry records, impacting monitoring accuracy and forensics.
  • Creation or alteration of database structures (tables, views, functions) within ClickHouse.
  • Potential remote code execution or host interaction where ClickHouse table functions or integrations allow command execution or external service invocation.
  • Use of the compromised database as a pivot point for further lateral movement within the infrastructure.

General mitigation guidance

Effective mitigation focuses on restoring a strict boundary between user input and executable SQL, and constraining what users can express via the API:

  • Replace dynamic SQL string concatenation with parameterized queries, ensuring all client-supplied values are bound as data.
  • Apply explicit allowlists for aggregationType and any field that influences SQL structure; only permit known-safe operations and column names.
  • Introduce schema-based validation for query-related parameters, rejecting input that references unexpected identifiers, functions, or expressions.
  • Encapsulate common aggregation patterns in fixed, pre-defined query templates that users select from rather than composing free-form SQL.
  • Restrict or disable high-risk ClickHouse capabilities (such as certain table functions) in contexts where user-driven queries are executed.
  • Enforce least-privilege database roles for the application user, limiting the ability to modify schema or invoke powerful functions even if injection occurs.

How teams detect issues like this

Detection typically combines code-centric review with runtime monitoring:

  • Static analysis and code review:
  • Search for dynamic SQL construction that uses .append(), string concatenation, or template interpolation with user-derived values.
  • Flag any use of "trusted SQL" patterns where inputs are assumed safe without a clear, enforced allowlist or validation layer.
  • Verify that parameters controlling column names, table names, or SQL fragments are either fully controlled by the server or passed through strict validation and parameter binding.
  • Automated tooling:
  • Configure SAST tools with rules targeting SQL injection patterns, including non-parameterized ClickHouse client calls.
  • Use linters or custom CI checks that forbid direct concatenation of request parameters into query strings.
  • Runtime and telemetry-based detection:
  • Log executed SQL queries and alert on unusual constructs, such as unexpected functions, UNION/JOINS across tenants, or table functions invoked through API-driven queries.
  • Monitor for anomalies in telemetry access patterns, especially cross-tenant data reads or sudden surges in query complexity from standard user accounts.

Sources

SourceLink
github.comgithub.com/OneUptime/oneuptime/security/advisories/GHSA-p5g2-jm85-8g35

Frequently asked

questions

Yes. Any authenticated user who can access the affected telemetry aggregation API endpoints over the network can attempt to exploit the SQL injection, without needing direct database connectivity.

Not necessarily. A standard authenticated user with permission to invoke telemetry aggregations is sufficient, provided they can control the aggregationType, aggregateColumnName, or aggregationTimestampColumnName parameters. Elevated privileges may increase the potential impact but are not strictly required for initial exploitation.

The most robust fix is to eliminate dynamic SQL composition from user input by using parameterized queries combined with strict allowlists. Parameters should be treated as data only, and any variable aspects of the query structure (such as allowed aggregation types or columns) must be constrained to predefined, server-controlled options.

Establish development standards that prohibit direct interpolation of user input into SQL, enforce use of parameterized APIs, and require allowlist-based validation for any user-controlled element that affects query structure. Integrate static analysis and security reviews into the CI/CD pipeline to detect unsafe query construction early, and regularly assess database privileges to limit the blast radius of any injection that might slip through.

Find out what's already
exploitable in your codebase.