Skip to content
Race condition Disclosed report Intermediate

Race condition leads to Inflation of coins when bought via Google Play Store at endpoint https://oauth.reddit.com/api/v2/gold/android/verify_purchase

The Reddit Android app's coin purchase verification endpoint had a race condition, allowing an attacker to send multiple parallel requests with the same transaction ID and receive coins multiple times. This could lead to financial loss for Reddit as attackers obtain more coins than they paid for.

yashrs Follow

Originally disclosed on HackerOne

  • Triaged in 5 hours
  • Fixed in 12 days
  • Paid in 12 days
  • Disclosed after 20 months

Hi,

Summary:

When we purchase coins from Reddit's mobile app using Android, https://oauth.reddit.com/api/v2/gold/android/verify_purchase is called with parameters like transaction_id and token. There exists a race condition on this endpoint which allows an attacker to get coins many times more than it was intended to.

Steps To Reproduce:

  • Go to the Reddit app, click on the top right corner which has a coin icon and says Get:

  • Select a basic 50 coins package, and intercept this request when the purchase is completed:

POST /api/v2/gold/android/verify_purchase?raw_json=1&feature=link_preview&sr_detail=true&expand_srs=true&from_detail=true&api_type=json&raw_json=1&always_show_media=1&request_timestamp=1582296187715 HTTP/1.1
Authorization: Bearer REDACTED
Client-Vendor-ID: REDACTED
x-reddit-device-id: REDACTED
User-Agent: Reddit/Version 2020.5.0/Build 255357/Android 9
X-Dev-Ad-Id: REDACTED
x-reddit-session: REDACTED
x-reddit-loid: REDACTED
x-reddaid: REDACTED
Content-Type: application/x-www-form-urlencoded
Content-Length: 327
Host: oauth.reddit.com
Connection: keep-alive
Accept-Encoding: gzip, deflate

transaction_id=GPA.3390-9967-2355-57063&token=effmpcoplmjonhljkheipnce.AO-J1OyQ3ZXb7XM7JwoJPJqpNP3LgWYqHYUUmOE7o5hCzQtf4TC8GL0i71zvRVeZKl-I5rlQCfM0ID3Z0P8CTFSUmhbdbPvQwOIN0164LBE647_lDvB9aHzk2naeC59hSFrtJJYkYj2b&package_name=com.reddit.frontpage&product_id=com.reddit.coins_1&correlation_id=394e65c9-5f9d-45e7-a9b4-498ed64251cd
  • We can simply repeat this request in parallel to get more coins.

I did 10 parallel requests and got 9 of them through. An actual attacker will do more requests and get more coins. Like for example, they can do 40 requests and maybe if 35 of them get through they have 35x times the coins intended.

Transaction ID for reference: GPA.3390-9967-2355-57063

Proof:

Screenshot_20200221-201400.jpg
Screenshot_20200221-201400.jpg From the original on HackerOne
Screen_Shot_2020-02-21_at_8.26.55_PM.png
Screen_Shot_2020-02-21_at_8.26.55_PM.png
Screen_Shot_2020-02-21_at_8.26.39_PM.png
Screen_Shot_2020-02-21_at_8.26.39_PM.png

███

Regards, Yash

Impact

Due to a race condition on https://oauth.reddit.com/api/v2/gold/android/verify_purchase, an attacker can get more coins than what they purchased it for. This can lead to a huge business loss for Reddit, that's why I have marked this as High.

The original report as published on HackerOne, by yashrs. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Impact

An attacker could obtain more coins than purchased, leading to potential business loss for Reddit; the report notes that in a test with 10 parallel requests, 9 succeeded.

What the attacker needed

Android Reddit app; Ability to intercept and modify requests; A valid purchase transaction

How it was found

  1. Open the Reddit app and tap the coin icon to buy coins.
  2. Select a coin package and intercept the purchase verification request.
  3. Send the same request multiple times in parallel to receive coins multiple times.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When you buy coins in the Reddit app, the app sends a request to Reddit's server to confirm the purchase. The server had a flaw: if the same confirmation request was sent many times at almost the same moment, the server would grant coins for each request, even though only one purchase was made. This meant someone could pay once but get coins many times over.

What is Race condition?

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.

More by yashrs

View all

6 more disclosed reports, best first.

More from Reddit

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Race conditions

The lesson behind this report.

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.