Skip to content

fix: patch SSRF in Gemini proxy and payload injection in brochure APIs - #48

Draft
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/vulnerability-findings-memory-8368
Draft

fix: patch SSRF in Gemini proxy and payload injection in brochure APIs#48
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/vulnerability-findings-memory-8368

Conversation

@cursor

@cursor cursor Bot commented Jul 16, 2026

Copy link
Copy Markdown

Security Fixes

Two vulnerabilities identified during automated security scan, both fixed in this PR:

1. SSRF via path traversal in Gemini provider (HIGH)

File: the-unit/api/src/providers/gemini.ts

The :model route parameter was interpolated directly into the Vertex AI upstream URL without validation. URL-encoded path traversal characters (%2F/, %3F?) in the parameter could redirect authenticated requests to arbitrary paths on aiplatform.googleapis.com using the service account's ADC token.

Fix: Added a regex allowlist (/^[a-z0-9][-a-z0-9.]*$/i) that rejects model names containing slashes, dots-dots, question marks, or other URL-special characters before constructing the upstream URL.

2. Webhook/email payload injection via object spread (MEDIUM)

File: sites/build.mjs + all 11 generated sites/dist/*/worker.js

The /api/book, /api/intake, and /api/chat endpoints used { kind: "booking", site: SITE_ID, ...data } to merge user JSON into the fireAlert payload. This allowed attackers to override kind/site fields and inject arbitrary keys into KV storage, webhook payloads, and notification emails.

Fix: Replaced open object spread with explicit field destructuring so only expected form fields are forwarded to downstream systems.

Verification

  • npm run typecheck passes (gumption-api)
  • npm run test:boot passes (all 6 tests, including Gemini endpoint)
  • node sites/build.mjs regenerates all 11 sites successfully
Open in Web View Automation 

cursoragent and others added 2 commits July 16, 2026 09:33
The model route parameter was interpolated directly into the Vertex AI
upstream URL without validation. URL-encoded path traversal characters
(%2F, %3F) in the parameter could redirect authenticated requests to
arbitrary paths on aiplatform.googleapis.com using the service account's
ADC token.

Add a regex allowlist (alphanumeric, hyphens, dots) and reject model
names containing slashes, dots-dots, question marks, or other
URL-special characters before constructing the upstream URL.

Co-authored-by: CARBComplianceApp <CARBComplianceApp@users.noreply.github.com>
The /api/book, /api/intake, and /api/chat endpoints used object spread
(`...data`) to merge user-submitted JSON into the fireAlert payload.
This allowed attackers to override the `kind` and `site` fields and
inject arbitrary keys that flow into KV storage, webhook payloads, and
notification emails.

Replace the open spread with explicit field destructuring so only
expected form fields are forwarded. Rebuild all 11 generated sites.

Co-authored-by: CARBComplianceApp <CARBComplianceApp@users.noreply.github.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
dmc-properties ea05522 Jul 16 2026, 09:35 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant