Skip to content
IDOR Disclosed report Intermediate

Any user with access to program can resume and suspend HackerOne Gateway

A GraphQL mutation for changing the Gateway VPN state looked up the target team using a scope that returned any team the user could see, rather than only teams they could manage, and the downstream interactors skipped authorisation entirely. An attacker with access to a program could therefore suspend or resume the Gateway feature for that program.

jobert Follow

Originally disclosed on HackerOne

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

An Insecure Direct Object Reference (IDOR) vulnerability is present in the UpdateGatewayProgramStateMutation that'd allow an attacker to suspend and resume the HackerOne Gateway feature for any program the user has access to. This includes any private programs that use the Gateway product and have a published External Program.

Proof of concept The following GraphQL query can used to resume / suspend the VPN:

POST /graphql? HTTP/1.1
Host: hackerone.com
...

{"query":"mutation updateState($input_0:UpdateGatewayProgramStateInput!) {updateGatewayProgramState(input:$input_0) { team { handle } } }","variables":{"input_0":{"team_id":"Z2lkOi8vaGFja2Vyb25lL1RlYW0vMTM=","vpn_suspended":false,"clientMutationId":"0"}}}

Replace the team_id (base64 encoded) with a team ID that you have access to. For most programs, this will result in a 500 internal server error being returned because the micro service handling VPN configurations can't find the program it needs to update. For programs that use the Gateway product it'll successfully update the VPN status as per the vpn_suspended boolean in the GraphQL query.

The vulnerability stems from the fact that the interactors, called by the mutation, do not implement any kind of authorization. The mutation fetches the team from the protected schema, but with a scope that is too broad. Instead of limiting it to programs the current user can manage, it'll return any team that the user can see.

app/graphql/mutations/update_gateway_program_state_mutation.rb

Ruby
# ...
def resolve(team_id:, vpn_suspended:)
  current_user = context[:current_user]
  unsafe_team = context.schema.object_from_id(team_id, context)

  safe_team = ProtectedAttribute::SchemaUtility.use_protected_schema(requester: current_user) do
    context[:tics].teams_i_can_see.find unsafe_team.id # <-- incorrectly scoped
  end

  if vpn_suspended
    Interactors::Vpn::SuspendProgram.interact team: safe_team, as_user: current_user
  else
    Interactors::Vpn::ResumeProgram.interact team: safe_team, as_user: current_user
  end

  # ...

app/backend/interactors/vpn/suspend_program.rb

Ruby
module Interactors
  module Vpn
    class SuspendProgram < HackeroneInteractor
      skip_authorization # <-- authorization check is skipped

      attribute :team, Team, required: true

      private

      def execute
        vpn_client.suspend_program(team.id)
        team.update(vpn_suspended: true)
      end

      # ...
    end
  end
end

The app/backend/interactors/vpn/resume_program.rb interactor is nearly identical to the code above and also skips the required authorization check.

A number of exceptions were triggered on production to reproduce this vulnerability:

  • ████
  • █████

Impact

A user can suspend and resume the HackerOne Gateway product for any program they have access to in the situation the program leverages the Gateway product.

The original report as published on HackerOne, by jobert. 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. 4 min read.

Context

HackerOne Gateway is a product that programs can enable so that their external program is reachable through a VPN-style gateway. The feature has a per-program state: it can be suspended or resumed. That state is changed through a GraphQL mutation called UpdateGatewayProgramStateMutation, which takes a team identifier and a vpn_suspended boolean.

The report describes an Insecure Direct Object Reference (IDOR) in that mutation. A user who has access to a program can suspend and resume the Gateway feature for that program, including private programs that use the Gateway product and have a published External Program. The mutation is supposed to act only on programs the current user can manage, but the lookup is scoped too broadly.

Setup

The report does not describe any special setup: no particular account type, role, tool or version is named. The only precondition that matters is access to at least one program, because the attack works against any team the user can see, and the interesting case is a program that actually uses the Gateway product. The proof of concept is a single authenticated GraphQL request to hackerone.com.

Finding it

The mutation changes the Gateway state, and the team lookup inside it is not limited to programs the user can manage. The mutation fetches the team from the protected schema, but with a scope that is too broad: instead of restricting the result to programs the current user can manage, it returns any team the user can see. The interactors that the mutation calls then perform the state change without any authorisation of their own.

Exploitation

Step 1: send the mutation with a chosen team ID

The following GraphQL request resumes or suspends the Gateway state for the team identified by team_id:

HTTP
POST /graphql? HTTP/1.1
Host: hackerone.com
...

{"query":"mutation updateState($input_0:UpdateGatewayProgramStateInput!) {updateGatewayProgramState(input:$input_0) { team { handle } } }","variables":{"input_0":{"team_id":"Z2lkOi8vaGFja2Vyb25lL1RlYW0vMTM=","vpn_suspended":false,"clientMutationId":"0"}}}

The team_id is a base64 encoded global identifier. The researcher's instruction is to replace it with a team ID that the attacker has access to. The vpn_suspended boolean selects the operation: false resumes the VPN, true suspends it. The query asks for the handle of the affected team.

Step 2: interpret the result

The outcome depends on the target program:

  1. For most programs, the request returns a 500 internal server error, because the micro service that handles VPN configurations cannot find the program it needs to update.
  2. For programs that use the Gateway product, the VPN status is updated successfully according to the vpn_suspended boolean in the query.

The 500 comes from the micro service handling VPN configurations failing to find the program it needs to update. When the program does use Gateway, the state change goes through.

Root cause

The mutation resolves the team through the protected schema, but the scope used for the lookup is teams_i_can_see, which is broader than the set of programs the user can manage:

Ruby
# ...
def resolve(team_id:, vpn_suspended:)
  current_user = context[:current_user]
  unsafe_team = context.schema.object_from_id(team_id, context)

  safe_team = ProtectedAttribute::SchemaUtility.use_protected_schema(requester: current_user) do
    context[:tics].teams_i_can_see.find unsafe_team.id # <-- incorrectly scoped
  end

  if vpn_suspended
    Interactors::Vpn::SuspendProgram.interact team: safe_team, as_user: current_user
  else
    Interactors::Vpn::ResumeProgram.interact team: safe_team, as_user: current_user
  end

  # ...

The interactors that perform the change explicitly skip authorisation.

Ruby
module Interactors
  module Vpn
    class SuspendProgram < HackeroneInteractor
      skip_authorization # <-- authorization check is skipped

      attribute :team, Team, required: true

      private

      def execute
        vpn_client.suspend_program(team.id)
        team.update(vpn_suspended: true)
      end

      # ...
    end
  end
end

The ResumeProgram interactor is nearly identical and also skips the required authorisation check. Because the mutation trusts a scope that includes every team the user can see, and the interactors do not re-check whether the user may manage the team, a user with visibility of a program can change its Gateway state.

Impact

A user can suspend and resume the HackerOne Gateway product for any program they have access to, provided that the program uses the Gateway product. The report does not describe any further consequence of toggling the state, such as outage duration or effect on the external program's reachability.

Fix

The code it shows points to two places that would need correcting: the mutation should scope the team lookup to programs the current user can manage rather than to every team the user can see, and the VPN interactors should not skip authorisation, so that the check is enforced where the state change happens.

Variants to test

  1. Other mutations that resolve a team by global ID. Send a mutation with a team_id for a program you can see but do not manage. A positive result is a successful state change or a response that reflects the other program's data rather than an authorisation error.
  2. Scopes named after visibility rather than permission. Look for resolvers that use a teams_i_can_see-style scope where a manage-level scope is expected. A positive result is any write operation that succeeds against a team you can only view.
  3. Interactors with skip_authorization. Trace mutations into the interactor layer and check whether the interactor skips authorisation and relies entirely on the caller's scope. A positive result is a state change that succeeds when the caller's scope is broader than the permission required.
  4. Boolean-driven state toggles. For any mutation that takes a boolean to enable or disable a feature, try both values against a team you do not manage. A positive result is a change in the target's feature state, or a downstream error that shows the request reached the service responsible for that feature.

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. 11 min read.

What happened, in plain words

HackerOne runs a bug bounty platform: companies publish programs there, and security researchers report bugs to them. One of the products a program can switch on is called HackerOne Gateway. In simple terms, it lets a program's external side be reached through a VPN-style gateway, a private tunnel rather than the open internet. Think of it as a door with a lock that can be opened or closed for each program separately.

That door has two states: suspended (closed) and resumed (open). The state is changed by sending a specific request to HackerOne's website. The request is a GraphQL mutation, which is just a named operation that changes something on the server, as opposed to a query, which only reads. The mutation is called UpdateGatewayProgramStateMutation and it takes two pieces of information: a team identifier (which program to act on) and a true/false value called vpn_suspended (whether to suspend or resume).

The bug is an Insecure Direct Object Reference, or IDOR. That term means the server accepts an identifier supplied by the user and acts on it without checking that the user is allowed to touch that particular object. A everyday comparison: a hotel receptionist who hands out any room key you ask for, as long as the room number exists, instead of checking that the room is actually booked in your name. Here the "room number" is the team identifier, and the "key" is the ability to suspend or resume Gateway.

The report says a user who has access to a program can suspend and resume the Gateway feature for that program. That includes private programs that use the Gateway product and have a published External Program. The mutation is supposed to act only on programs the current user can manage, but the lookup that finds the program is scoped too broadly: it returns any team the user can see, not only the ones they manage.

Setup

The report does not describe any special setup: no particular account type, role, tool or version is named. The only precondition that matters is access to at least one program, because the attack works against any team the user can see, and the interesting case is a program that actually uses the Gateway product. The proof of concept is a single authenticated GraphQL request to hackerone.com. "Authenticated" means the request carries whatever proves who you are, such as a session cookie or token; the report does not show that part, it only shows the request body and headers it cares about.

Finding it

The mutation changes the Gateway state, and the team lookup inside it is not limited to programs the user can manage. The mutation fetches the team from the protected schema, but with a scope that is too broad: instead of restricting the result to programs the current user can manage, it returns any team the user can see. The interactors that the mutation calls then perform the state change without any authorisation of their own. An interactor is a small piece of code that does one job, here actually talking to the VPN service; "authorisation" is the check of whether you are allowed to do something, as opposed to "authentication", which is proving who you are.

Exploitation

Step 1: send the mutation with a chosen team ID

The following GraphQL request resumes or suspends the Gateway state for the team identified by team_id:

HTTP
POST /graphql? HTTP/1.1
Host: hackerone.com
...

{"query":"mutation updateState($input_0:UpdateGatewayProgramStateInput!) {updateGatewayProgramState(input:$input_0) { team { handle } } }","variables":{"input_0":{"team_id":"Z2lkOi8vaGFja2Vyb25lL1RlYW0vMTM=","vpn_suspended":false,"clientMutationId":"0"}}}

Line by line, in plain words:

  • POST /graphql? HTTP/1.1 is the first line of an HTTP request. POST is the method used when you send data to a server to change something, /graphql? is the address on the server that accepts GraphQL operations, and HTTP/1.1 is the version of the web protocol being spoken. A protocol is simply the agreed format two computers use to talk.
  • Host: hackerone.com tells the server which website the request is for. One server can host many sites, so the request names the one it wants.
  • ... stands for the headers the report left out, such as the ones that prove who is logged in.
  • The blank line separates the headers from the body. Everything after it is the data being sent.
  • The body is JSON, a text format for structured data built from names and values in curly braces. query holds the GraphQL operation as a string, and variables holds the values that operation uses.
  • Inside query, mutation updateState($input_0:UpdateGatewayProgramStateInput!) declares an operation named updateState that takes one input called $input_0, whose type is UpdateGatewayProgramStateInput!. The exclamation mark means the value is required.
  • updateGatewayProgramState(input:$input_0) calls the mutation with that input, and { team { handle } } asks the server to return the affected team's handle, which is the program's short public name.
  • Inside variables, input_0 supplies the actual values. team_id is Z2lkOi8vaGFja2Vyb25lL1RlYW0vMTM=, a base64 encoded global identifier. Base64 is a way of writing data using only letters, digits and a few symbols so it can travel safely in text; it is encoding, not encryption, so anyone can decode it.
  • vpn_suspended is false, which means resume the VPN. Setting it to true would suspend it instead.
  • clientMutationId is "0", a label the client can use to match a response to its request. It has no security meaning here.

The team_id is a base64 encoded global identifier. The researcher's instruction is to replace it with a team ID that the attacker has access to. The vpn_suspended boolean selects the operation: false resumes the VPN, true suspends it. The query asks for the handle of the affected team.

Step 2: interpret the result

The outcome depends on the target program:

  1. For most programs, the request returns a 500 internal server error, because the micro service that handles VPN configurations cannot find the program it needs to update. A 500 is the standard HTTP status code for "something went wrong on the server". A micro service is a small, separate program that does one job behind the main website.
  2. For programs that use the Gateway product, the VPN status is updated successfully according to the vpn_suspended boolean in the query.

The 500 comes from the micro service handling VPN configurations failing to find the program it needs to update. When the program does use Gateway, the state change goes through.

Root cause

The mutation resolves the team through the protected schema, but the scope used for the lookup is teams_i_can_see, which is broader than the set of programs the user can manage:

Ruby
# ...
def resolve(team_id:, vpn_suspended:)
  current_user = context[:current_user]
  unsafe_team = context.schema.object_from_id(team_id, context)

  safe_team = ProtectedAttribute::SchemaUtility.use_protected_schema(requester: current_user) do
    context[:tics].teams_i_can_see.find unsafe_team.id # <-- incorrectly scoped
  end

  if vpn_suspended
    Interactors::Vpn::SuspendProgram.interact team: safe_team, as_user: current_user
  else
    Interactors::Vpn::ResumeProgram.interact team: safe_team, as_user: current_user
  end

  # ...

Line by line, in plain words:

  • # ... is a comment marking code the report left out.
  • def resolve(team_id:, vpn_suspended:) starts the function that handles the mutation. It receives the two values from the request: which team and whether to suspend.
  • current_user = context[:current_user] stores the logged-in user in a variable, so the code knows who is asking.
  • unsafe_team = context.schema.object_from_id(team_id, context) turns the encoded team_id back into a team object. The variable is named unsafe_team because at this point nothing has checked that the user may touch it.
  • safe_team = ProtectedAttribute::SchemaUtility.use_protected_schema(requester: current_user) do opens a block that runs the lookup under the rules for this particular user. "Protected schema" here means the data is filtered according to who is asking.
  • context[:tics].teams_i_can_see.find unsafe_team.id is the actual lookup. teams_i_can_see is a scope, a saved filter that returns every team the user can see. The comment # <-- incorrectly scoped marks the mistake: it should have been a filter for teams the user can manage.
  • if vpn_suspended branches on the true/false value from the request.
  • Interactors::Vpn::SuspendProgram.interact team: safe_team, as_user: current_user calls the suspend interactor, passing the team and the user.
  • else covers the other case.
  • Interactors::Vpn::ResumeProgram.interact team: safe_team, as_user: current_user calls the resume interactor instead.
  • end closes the branch, and the final # ... marks more code that was left out.

The interactors that perform the change explicitly skip authorisation.

Ruby
module Interactors
  module Vpn
    class SuspendProgram < HackeroneInteractor
      skip_authorization # <-- authorization check is skipped

      attribute :team, Team, required: true

      private

      def execute
        vpn_client.suspend_program(team.id)
        team.update(vpn_suspended: true)
      end

      # ...
    end
  end
end

Line by line, in plain words:

  • module Interactors and module Vpn group related code under names, like folders for code.
  • class SuspendProgram < HackeroneInteractor defines a class, a blueprint for an object, that inherits from HackeroneInteractor, a shared base class that normally provides the authorisation behaviour.
  • skip_authorization # <-- authorization check is skipped switches that behaviour off for this class. The comment marks it as the second mistake.
  • attribute :team, Team, required: true declares that the interactor needs a team, and that it must be supplied.
  • private means the methods below are internal to the class.
  • def execute starts the method that does the work.
  • vpn_client.suspend_program(team.id) asks the VPN service to suspend the program, using the team's ID.
  • team.update(vpn_suspended: true) records the new state in the database, so the platform knows the VPN is suspended.
  • end closes the method, # ... marks omitted code, and the remaining ends close the class and the two modules.

The ResumeProgram interactor is nearly identical and also skips the required authorisation check. Because the mutation trusts a scope that includes every team the user can see, and the interactors do not re-check whether the user may manage the team, a user with visibility of a program can change its Gateway state. In everyday terms: the front desk accepts any room number you name, and the person who actually turns the key in the lock never asks whether the room is yours.

Impact

A user can suspend and resume the HackerOne Gateway product for any program they have access to, provided that the program uses the Gateway product.

Fix

The code it shows points to two places that would need correcting: the mutation should scope the team lookup to programs the current user can manage rather than to every team the user can see, and the VPN interactors should not skip authorisation, so that the check is enforced where the state change happens.

Variants to test

  1. Other mutations that resolve a team by global ID. Send a mutation with a team_id for a program you can see but do not manage. A positive result is a successful state change or a response that reflects the other program's data rather than an authorisation error.
  2. Scopes named after visibility rather than permission. Look for resolvers that use a teams_i_can_see-style scope where a manage-level scope is expected. A positive result is any write operation that succeeds against a team you can only view.
  3. Interactors with skip_authorization. Trace mutations into the interactor layer and check whether the interactor skips authorisation and relies entirely on the caller's scope. A positive result is a state change that succeeds when the caller's scope is broader than the permission required.
  4. Boolean-driven state toggles. For any mutation that takes a boolean to enable or disable a feature, try both values against a team you do not manage. A positive result is a change in the target's feature state, or a downstream error that shows the request reached the service responsible for that feature.

Glossary

  • API: a defined way for one piece of software to ask another to do something, like a menu of operations with rules for each.
  • Authentication: proving who you are, for example by logging in.
  • Authorisation: checking whether the person asking is allowed to do the thing they are asking for.
  • Base64: an encoding that turns data into letters, digits and a few symbols so it can travel in text; it hides nothing and can be decoded by anyone.
  • Boolean: a value that is either true or false.
  • Class: a blueprint in code that describes an object and what it can do.
  • Cookie: a small piece of data a website stores in your browser, often used to remember that you are logged in.
  • GraphQL: a way for a client to ask a server for exactly the data it wants, using queries to read and mutations to change things.
  • Handle: a short public name for a program or account.
  • Header: a line in an HTTP request or response carrying extra information, such as the host or the login state.
  • HTTP: the protocol browsers and servers use to exchange requests and responses on the web.
  • IDOR (Insecure Direct Object Reference): a bug where the server acts on an identifier supplied by the user without checking the user is allowed to access that object.
  • Interactor: a small piece of code that performs one specific job, such as calling the VPN service.
  • JSON: a text format for structured data made of names and values.
  • Micro service: a small, separate program that handles one job behind a larger website.
  • Mutation: in GraphQL, an operation that changes data, as opposed to a query that only reads it.
  • Protected schema: a view of the data that is filtered according to who is asking.
  • Query: in GraphQL, an operation that reads data.
  • Resolver: the function that produces the result for a field or operation in GraphQL.
  • Scope: a saved filter in code that limits which records a lookup can return.
  • Session token: a value that proves you are logged in, sent with requests in place of a password.
  • Status code: a number in an HTTP response saying how the request went, such as 500 for a server error.
  • VPN: a private tunnel between two points over a public network, so traffic travels as if on a closed connection.
  • 500 internal server error: the HTTP status code meaning the server hit an unexpected problem while handling the request.

More by jobert

View all

67 more disclosed reports, 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.

Insecure direct object reference (IDOR)

The lesson behind this report.

One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.