Stripe Webhook Signature Bypass via Empty Secret Enables Unlimited Quota Fraud
A vulnerability in the Stripe webhook handler allows an unauthenticated attacker to forge webhook events and credit arbitrary quota to their account without payment, stemming from an empty StripeWebhookSecret and lack of PaymentMethod validation, enabling cross-gateway exploitation.
A critical vulnerability exists in the Stripe webhook handler that allows an unauthenticated attacker to forge webhook events and credit arbitrary quota to their account without making any payment. Disclosed on 2025-04-15 and patched the same day in v0.12.10, the vulnerability stems from three compounding flaws: the Stripe webhook endpoint does not reject requests when StripeWebhookSecret is empty (the default), any attacker can compute valid webhook signatures when the HMAC secret is empty, and the Recharge function does not validate that the order’s PaymentMethod matches the callback source. This enables cross-gateway exploitation where orders created via any payment method can be fulfilled through a forged Stripe webhook. This vulnerability allows for financial fraud through unlimited API quota acquisition without payment.
Attack Chain
- Attacker registers a user account on the target platform.
- Attacker calls
POST /api/user/payto create an Epay top-up order, setting theamount. The order is stored with apendingstatus. - Attacker queries
GET /api/user/topup/selfto retrieve thetrade_noof the pending order. - Attacker computes an
HMAC-SHA256signature with an empty key over a craftedcheckout.session.completedpayload. This payload contains the stolentrade_noas theclient_reference_id. - Attacker sends a
POSTrequest to/api/stripe/webhookwith the forged payload and a craftedStripe-Signatureheader. - The server verifies the signature, which passes because the
StripeWebhookSecretis empty. - The server calls the
Recharge()function, which finds the Epay order bytrade_no, marks the order assuccess, and credits the attacker’s account with the full quota. - The attacker repeats steps 2-6 indefinitely to accumulate unlimited credits, leading to financial fraud.
Impact
This vulnerability allows attackers to obtain unlimited API quota without payment, leading to financial fraud. The operator of the vulnerable system faces financial losses due to fraudulent quota consumption against upstream AI providers such as OpenAI, Anthropic, and Google. The fraudulent top-ups can appear as normal transactions in system logs, making detection challenging. Due to the default insecure configuration, virtually all deployments with any payment method enabled are vulnerable, creating a wide exposure.
Recommendation
- Set
StripeWebhookSecretto a non-empty value to prevent empty-key HMAC forgery, mitigating the primary attack vector (Flaw 1). - Apply a reverse proxy (Nginx, Caddy, etc.) to deny access to
/api/stripe/webhookif Stripe is not configured, as a temporary workaround. - Deploy the Sigma rule
Detect Forged Stripe Webhook Requestto identify potential exploitation attempts by monitoring requests to the webhook endpoint with empty secrets or invalid signatures. - Upgrade to v0.12.10 immediately, as it addresses all three flaws completely.
Detection coverage 2
Detect Forged Stripe Webhook Request
highDetects potential attempts to exploit the Stripe webhook signature bypass vulnerability by monitoring requests to the webhook endpoint with suspicious signatures.
Detect Stripe Webhook Request with missing signature
highDetects potential attempts to exploit the Stripe webhook signature bypass vulnerability by monitoring requests to the webhook endpoint with missing signatures.
Detection queries are kept inside the platform. Get full rules →