# IDOR to pay less for coin purchases on oauth.reddit.com via /api/v2/gold/paypal/create_coin_purchase_order in `order_id` parameter 

Swapping the PayPal order_id from a cheap coin pack into a larger pack's purchase request let attacker pay $1.99 for 1100 coins.

- Payout: $500
- Severity: medium
- Program: Reddit
- Found by: yanouhd
- Disclosed: 2021-10-21
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/1213765
- Library page: https://bugbountylibrary.com/r/h1%3A1213765
- Tags: area:web domain:web impact:funds-loss kind:bounty platform:hackerone sev:medium tech:payment technique:param-pollution vuln:business-logic vuln:fee-bypass vuln:idor

**Target:** oauth.reddit.com /api/v2/gold/paypal/create_coin_purchase_order endpoint
**Root cause:** Server trusted the client-supplied order_id to determine the PayPal amount without binding it to the requested coin package, so a cheaper order's ID could be reused for a larger pack.
**Steps:**
1. Initiate smallest pack purchase (500 coins/$1.99); intercept POST /api/v2/gold/paypal/create_coin_purchase_order with `coins=500&pennies=199&correlation_id=...`
2. Capture returned `order_id` (e.g. `1CR56170K7852611T`)
3. Cancel that order, start a larger pack (1100 coins/$3.99)
4. Intercept the new create_coin_purchase_order response and replace its `order_id` with the cheap one
5. Redirected to PayPal showing $1.99; pay it
6. Complete order and receive the larger coin amount
**How found:** Noticed the create_coin_purchase_order request/response exposes an order_id and that the amount shown at PayPal derives from that ID rather than the coin package, then hypothesized swapping IDs across packages.
**Exploitation:** Attacker pays the PayPal amount tied to the cheap order_id while the Reddit backend credits coins based on the originally requested larger package, netting extra coins for less money.
**Insight:** Payment flows that return a provider order_id and later credit goods should be tested by cross-linking order_ids between different SKUs/prices to see if the server re-validates amount vs. product.

## Proof of concept (copied exactly from the original report)

**POST body for small coin purchase order**

```
POST to https://oauth.reddit.com/api/v2/gold/paypal/create_coin_purchase_order, with this body : 
`coins=500&pennies=199&correlation_id=b0fc62e4-e759-4b9e-be52-da4c926560ce
```

**Swapping order_id to cheaper transaction**

```
{"order_id": "~~1CR56170K7852611T~~ **1F444042JJ523625W**"}
```

