Team object in GraphQL disclosed private_comment
An unauthenticated GraphQL query could fetch a survey rating object and read its private comment field. The attacker could see comments that were meant to be private, though other fields such as team and recipient were null in the response.
Originally disclosed on HackerOne
- Triaged in 10 hours
- Fixed in 13 hours
- Paid in 14 hours
- Disclosed after 14 hours
Summary: Hi Team, Some private(I think) part of GraphQL reveals to us
Steps To Reproduce
Without authorization
POST:
{"query":"query { node(id: \\"gid://hackerone/SurveyRatingItem/█████\\") { ... on SurveyRatingItem{_id,pentester{_id},team{_id},key,private_comment,public_comment,rating,recipient{username,email},subject{... on Report{_id}},survey_rating{_id,team{_id},state,respondent{_id,username,email,pentests{nodes{_id}}}}}}}","variables":{}}
{"data":{"node":{"_id":"████████","pentester":null,"team":null,"key":"scope","private_comment":"████","public_comment":null,"rating":1,"recipient":null,"subject":null,"survey_rating":{"_id":"█████","team":null,"state":"completed","respondent":{"_id":"████","username":"███","email":null,"pentests":{"nodes":[]}}}}}}
As we can see, the key field takes the value scope, we don't see in which program this happens, but we can see the comments of the participant, and as we can see, it has the status private
PS. Yes, we do not see some data, but in the future they may be disclosed in the comments (I think so)
Impact
disclosed private_comment
Context
HackerOne exposes a GraphQL endpoint at https://hackerone.com/graphql. GraphQL lets a client ask for a specific node by its global ID and then select fields on it through inline fragments, for example ... on SurveyRatingItem. Survey rating items are the records behind the post-report survey that a participant fills in after a report is closed: a rating, a key, a public comment and a private comment, plus links to the pentester, the team, the report and the survey itself.
The report describes a query that returns a private_comment field on a SurveyRatingItem node without authorisation. The researcher's own framing is that this is a "private(I think) part of GraphQL" that is revealed to the caller.
Setup
No account, role or tooling is described. The researcher states the request is made "Without authorization", so the precondition is simply the ability to send a POST request to the public GraphQL endpoint. No version numbers, headers or authentication state are given in the report.
Finding it
The researcher sent a query for a SurveyRatingItem node by its global ID and selected the private_comment field. The researcher framed the field as a private part of GraphQL that was revealed to the caller.
Exploitation
Step 1: query the node without authorisation
A single POST is sent to the GraphQL endpoint:
with the following body:
{"query":"query { node(id: \"gid://hackerone/SurveyRatingItem/█████\") { ... on SurveyRatingItem{_id,pentester{_id},team{_id},key,private_comment,public_comment,rating,recipient{username,email},subject{... on Report{_id}},survey_rating{_id,team{_id},state,respondent{_id,username,email,pentests{nodes{_id}}}}}}}","variables":{}}
The query uses the node(id: ...) root field with a global ID of the form gid://hackerone/SurveyRatingItem/<id>. The inline fragment ... on SurveyRatingItem selects the fields of interest: _id, the linked pentester and team IDs, key, private_comment, public_comment, rating, the recipient username and email, the subject as a Report ID, and the parent survey_rating with its _id, team, state and respondent details, including the respondent's pentests nodes.
Step 2: read the response
The server returned the node with the private comment populated:
{"data":{"node":{"_id":"████████","pentester":null,"team":null,"key":"scope","private_comment":"████","public_comment":null,"rating":1,"recipient":null,"subject":null,"survey_rating":{"_id":"█████","team":null,"state":"completed","respondent":{"_id":"████","username":"███","email":null,"pentests":{"nodes":[]}}}}}}
The important part is "private_comment":"████": the field is returned with content even though the request carried no authorisation. The key field has the value scope. The parent survey_rating has state set to completed, and the respondent object is present with a username.
Several fields came back null: pentester, team, recipient and subject are all null, and the respondent's email is null with an empty pentests list. The researcher notes this explicitly: the program the item belongs to is not visible from this response. What is visible is the participant's comment, and the researcher reads it as private because of the field name and because it is not the public_comment (which is null here).
The researcher adds a caveat: some data is not shown in this response, but in future it may be disclosed in the comments themselves.
Root cause
The report does not describe the server-side implementation, so the cause can only be inferred. The report does not describe the cause.
Impact
The impact stated in the report is disclosure of private_comment. In the response shown, the comment content, the key value (scope), the rating, the survey state and the respondent's username were exposed to an unauthenticated caller. The team, pentester, recipient and subject were null in this instance, so the report does not demonstrate linking the comment to a specific program or report. The researcher's own hedge is that other data may appear in comments in future. The severity recorded for the report is medium (CVSS 5.0), weakness Information Disclosure, with a bounty of 2500.00 USD.
Fix
Based on the finding, the fix would be to enforce authorisation on SurveyRatingItem and on its private_comment field, so that only the parties entitled to the survey (for example the respondent and the team the survey belongs to) can read it, and to make sure the generic node lookup applies the same checks as any other path to the type.
Variants to test
- Enumerate other types reachable through
node(id: ...)and request fields whose names suggest privacy (private_*,internal_*,admin_*, email, token). A positive result is a populated field in a response to an unauthenticated request. - Query the same node through other root fields or nested paths (for example through the parent
survey_ratingor through the respondent) and compare which fields are filtered on each path. A positive result is a field that is null or absent on one path but populated on another. - Request the linked objects (
team,pentester,subject,recipient) on nodes where they are populated, to see whether the private comment can be tied to a specific program or report. A positive result is a non-null team or report ID alongside the private comment. - Try the same query with different global IDs of the same type to see whether access depends on the caller's relationship to the survey. A positive result is a comment returned for a survey the caller has no part in.
Hunting notes
GraphQL schemas are a good place to look for this pattern: a type that exists for internal or post-transaction workflows, exposed through the generic node field, with fields whose names mark them as private. During recon, introspection or schema dumps that list such types and fields are the signal; the next step is to find a global ID for the type and send an unauthenticated query for the sensitive fields.
What happened, in plain words
HackerOne is a website where security researchers report bugs to companies and get paid for them. After a report is closed, the researcher who sent it is asked to fill in a short survey: how good was the interaction, was the scope clear, and so on. That survey has a rating, a public comment and a private comment. The private comment is meant to stay private.
This report shows that a private comment could be read without logging in. The researcher sent a single request to a part of HackerOne's website that answers questions in a machine-friendly format, and the answer included the text of a private comment.
To follow along you only need to understand a few ideas:
- API: a way for one computer program to talk to another. Think of a restaurant: the menu is the API, you order from it, and the kitchen sends back a dish. You do not walk into the kitchen yourself.
- GraphQL: a particular style of API where the client sends a description of exactly the data it wants, and the server sends back exactly that shape. Instead of many fixed addresses (one for users, one for reports), there is usually one address, and the request body says what to fetch.
- Endpoint: the address you send the request to. Here it is
https://hackerone.com/graphql. - Node: in GraphQL, a single record, such as one survey answer. Each node has a global ID, a long identifier that looks like a web address starting with
gid://. - Field: one piece of data inside a record, such as a rating or a comment.
- Query: the request text that says which node and which fields you want.
- Unauthenticated / without authorisation: sent without logging in, without a session cookie or token that proves who you are. A cookie is a small piece of data your browser stores after you log in and sends back with each request; a token is a similar proof of identity. This request carried neither.
- Information disclosure: a vulnerability class where data that should be secret is shown to someone who should not see it. Nothing is changed or broken; the problem is that the data leaks.
Context
HackerOne exposes a GraphQL endpoint at https://hackerone.com/graphql. GraphQL lets a client ask for a specific node by its global ID and then select fields on it through inline fragments, for example ... on SurveyRatingItem. An inline fragment is a way of saying "if this record is of this type, give me these fields". Survey rating items are the records behind the post-report survey that a participant fills in after a report is closed: a rating, a key, a public comment and a private comment, plus links to the pentester, the team, the report and the survey itself.
The report describes a query that returns a private_comment field on a SurveyRatingItem node without authorisation. The researcher's own framing is that this is a "private(I think) part of GraphQL" that is revealed to the caller.
Setup
No account, role or tooling is described. The researcher states the request is made "Without authorization", so the precondition is simply the ability to send a POST request to the public GraphQL endpoint. A POST request is the kind of request a browser sends when you submit a form; here it carries the query text instead of form fields. No version numbers, headers or authentication state are given in the report.
Finding it
The researcher sent a query for a SurveyRatingItem node by its global ID and selected the private_comment field. A schema is the list of all record types and fields the API offers, like the full menu of the restaurant. The researcher framed the field as a private part of GraphQL that was revealed to the caller.
Exploitation
Step 1: query the node without authorisation
A single POST is sent to the GraphQL endpoint:
This line says where the request goes and which method it uses. POST is used because the query is sent in the body of the request, not in the address.
with the following body:
{"query":"query { node(id: \"gid://hackerone/SurveyRatingItem/█████\") { ... on SurveyRatingItem{_id,pentester{_id},team{_id},key,private_comment,public_comment,rating,recipient{username,email},subject{... on Report{_id}},survey_rating{_id,team{_id},state,respondent{_id,username,email,pentests{nodes{_id}}}}}}}","variables":{}}
Line by line, in plain words:
{"query":"...","variables":{}}is the outer envelope.queryholds the GraphQL text, andvariablesis an empty list of placeholders (none are used here).query { node(id: ...) { ... } }asks for one record by its global ID. Thenodefield is a general lookup: you give an ID, you get the record back.gid://hackerone/SurveyRatingItem/█████is the global ID of one survey rating item. The part after the last slash identifies which one.... on SurveyRatingItem{ ... }is the inline fragment: "if this record is a survey rating item, return these fields"._idis the record's own identifier.pentester{_id}andteam{_id}ask for the linked researcher and the linked company team, by ID only.keyis a field on the rating item.private_commentis the field the researcher suspected should be hidden.public_commentis the counterpart that is meant to be visible.ratingis the numeric score.recipient{username,email}asks for the person who received the survey, with their username and email address.subject{... on Report{_id}}asks for the thing being rated, and if it is a report, only its ID.survey_rating{...}asks for the parent survey: its_id, itsteam, itsstate(for example whether it is completed), and itsrespondent(the person who answered), including that person's_id,username,emailand theirpentests(the list of tests they took part in, each with an_id).
The point of asking for all of this at once is to see how much of the surrounding record comes back alongside the private comment, and whether the answer links the comment to a specific company or report.
Step 2: read the response
The server returned the node with the private comment populated:
{"data":{"node":{"_id":"████████","pentester":null,"team":null,"key":"scope","private_comment":"████","public_comment":null,"rating":1,"recipient":null,"subject":null,"survey_rating":{"_id":"█████","team":null,"state":"completed","respondent":{"_id":"████","username":"███","email":null,"pentests":{"nodes":[]}}}}}}
Line by line:
"data"means the request succeeded;"node"is the record that was asked for."_id":"████████"is the record's identifier."pentester":null,"team":null,"recipient":nulland"subject":nullmean those links came back empty.nullis the computer word for "nothing here"."key":"scope"is the value of the key field."private_comment":"████"is the important part: the field is returned with content even though the request carried no authorisation."public_comment":nullshows the public comment was empty, so the text that came back is not the public one."rating":1is the score given."survey_rating"is the parent survey:"state":"completed"says it was finished, and"respondent"is the person who answered, with a"username"but anullemail and an empty"pentests"list ("nodes":[]means no entries).
Several fields came back null: pentester, team, recipient and subject are all null, and the respondent's email is null with an empty pentests list. The researcher notes this explicitly: the program the item belongs to is not visible from this response. What is visible is the participant's comment, and the researcher reads it as private because of the field name and because it is not the public_comment (which is null here).
The researcher adds a caveat: some data is not shown in this response, but in future it may be disclosed in the comments themselves. The researcher notes that other data may be disclosed in comments in future.
Root cause
The report does not describe the server-side implementation, so the cause can only be inferred. The report does not describe the cause. A resolver is the small piece of server code that fetches one field when it is asked for.
Impact
The impact stated in the report is disclosure of private_comment. In the response shown, the comment content, the key value (scope), the rating, the survey state and the respondent's username were exposed to an unauthenticated caller. The team, pentester, recipient and subject were null in this instance, so the report does not demonstrate linking the comment to a specific program or report. The researcher's own hedge is that other data may appear in comments in future. The severity recorded for the report is medium (CVSS 5.0), weakness Information Disclosure, with a bounty of 2500.00 USD. CVSS is a standard scoring system for how serious a vulnerability is; medium is the middle band.
Fix
Based on the finding, the fix would be to enforce authorisation on SurveyRatingItem and on its private_comment field, so that only the parties entitled to the survey (for example the respondent and the team the survey belongs to) can read it, and to make sure the generic node lookup applies the same checks as any other path to the type.
Variants to test
- Enumerate other types reachable through
node(id: ...)and request fields whose names suggest privacy (private_*,internal_*,admin_*, email, token). A positive result is a populated field in a response to an unauthenticated request. - Query the same node through other root fields or nested paths (for example through the parent
survey_ratingor through the respondent) and compare which fields are filtered on each path. A positive result is a field that is null or absent on one path but populated on another. - Request the linked objects (
team,pentester,subject,recipient) on nodes where they are populated, to see whether the private comment can be tied to a specific program or report. A positive result is a non-null team or report ID alongside the private comment. - Try the same query with different global IDs of the same type to see whether access depends on the caller's relationship to the survey. A positive result is a comment returned for a survey the caller has no part in.
Hunting notes
GraphQL schemas are a good place to look for this pattern: a type that exists for internal or post-transaction workflows, exposed through the generic node field, with fields whose names mark them as private. During recon, introspection or schema dumps that list such types and fields are the signal; the next step is to find a global ID for the type and send an unauthenticated query for the sensitive fields. Introspection is GraphQL's built-in way of asking the server to describe its own schema, and a schema dump is that description saved to a file.
Glossary
- API: a way for one program to ask another for data or actions, like ordering from a menu rather than entering the kitchen.
- GraphQL: an API style where the request describes exactly which records and fields are wanted, and the server answers in that shape.
- Endpoint: the address a request is sent to, here
https://hackerone.com/graphql. - POST request: a request that carries data in its body, commonly used to submit forms or queries.
- Node: a single record in GraphQL, identified by a global ID.
- Global ID: a long identifier for a record, here in the form
gid://hackerone/SurveyRatingItem/<id>. - Query: the text that says which node and fields to return.
- Inline fragment: a GraphQL construct that applies fields only when the record is of a given type, written
... on TypeName. - Schema: the full list of record types and fields an API offers.
- Resolver: the server code that fetches the value of one field when it is requested.
- Unauthenticated / without authorisation: sent without logging in and without any cookie or token proving identity.
- Cookie / token: small pieces of data that prove who you are after logging in and are sent with each request.
- Information disclosure: a vulnerability where data that should be secret is shown to someone who should not see it.
- null: the value meaning "nothing here" or "not returned".
- CVSS: a standard scoring system for the severity of a vulnerability; medium is the middle band.
- Introspection / schema dump: GraphQL's built-in way to ask the server to describe its schema, and that description saved to a file.
- Recon: the early phase of looking around a target to learn what it exposes.