Bruteforcing Coupons
An API endpoint for checking discount coupons had no rate limiting, allowing an attacker to brute-force coupon codes and identify valid ones by filtering responses for a success indicator.
- Triaged in 25 days
- Fixed in 33 days
- Disclosed after 33 days
Hi,
while i was fuzzing for an API endpoints i found this endpoint: https://infogram.com/api/discounts the first thing came on my mind is bruteforcing the coupon codes so i gave it a try and it worked! there's no rate limit on that endpoint so an attacker could use it to bruteforce the coupon codes and filter the results to snipe the "valid":true response
##Steps to reproduce:
-
intercept the request using burpsuite or any proxy tool you would like to use
-
send the request to the intruder
-
configure the payload position

Screenshot_from_2017-11-09_10-28-27.png From the original on HackerOne -
start the attack
i wrote a simple script in bash to do the operation
#!/bin/bash
while [ 1 ]
do
coupon=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 6 | head -n 1)
curl=$(curl -i -s -k -X $'GET' \
-H $'X-Requested-With: XMLHttpRequest' \
-b $'Cookies:XXXXXXX' \
$'https://infogram.com/api/discounts/$coupon')
if [[ $curl == *"valid":true* ]]
echo "$coupon is valid";
else
echo "$coupon is invalid";
break;
Thanks.
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
Root cause
Likely the endpoint lacked rate limiting or any other restriction on the number of requests per user or IP address.
Impact
An attacker could brute-force coupon codes and identify valid ones.
What the attacker needed
Access to the API endpoint; ability to send many requests
How it was found
- Intercept the request to the discount endpoint using a proxy tool.
- Send the request to the intruder tool.
- Configure the payload position for the coupon code.
- Start the attack to try many coupon codes.
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.
A coupon code is a short secret that gives a discount. The website let anyone try as many codes as they wanted, very quickly, without slowing them down. So a person could guess codes until they found a working one.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.