Skip to main content

PostgreSQL CVE-2026-33142

HIGH
SQL Injection (CWE-89)
2026-03-18 https://github.com/OneUptime/oneuptime GHSA-gcg3-c5p2-cqgg
8.1
CVSS 3.1 · Vendor: https://github.com/OneUptime/oneuptime
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Authenticate to application with valid credentials
  2. Delivery
    Send API request with malicious object keys in body
  3. Exploit
    Inject SQL via toSortStatement/toSelectStatement/toGroupByStatement methods
  4. Execution
    Execute arbitrary ClickHouse queries
  5. Impact
    Extract sensitive data or modify database

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Parameterized queries, prepared statements
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Persistence

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Authenticated user with API access to ClickHouse connector. Attacker sends crafted API request with malicious object keys in request body targeting toSortStatement, toSelectStatement, or toGroupByStatement methods. No user interaction required. Affects ClickHouse SQL injection vulnerability in statement generation paths.

Impact

The CVSS score of 8.1 (High) reflects network-based attack vector with low complexity, requiring only low-level authentication and no user interaction, with high confidentiality and integrity impact but no availability impact (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N). The PR:L (low privileges required) requirement somewhat limits risk to authenticated users, but the detailed GitHub security advisory (GHSA-gcg3-c5p2-cqgg) provides comprehensive exploitation guidance including specific vulnerable methods, input flows, and suggested fixes, effectively serving as a technical roadmap for attackers. The vulnerability affects analytics endpoints that are likely exposed to authenticated internal users or customers with API access, increasing practical exploitation risk. No EPSS score or KEV status is provided in the intelligence, suggesting no active widespread exploitation has been detected yet. However, the low attack complexity combined with detailed public disclosure makes this a genuine priority for OneUptime deployments, particularly those with untrusted authenticated users or multi-tenant analytics access. The scope limitation to ClickHouse data (not PostgreSQL) provides some boundary to the blast radius.

Exploit ScenarioDerived

An authenticated attacker with access to OneUptime's analytics API crafts a POST request to any analytics list or aggregate endpoint with a malicious sort parameter containing SQL injection payloads as object keys, such as {"col1; DROP TABLE analytics_logs--": "asc"}. Because toSortStatement does not validate the key against actual model columns, the injected SQL is passed as a ClickHouse Identifier parameter and executed directly, allowing the attacker to exfiltrate sensitive analytics data, modify aggregation results, or delete logs and metrics stored in ClickHouse. The low attack complexity and detailed public advisory make exploitation straightforward for any authenticated user with API access.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Mar 18, 2026

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. An attacker with valid credentials can exploit this to access or manipulate database contents without requiring user interaction.

Earlier versions of this analysis (1)
v1 Mar 18, 2026 - 16:45 CVSS 8.1

A SQL injection vulnerability exists in OneUptime's ClickHouse analytics query construction where three methods (toSortStatement, toSelectStatement, toGroupByStatement) accept user-controlled object keys from API request bodies and interpolate them as ClickHouse Identifier parameters without validating they correspond to actual model columns. Authenticated users can exploit any analytics list or aggregate endpoint to inject arbitrary SQL through crafted sort, select, or groupBy keys, potentially reading, modifying, or deleting analytics data including logs, metrics, traces, and exceptions stored in ClickHouse. No KEV listing or public POC is currently documented, though the vulnerability is technically straightforward to exploit given the detailed advisory.

RemediationAI

Apply the suggested fix by adding getTableColumn() validation to the three unvalidated methods (toSortStatement, toSelectStatement, toGroupByStatement) in StatementGenerator.ts, matching the pattern already implemented in toWhereStatement and the previous GHSA-p5g2-jm85-8g35 fix for _aggregateBy. The fix involves iterating over user-provided keys and throwing a BadDataException for any column name not recognized by the model via this.model.getTableColumn(key) before constructing SQL statements. Monitor the OneUptime GitHub repository at https://github.com/OneUptime/oneuptime and security advisory at https://github.com/OneUptime/oneuptime/security/advisories/GHSA-gcg3-c5p2-cqgg for official patches. As an interim workaround, implement additional input validation at the API layer to restrict sort, select, and groupBy parameters to a whitelist of known-safe column names, or restrict access to analytics endpoints to only highly trusted authenticated users until patches can be deployed. Review ClickHouse audit logs for suspicious analytics queries containing unusual column names or SQL syntax in sort, select, or groupBy parameters.

Affected Packages

npm oneuptime fix: 10.0.34

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

This vulnerability affects the OneUptime npm package (pkg:npm/oneuptime), specifically in the StatementGenerator.ts component that constructs ClickHouse SQL queries for analytics data. The root cause is CWE-89 (SQL Injection) stemming from improper neutralization of special elements in SQL commands. ClickHouse Identifier parameters are substituted directly into queries without escaping or quoting, which is safe only for trusted column names. While the earlier GHSA-p5g2-jm85-8g35 fix added validation to the _aggregateBy method via getTableColumn() checks, the same protection was not applied to toSortStatement, toSelectStatement, and toGroupByStatement methods. These methods receive deserialized user input from req.body through BaseAnalyticsAPI.ts without column validation, creating multiple injection vectors. The vulnerability is isolated to ClickHouse analytics data; PostgreSQL data paths remain unaffected as they use separate query construction logic.

Know when PostgreSQL gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/OneUptime/oneuptime) PRIMARY 8.1 HIGH
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N

Primary rating from Vendor (https://github.com/OneUptime/oneuptime) · only source for this CVE.

CVSS VectorVendor: https://github.com/OneUptime/oneuptime

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None

Lifecycle Timeline

2
Patch released
Mar 31, 2026 - 21:13 nvd
Patch available
CVE Published
Mar 18, 2026 - 16:34 nvd
HIGH 8.1

DescriptionCVE.org

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:

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

Executive ViewAI

Why It Matters

OneUptime deployments face a high-severity SQL injection vulnerability in analytics query processing that allows authenticated users to access, modify, or delete sensitive operational data including logs, metrics, traces, and exceptions. Organizations using OneUptime for monitoring and observability should immediately assess exposure and implement interim controls, as no vendor patch is currently available.

Business Impact: High
Compensating Controls

Implement Web Application Firewall (WAF) rules to reject analytics API requests containing non-alphanumeric characters or SQL keywords in sort, select, and groupBy parameters; enforce network segmentation to restrict analytics endpoint access to internal networks only; disable analytics query customization features for non-administrative users; enable comprehensive audit logging and alerting on analytics API access patterns; apply API rate limiting and IP allowlisting to trusted consuming applications. Monitor vendor security advisories closely for patch release.

Threat Intelligence Overview

EPSS Score
0.0%
Top 93% exploitable
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact
High

Priority Score

40
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +40
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.

Affected Products (CPE)CVE.org

pkg:npm/oneuptime

Related Vulnerabilities in ClickHouse SQL Injection Validation

View all 2
CVE-2025-1094 HIGH POC
8.1 Feb 13

PostgreSQL libpq functions PQescapeLiteral(), PQescapeIdentifier(), PQescapeString(), and PQescapeStringConn() improperl

CVE-2024-55964 CRITICAL POC
9.8 Mar 26

An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl

CVE-2013-1899 MEDIUM POC
6.5 Apr 04

Argument injection vulnerability in PostgreSQL 9.2.x before 9.2.4, 9.1.x before 9.1.9, and 9.0.x before 9.0.13 allows re

CVE-2026-20253 CRITICAL POC
9.8 Jun 10

Unauthenticated arbitrary file write in Splunk Enterprise (below 10.2.4 and 10.0.7) and Splunk Cloud Platform (below 10.

CVE-2026-9586 CRITICAL POC
9.3 Jul 17

Unauthenticated SQL injection in Sangoma Switchvox SMB Edition 8.3 (build 104997) lets remote attackers execute arbitrar

CVE-2017-7546 CRITICAL
9.8 Aug 16

PostgreSQL versions before 9.2.22, 9.3.18, 9.4.13, 9.5.8 and 9.6.4 are vulnerable to incorrect authentication flaw allow

CVE-2015-1352 MEDIUM POC
5.0 Mar 30

The build_tablename function in pgsql.c in the PostgreSQL (aka pgsql) extension in PHP through 5.6.7 does not validate t

CVE-2024-10553 CRITICAL POC
9.8 Mar 20

A vulnerability in the h2oai/h2o-3 REST API versions 3.46.0.4 allows unauthenticated remote attackers to execute arbitra

CVE-2019-9193 HIGH POC
7.2 Apr 01

In PostgreSQL 9.3 through 11.2, the "COPY TO/FROM PROGRAM" function allows superusers and users in the 'pg_execute_serve

CVE-2026-40887 CRITICAL POC
9.1 Apr 14

Unauthenticated SQL injection in Vendure Shop API allows remote attackers to execute arbitrary SQL commands against the

CVE-2022-24760 CRITICAL POC
10.0 Mar 12

Parse Server is an open source http web server backend. Rated critical severity (CVSS 10.0), this vulnerability is remot

CVE-2025-56157 CRITICAL POC
9.8 Dec 18

Hard-coded default PostgreSQL credentials shipped in the docker-compose.yaml of langgenius Dify through version 1.5.1 al

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