This article is reposted from https://blog.hyun.cc/post/yong-jiu-bai-piao-cloudfire-pro-huo-business/
Cloudflare Billing Logic Flaw: Bypassing Premium Subscriptions via Request Replay
While reverse-engineering Cloudflare’s subscription system, I discovered an interesting “gap” between the frontend checkout logic and the backend state synchronization. By using a specific request replay technique, it is possible to trick the backend into activating the Pro or Business plan without the system generating an actual bill.

01. Core Behavior: A “Quantum Superposition” of Identity and Permissions
This bypass method places the account in a peculiar state of misalignment:
- Privilege Escalation: The account effectively unlocks exclusive Pro/Business features (such as advanced WAF rules, image optimization, dedicated edge nodes, etc.).
- Logic Mismatch: The subscription management interface still displays the
Freeplan. Since the billing loop is never closed, the system generates no pending payment items or actual charges. - Zero-Cost Operation: Exploiting the logic flaw in the checkout interface allows for “free access” to premium privileges.
02. Prerequisites
Before reproducing this logic flaw, the following conditions must be met:
- Domain Onboarding: The domain has been successfully added to the Cloudflare account.
- Payment Environment: No valid credit card is linked to the account (or a card with a zero balance is linked to pass the initial check).
- Target Selection: On the
Active Subscriptionspage, clickChange, select the Pro or Business plan you wish to activate, and proceed to the payment page.
03. Steps: Capture and Replay
Using browser Developer Tools (DevTools), we can manually intervene in the checkout request.
Step 1: Locate the Key Request
Open the Network tab and click the payment button at the bottom of the page. Within the resulting traffic, locate the POST request named Append.
Step 2: Extract Core Metadata
Select the request and extract the following key parameters from the Headers and Payload sections:
- Request URL: The full API endpoint address.
- Cookie: Authentication credentials for the current session.
- X-atok: A Cloudflare-specific CSRF/authentication token.
- Payload: Click View Source within the
Request Payloadsection to retrieve the raw JSON structure.
Step 3: Console Script Injection
Switch to the Console tab and use the asynchronous script below to perform high-frequency replays.
04. Automated Replay Script
|
|

05. Technical Postscript
The root cause of this vulnerability likely stems from how Cloudflare handled the Append operation: the system executed the permission-granting logic first, while validating the payment result asynchronously. Under rapid, concurrent requests, the backend distributed database may have experienced a temporary state synchronization lag; consequently, permissions were written to the metadata, even though the billing transaction was subsequently rolled back due to a failed payment.
This “board first, pay later” approach is common among SaaS platforms striving for a seamless frontend experience, yet it also offers an excellent entry point for security research.