Response program can display "eligible for bounty" in scope area in program policy
When a program switched from a HackerOne bounty programme to a response programme, assets that had been marked as eligible for bounty kept showing that label on the public policy page. This could mislead researchers into thinking a response programme paid bounties.
- Triaged in 4 days
- Fixed in 21 days
- Paid in 11 days
- Disclosed after 22 days
Hello Hackerone Team and @jobert
First of all, Happy new year to everyone.
#Summary
Response program can also display "eligible for bounty" assets on program policy.
It's basically causing from backend in terms of GRAPHQL mutation query for eligible in bounty:true which stays forever on response program switch from h1 bounty program.
#Step to Reproduce
-
In setup endpoint, select h1 bounty, create a scope with "eligible for bounty".
-
In program main policy, it's going to display asset with "eligible for bounty".
-
Now, again go to setup endpoint and this time, select hackerone response program.
-
Now, visit again the policy page in h1 response program, you will see that eligible for bounty in assets is still displaying.
#POC video
#Graphql Request
Graphql request in terms of scope adding on h1 bounty is
{"query":"mutation Create_structured_scope_mutation($input_0:CreateStructuredScopeInput!,$first_1:Int!,$types_2:[ErrorTypeEnum]!) {createStructuredScope(input:$input_0) {clientMutationId,...F1,...F2}} fragment F0 on Team {handle,id} fragment F1 on CreateStructuredScopePayload {team {_structured_scopes3wXgTb:structured_scopes(first:$first_1) {edges {node {id,_id,asset_type,asset_identifier,eligible_for_submission,eligible_for_bounty,max_severity,archived_at,instruction,reference,team {id,handle}},cursor},pageInfo {hasNextPage,hasPreviousPage}},id,...F0}} fragment F2 on CreateStructuredScopePayload {was_successful,_errors2S3JlH:errors(types:$types_2) {edges {node {type,field,message,id},cursor},pageInfo {hasNextPage,hasPreviousPage}}}","variables":{"input_0":{"team_id":"Z2lkOi8vaGFja2Vyb25lL1RlYW0vMzYxNzE=","asset_type":"URL","asset_identifier":"google.com","eligible_for_bounty":true,"eligible_for_submission":true,"instruction":"","reference":"","clientMutationId":"0"},"first_1":250,"types_2":"ARGUMENT"}}
where eligible for bounty: true remains permanent from backend even if we switch from h1 bounty program to response program.
Adding an additional automatic restriction for eligible for bounty for response program will solve the problem from the backend.
Thanks Kunal
Impact
- Displaying eligible for bounty in assets in response program policy page and trick users.
Context
HackerOne programs have a scope area, and each scope entry carries two separate flags: whether the asset is eligible for submission and whether it is eligible for bounty. The program policy page renders these flags to researchers, so a scope entry marked "eligible for bounty" tells a reader that reports against that asset can earn a reward.
HackerOne also runs response programs, which are a different kind of program from a bounty program. The report shows that the scope flags set while a program was a bounty program were not cleared when the program was switched to a response program, so the policy page of the response program kept advertising assets as eligible for bounty.
The report was filed against hackerone.com, rated low severity with a CVSS score of 2.9, classified as a business logic error, and paid a bounty of 500.00 USD. It was disclosed on 2019-01-30.
Setup
No special accounts, roles or tools are described beyond access to the program setup endpoint and the program policy page. The precondition is a program that can be switched between an H1 bounty program and a HackerOne response program, with at least one scope entry created while it was a bounty program.
Finding it
The researcher observed that a response program can display assets marked "eligible for bounty" on its program policy. The behaviour was traced to the backend, specifically to the GraphQL mutation used to create a structured scope, where the value eligible_for_bounty: true persists after the program is switched from an H1 bounty program to a response program.
Exploitation
Step 1: create a bounty scope
In the setup endpoint, select the H1 bounty program type and create a scope entry with "eligible for bounty" enabled. The program policy then displays that asset as eligible for bounty.
Step 2: switch to a response program
Return to the setup endpoint and select the HackerOne response program type instead.
Step 3: revisit the policy page
Visit the policy page of the H1 response program again. The asset still shows as eligible for bounty.
The proof-of-concept video is hackerone.mp4.
The GraphQL request
The scope creation on the H1 bounty program is performed with the following GraphQL request:
{"query":"mutation Create_structured_scope_mutation($input_0:CreateStructuredScopeInput!,$first_1:Int!,$types_2:[ErrorTypeEnum]!) {createStructuredScope(input:$input_0) {clientMutationId,...F1,...F2}} fragment F0 on Team {handle,id} fragment F1 on CreateStructuredScopePayload {team {_structured_scopes3wXgTb:structured_scopes(first:$first_1) {edges {node {id,_id,asset_type,asset_identifier,eligible_for_submission,eligible_for_bounty,max_severity,archived_at,instruction,reference,team {id,handle}},cursor},pageInfo {hasNextPage,hasPreviousPage}},id,...F0}} fragment F2 on CreateStructuredScopePayload {was_successful,_errors2S3JlH:errors(types:$types_2) {edges {node {type,field,message,id},cursor},pageInfo {hasNextPage,hasPreviousPage}}}","variables":{"input_0":{"team_id":"[redacted]=","asset_type":"URL","asset_identifier":"google.com","eligible_for_bounty":true,"eligible_for_submission":true,"instruction":"","reference":"","clientMutationId":"0"},"first_1":250,"types_2":"ARGUMENT"}}
The mutation is createStructuredScope, taking a CreateStructuredScopeInput object. The input carries the team identifier, the asset type (URL), the asset identifier, and the two eligibility flags, with eligible_for_bounty set to true and eligible_for_submission set to true. The selection set returns the team's structured scopes with fields including eligible_for_submission, eligible_for_bounty, max_severity and archived_at, plus the success flag and any errors. The value eligible_for_bounty: true is what remains stored in the backend after the program is switched from an H1 bounty program to a response program.
Root cause
The eligibility flag is stored on the structured scope and is not reset when the program type changes. The researcher attributes this to the backend handling of the GraphQL mutation: the eligible_for_bounty value set at scope creation stays in place permanently, regardless of the program type the scope now belongs to. Nothing in the report indicates that the policy page or the mutation checks the current program type against the stored flag.
Impact
A response program's policy page can show assets as eligible for bounty, which can trick users into believing a reward is available for reports against those assets. The report frames the impact around that misleading display on the response program policy page.
Fix
The researcher's recommendation is to add an automatic restriction on eligible_for_bounty for response programs, which would solve the problem from the backend. The report does not describe a fix that was applied.
Variants to test
- Switch a program between other program types and check whether scope flags such as bounty eligibility or submission eligibility survive the change. A positive result is the old flag still rendered on the policy page of the new program type.
- Create a scope with bounty eligibility, then change the program type, then edit the scope. A positive result is the flag persisting through the edit or being re-applied without an explicit choice.
- Query the structured scopes of a program after a type change and inspect
eligible_for_bountydirectly. A positive result istrueon a program type where bounty eligibility should not apply.
Hunting notes
This kind of bug lives in state that outlives the context it was created in: flags, roles and settings attached to an object that is later moved to a different parent or type. During recon, look for features where an object can change type or owner, and compare what the UI shows after the change with what the object's fields actually hold. The researcher demonstrated impact by showing the misleading label on the response program's policy page, which is what a researcher reading the program would see and act on.
What happened, in plain words
HackerOne is a website where companies (called "programs") invite security researchers to look for problems in their systems and report them. Each program has a page called the policy page, which is the public description of the rules: what is in scope (which websites, apps or addresses a researcher is allowed to test) and what a researcher can expect if they find something.
A scope entry is one line on that list, for example a website address. Each scope entry carries two separate yes/no switches:
- eligible for submission: reports about this asset are accepted.
- eligible for bounty: reports about this asset can earn money (a bounty).
HackerOne also runs a different kind of program called a response program. The report does not explain what a response program is beyond that it is a different program type from a bounty program. The important point is that a response program is not a bounty program, so showing "eligible for bounty" on its policy page is misleading.
The researcher found that when a program is switched from a bounty program to a response program, the "eligible for bounty" switch set earlier is not cleared. The response program's policy page keeps advertising assets as eligible for bounty. The researcher traced this to the backend, specifically to the GraphQL request used to create a scope entry, where the value eligible_for_bounty: true stays stored permanently.
The report was filed against hackerone.com, rated low severity with a CVSS score of 2.9, classified as a business logic error, and paid a bounty of 500.00 USD. It was disclosed on 2019-01-30.
Background you need first
What an API is
An API (application programming interface) is the set of doors a website's own pages use to talk to its servers. When you click a button on a web page, your browser usually does not load a whole new page: it sends a small request to the server, the server answers with data, and the page updates. A useful everyday comparison is a restaurant: the menu and the waiter are the API, the kitchen is the server. You do not walk into the kitchen yourself; you order through the waiter, and the waiter brings back a plate.
What GraphQL is
GraphQL is a way of designing such an API. Instead of many separate addresses (endpoints) for different things, there is usually one address, and the client sends a text describing exactly what it wants. That text is called a query when it only reads data and a mutation when it changes data. The server answers with JSON, a text format made of curly brackets, quotes and colons that both computers and people can read.
A GraphQL request has two main parts:
query: the text describing the operation and which fields to return.variables: the actual values, kept separate so the query text can be reused.
What a token or identifier is
Many systems do not use simple numbers like 123 to refer to objects. They use a long scrambled string called an identifier (often a base64-encoded global ID). It works like a coat check ticket: the number on the ticket means nothing to you, but the cloakroom can look it up and hand back the right coat. In the request below, team_id is such an identifier for a team (a program).
What "business logic error" means
A business logic error is not a broken lock or a crashed server. The software does exactly what it was programmed to do; the mistake is in the rules themselves. A comparison: a shop's till correctly gives a 10 percent discount on a 100 pound item, but the rule forgot to say the discount applies only once, so a customer can use it ten times. Nothing is hacked; the rule is simply wrong or incomplete. Here, the rule forgot to clear a flag when a program changes type.
What the product and feature do
The feature involved is the program setup endpoint, the page where a program owner configures their program: its type, its scope entries and their switches. The other feature is the program policy page, the page a researcher reads to decide whether to take part. The bug is that the second page shows information that no longer matches the program type chosen in the first page.
Setup
No special accounts, roles or tools are described beyond access to the program setup endpoint and the program policy page. The precondition is a program that can be switched between an H1 bounty program and a HackerOne response program, with at least one scope entry created while it was a bounty program.
Finding it
The researcher observed that a response program can display assets marked "eligible for bounty" on its program policy. The behaviour was traced to the backend, specifically to the GraphQL mutation used to create a structured scope, where the value eligible_for_bounty: true persists after the program is switched from an H1 bounty program to a response program.
Exploitation
Step 1: create a bounty scope
In the setup endpoint, select the H1 bounty program type and create a scope entry with "eligible for bounty" enabled. The program policy then displays that asset as eligible for bounty.
Step 2: switch to a response program
Return to the setup endpoint and select the HackerOne response program type instead.
Step 3: revisit the policy page
Visit the policy page of the H1 response program again. The asset still shows as eligible for bounty.
The proof-of-concept video is hackerone.mp4.
The GraphQL request
The scope creation on the H1 bounty program is performed with the following GraphQL request:
{"query":"mutation Create_structured_scope_mutation($input_0:CreateStructuredScopeInput!,$first_1:Int!,$types_2:[ErrorTypeEnum]!) {createStructuredScope(input:$input_0) {clientMutationId,...F1,...F2}} fragment F0 on Team {handle,id} fragment F1 on CreateStructuredScopePayload {team {_structured_scopes3wXgTb:structured_scopes(first:$first_1) {edges {node {id,_id,asset_type,asset_identifier,eligible_for_submission,eligible_for_bounty,max_severity,archived_at,instruction,reference,team {id,handle}},cursor},pageInfo {hasNextPage,hasPreviousPage}},id,...F0}} fragment F2 on CreateStructuredScopePayload {was_successful,_errors2S3JlH:errors(types:$types_2) {edges {node {type,field,message,id},cursor},pageInfo {hasNextPage,hasPreviousPage}}}","variables":{"input_0":{"team_id":"[redacted]=","asset_type":"URL","asset_identifier":"google.com","eligible_for_bounty":true,"eligible_for_submission":true,"instruction":"","reference":"","clientMutationId":"0"},"first_1":250,"types_2":"ARGUMENT"}}
Line by line, in plain words:
"query"holds the GraphQL text. It starts withmutation Create_structured_scope_mutation(...), which names the operation and declares three inputs it needs:$input_0of typeCreateStructuredScopeInput,$first_1of typeInt(a whole number) and$types_2of type[ErrorTypeEnum](a list of error type names). The exclamation marks mean "required".createStructuredScope(input:$input_0)is the actual action: create a scope entry using the input object. This is the mutation that writes the data.clientMutationId,...F1,...F2says which pieces of the answer to return.F1andF2are named blocks defined later in the same text, called fragments. A fragment is a reusable list of fields, like a saved shopping list you attach to several orders instead of rewriting it each time.fragment F0 on Team {handle,id}describes fields of a team: its handle (its short public name) and its id.fragment F1 on CreateStructuredScopePayloaddescribes what to return after creating the scope: the team, and inside it the team's structured scopes, limited to the first$first_1of them. For each scope it asks forid,_id,asset_type,asset_identifier,eligible_for_submission,eligible_for_bounty,max_severity,archived_at,instruction,referenceand the team'sidandhandle, plus acursor(a bookmark used for paging). It also asks forpageInfowithhasNextPageandhasPreviousPage, which tell the client whether more pages of results exist.fragment F2 on CreateStructuredScopePayloadasks forwas_successful(did it work) anderrors, filtered by the error types in$types_2, each withtype,field,messageandid, plus paging information."variables"supplies the real values.team_idis the scrambled identifier of the team.asset_typeisURL, meaning the scope entry is a web address.asset_identifieris the address itself.eligible_for_bountyistrueandeligible_for_submissionistrue: these are the two switches from the policy page.instructionandreferenceare empty text fields.clientMutationIdis a label the client uses to match a response to its request.first_1is250, the page size for the scope list.types_2isARGUMENT, the error type to filter on.
The mutation is createStructuredScope, taking a CreateStructuredScopeInput object. The input carries the team identifier, the asset type (URL), the asset identifier, and the two eligibility flags, with eligible_for_bounty set to true and eligible_for_submission set to true. The selection set returns the team's structured scopes with fields including eligible_for_submission, eligible_for_bounty, max_severity and archived_at, plus the success flag and any errors. The value eligible_for_bounty: true is what remains stored in the backend after the program is switched from an H1 bounty program to a response program.
Root cause
The eligibility flag is stored on the structured scope and is not reset when the program type changes. The researcher attributes this to the backend handling of the GraphQL mutation: the eligible_for_bounty value set at scope creation stays in place permanently, regardless of the program type the scope now belongs to. Nothing in the report indicates that the policy page or the mutation checks the current program type against the stored flag.
A comparison: a hotel room key card is programmed for the room you booked. If you move to a cheaper room and the card is never reprogrammed, it still opens the old, more expensive room. The card is not broken; nobody updated it when the booking changed.
Impact
A response program's policy page can show assets as eligible for bounty, which can trick users into believing a reward is available for reports against those assets. The report frames the impact around that misleading display on the response program policy page.
Fix
The researcher's recommendation is to add an automatic restriction on eligible_for_bounty for response programs, which would solve the problem from the backend. The report does not describe a fix that was applied.
Variants to test
- Switch a program between other program types and check whether scope flags such as bounty eligibility or submission eligibility survive the change. A positive result is the old flag still rendered on the policy page of the new program type.
- Create a scope with bounty eligibility, then change the program type, then edit the scope. A positive result is the flag persisting through the edit or being re-applied without an explicit choice.
- Query the structured scopes of a program after a type change and inspect
eligible_for_bountydirectly. A positive result istrueon a program type where bounty eligibility should not apply.
Hunting notes
This kind of bug lives in state that outlives the context it was created in: flags, roles and settings attached to an object that is later moved to a different parent or type. During recon, look for features where an object can change type or owner, and compare what the UI shows after the change with what the object's fields actually hold. The researcher demonstrated impact by showing the misleading label on the response program's policy page, which is what a researcher reading the program would see and act on.
Glossary
- API: the set of requests a website's pages use to talk to its servers, like a waiter carrying orders to a kitchen.
- Backend: the server-side part of a system that stores data and applies rules, as opposed to what you see in the browser.
- Bounty: a money reward paid for a valid security report.
- Business logic error: a flaw in the rules the software follows, where the code works as written but the rule itself is wrong or incomplete.
- CVSS score: a standard number from 0 to 10 expressing how severe a vulnerability is.
- Endpoint: a specific address or action on a server that accepts requests.
- Flag: a yes/no setting stored for an object, here whether an asset is eligible for submission or for bounty.
- Fragment: a reusable list of fields in a GraphQL request, attached to several parts of the query instead of being rewritten.
- GraphQL: an API style where the client sends a text describing exactly which data it wants, and the server answers with JSON.
- Identifier (ID): a value that uniquely refers to an object; often a long scrambled string rather than a simple number.
- JSON: a text format made of curly brackets, quotes and colons for exchanging data.
- Mutation: a GraphQL operation that changes data, as opposed to a query that only reads it.
- Policy page: the public page of a program describing its rules and which assets are in scope.
- Program: a company's presence on HackerOne, with its own rules, scope and rewards.
- Query: a GraphQL operation that only reads data.
- Scope entry: one item on a program's list of assets that may be tested, with its own eligibility switches.
- Severity: a rating of how serious a vulnerability is, here low.
- Structured scope: the stored record of a scope entry, including its asset type, asset identifier and eligibility flags.
- Variable: in GraphQL, a named value supplied separately from the query text so the text can be reused.