Skip to content
Info disclosure Disclosed report Advanced

Partial report contents leakage - via HTTP/2 concurrent stream handling

The concurrent handling of HTTP/2 streams allows a cross-site search attack that uses response ordering instead of timing to determine whether a query returns results. An attacker could use this to reveal information about undisclosed bug reports, such as vulnerable endpoints or redacted secrets.

tomvg Follow

Originally disclosed on HackerOne

Bounty$2,500 Medium 6.6 View original
  • Triaged in 10 days
  • Fixed in 9 months
  • Paid in 9 months
  • Disclosed after 2.5 years

Summary:

The concurrent handling of HTTP/2 streams allows for a "timeless timing attack": instead of timing, the ordering of responses is used, making the attack resilient to network jitter. As the /bugs.json endpoint takes slightly longer to process when a query returns results, it is possible to reliably determine whether this query had one or more results. This can then be used to reveal information about (un)disclosed bug reports in a cross-site search attack, among other things, finding vulnerable endpoints.

Description:

A timing attack against /bugs.json was reported in #350432 and #350432 (and possibly #4701 - though this one isn't public, so I don't know the details). These prior reports aimed to determine the response size, and from that infer the number of results returned for a particular query. For the two public reports, the timing measurements were not reliably enough for an attack. I tried to replicate and improve these attacks (with the timing techniques we used for HEIST), and found that indeed noy reliable results could be obtained, presumably due to relatively high (network) jitter. The "timing" attack in this report works quite differently, and in fact it is not really a timing attack in the sense that it doesn't use timing information (which is what makes it a lot more resilient against jitter). Furthermore, it does not attempt to determine the response size, but rather the server processing time.

The concept of the attack is pretty straightforward: the attacker triggers 2 simultaneous requests with fetch(), one to a baseline query that returns no results (e.g. /bugs.json?text_query=NO_RESULT_WILL_BE_FOUND), and one for a query for something the attacker is interested in (e.g. /bugs.json?text_query=/bugs.json%20timing). As hackerone.com is using HTTP/2, the two requests will be sent over the same TCP connection, in two TCP packets following right after each other (this makes that they will arrive at almost exactly the same time at the server, since any jitter experienced by the first packet will also be experienced by the second). As the two HTTP/2 streams are concurrent, they will be processed in parallel on the server. As there is a difference in processing time, even when this is minimal (against my own server, I found that an execution time difference of 1-5 µsec is measurable from the browser), one request will generate a response faster than the other. The server will send these responses as soon as they are ready. As soon as the client receives the headers of a response, it will resolve the Promise returned by the fetch() call. This allows the attacker to determine which response was generated first (and this which took the least/most execution time).

If the target query does not contain any results, the execution time will be the same as the baseline, and the probability that the response is in the same order as the requests were sent, is approximately 50%. In case the target query does yield results, the probability that the response for the target query comes in last, is higher (because the server needed some additional time to process). Because this attack is still subjective to jitter in processing time (typically one or more magnitudes smaller than the network jitter experienced in typical timing attacks), the attacker would have to collect a number of measurements and count the response ordering for them. In my tests, I found that 20 request-pairs suffice to provide a reliable result. In fact, for all the tests I've run, all attacks were successful, even when I tried to run it from the airport WiFi.

Ironically, the only time that the attack was not working, was when the baseline query erroneously returned results. I belief this is probably a bug in HackerOne caused by some sort of race condition (at the time of testing, I was sending quite a lot of requests in parallel until I noticed there's in fact some rate limiting in effect). It might be worth to explore this further; may be just a bug, or may somehow be exploitable. It's hard for me to replicate though... If it's easier for you to track this, I can open a separate report, though I haven't been able to show any security impact for this bug.

PoC||GTFO

I implemented a basic proof-of-concept, hosted here. To use it, just change the text_query parameter to something that would have at least one result. Next, simply click start and wait 6-7 seconds. If you find that the value (or values, if you select multiple iterations) of numCorrectBaseline is lower than those of numCorrectTarget, it means that the attack was successful (as the response for the target URL was slower). These are the results I obtained for 10 iterations, on my home WiFi connection:

JSON
{
    "numCorrectBaseline": [11, 10, 9, 8, 6, 9, 10, 6, 10, 11],
    "numCorrectTarget": [15, 18, 14, 16, 15, 16, 14, 13, 16, 20]
}

From this it seems clear that the attack is quite robust (would be neat if you could replicate this!).

It appears that /bugs/count/ (and possibly some other endpoint that I haven't tested) might also be affected by these issues, though the /bugs/count/ endpoint seems slightly less robust (I assume since it has to retrieve less information from the database).

Mitigation

I assume that you are well aware on how to mitigate these types of vulnerabilities. But adding it just for the sake of completeness...

  1. CSRF token: I noticed that on /bugs, the request for /bugs.json would already include the x-csrf-token header. However, its value is not validate. Such a CSRF token would mitigate the vulnerability
  2. In #350432 it was mentioned that this endpoint would be deprecated (and removed?), and replaced with GraphQL requiring a token to query the information; of course this would also work (and hopefully this report might expedite the process)
  3. SameSite cookies: if the __Host-session cookie was served with e.g. SameSite=lax, this attack would not be possible.

Optional: Your Environment (Browser version, Device, etc)

  • Tested on my Macbook Pro, both in Chrome and Firefox (up-to-date version), in a variety of network conditions (ethernet, WiFi, crappy WiFi)

Optional: Supporting Material/References (Screenshots)

  • I've included a screenshot of 5 iterations run over the airport WiFi.

Optional: Did you use recon data made available by HackerOne to find this vulnerability?

no

Impact

This vulnerability basically provides the attacker with search capabilities in the victim's reported bugs. The attacker could abuse this to discover vulnerable endpoints or other sensitive data. For instance, the attacker could start with a query for https://hackerone.com/, determine that the victim reported a vulnerability there, then cycle through all endpoints, https://hackerone.com/activities, https://hackerone.com/apps, ... and find which one was probably vulnerable (the vulnerable endpoint will likely be present in the report). Knowing the endpoint, the attacker could further refine the type of vulnerability by using several keywords, perhaps find the query parameters etc. Since the text search matches any substring (and not just on word-boundaries), the attacker could also brute-force certain secrets, e.g. when they were redacted in a public report.

I hope that the basic PoC I made shows that this type of attack would indeed be feasible, otherwise, I can try to create a more extensive version.

Attachments

screenshot-attack-from-airport-wifi.png
screenshot-attack-from-airport-wifi.png From the original on HackerOne

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

Context

HackerOne's public site exposes a JSON search endpoint, /bugs.json, that lets a visitor query bug reports by text. The same endpoint is used from the /bugs page, and the report notes that the request for /bugs.json made from that page already carries an x-csrf-token header. A related endpoint, /bugs/count/, appears to behave in a similar way.

The feature normally returns the reports matching a text query. The researcher's interest was not in the results themselves but in how long the server takes to produce them: a query that matches something takes slightly longer to process than a query that matches nothing. The report turns that small difference into a reliable signal by looking at the order in which two concurrent HTTP/2 responses arrive, rather than at their timings.

Setup

The work was done against hackerone.com from a browser. The researcher tested on a MacBook Pro, in both Chrome and Firefox (up-to-date versions), over a variety of network conditions: ethernet, WiFi and what the report calls crappy WiFi. No account, role or special tooling is described beyond the browser and a proof-of-concept page.

The precondition that makes the technique work is that hackerone.com serves requests over HTTP/2, so two requests issued at the same moment travel over the same TCP connection and are processed as concurrent streams on the server.

Finding it

The starting point was earlier work. A timing attack against /bugs.json had been reported in #350432 and again in #350432, and possibly in #4701, which is not public so the researcher did not know its details. Those reports tried to infer the response size, and from it the number of results for a query. For the two public reports, the timing measurements were not reliable enough for an attack. The researcher tried to replicate and improve them using the timing techniques from the HEIST work, and confirmed that no reliable results could be obtained, presumably because of relatively high network jitter.

The approach in this report is different. It does not use timing information at all, which is what makes it resilient to jitter, and it does not try to measure response size. It measures server processing time indirectly, through the ordering of responses.

Exploitation

Step 1: Send two requests at once

The attacker triggers two simultaneous requests with fetch(). One goes to a baseline query that returns no results, for example:

Text
/bugs.json?text_query=NO_RESULT_WILL_BE_FOUND

The other goes to a query the attacker is interested in, for example:

Text
/bugs.json?text_query=/bugs.json%20timing

Because hackerone.com uses HTTP/2, both requests are sent over the same TCP connection, in two TCP packets following right after each other. Any jitter experienced by the first packet is also experienced by the second, so they arrive at the server at almost exactly the same time. The two HTTP/2 streams are concurrent and are processed in parallel on the server.

Step 2: Read the order of the responses

Because processing times differ, even minimally, one request produces its response faster than the other. The server sends each response as soon as it is ready. As soon as the client receives the headers of a response, the Promise returned by the corresponding fetch() call resolves. That lets the attacker determine which response was generated first, and therefore which request took the least and which took the most execution time.

Against the researcher's own server, an execution time difference of 1 to 5 µsec was measurable from the browser.

Step 3: Interpret the ordering

If the target query returns no results, its execution time is the same as the baseline, and the probability that its response arrives in the same order as the requests were sent is approximately 50%. If the target query does yield results, the probability that the response for the target query comes in last is higher, because the server needed additional time to process it.

Processing-time jitter still affects the result, but it is typically one or more orders of magnitude smaller than the network jitter seen in typical timing attacks. The attacker therefore collects a number of measurements and counts the response ordering for them. In the researcher's tests, 20 request-pairs were enough for a reliable result. In fact, every attack run was successful, including runs from airport WiFi.

The only time the attack did not work was when the baseline query erroneously returned results. The researcher believes this is probably a bug in HackerOne caused by some sort of race condition, noticed while sending a lot of requests in parallel until the rate limiting in effect became apparent. It might be worth exploring further, as it could be just a bug or could somehow be exploitable, but it was hard to replicate. The researcher offered to open a separate report if it would be easier for the team to track, while noting that no security impact had been shown for it.

Step 4: Run the proof of concept

A basic proof of concept was implemented and hosted at https://poc.tom.vg/hackerone/hackerone-bugs.json-concurrent-requests.html. To use it, change the text_query parameter to something that would have at least one result, click start and wait 6 to 7 seconds. If the value, or values if multiple iterations are selected, of numCorrectBaseline is lower than that of numCorrectTarget, the attack was successful, because the response for the target URL was slower.

These are the results obtained for 10 iterations on a home WiFi connection:

JSON
{
    "numCorrectBaseline": [11, 10, 9, 8, 6, 9, 10, 6, 10, 11],
    "numCorrectTarget": [15, 18, 14, 16, 15, 16, 14, 13, 16, 20]
}

From this it seems clear that the attack is quite robust. The researcher also notes that /bugs/count/, and possibly some other endpoint not tested, might be affected, though /bugs/count/ seems slightly less robust, presumably because it has to retrieve less information from the database.

screenshot-attack-from-airport-wifi.png
screenshot-attack-from-airport-wifi.png From the original on HackerOne

The screenshot shows 5 iterations run over the airport WiFi.

Root cause

The endpoint's processing time depends on whether the query returns results, and that difference is observable from the browser through the order in which concurrent HTTP/2 responses arrive. The design does not equalise processing time between queries that match and queries that do not, and the response is sent as soon as it is ready, so the ordering leaks the difference.

Existing defences did not stop it. The x-csrf-token header is present on the /bugs.json request made from /bugs, but its value is not validated, so it provides no protection. The report notes that if the __Host-session cookie were served with e.g. SameSite=lax, the attack would not be possible. The report also refers to a plan, mentioned in #350432, to deprecate the endpoint and replace it with GraphQL requiring a token to query the information.

Impact

The vulnerability gives the attacker search capabilities over the victim's reported bugs. The attacker could use it to discover vulnerable endpoints or other sensitive data. For instance, the attacker could start with a query for https://hackerone.com/, determine that the victim reported a vulnerability there, then cycle through all endpoints, https://hackerone.com/activities, https://hackerone.com/apps, and so on, and find which one was probably vulnerable, since the vulnerable endpoint will likely be present in the report. Knowing the endpoint, the attacker could further refine the type of vulnerability using several keywords, and perhaps find the query parameters.

Because the text search matches any substring, not just on word boundaries, the attacker could also brute-force certain secrets, for example when they were redacted in a public report.

Fix

The report lists three mitigations.

  1. CSRF token: the request for /bugs.json from /bugs already includes the x-csrf-token header, but its value is not validated. Validating such a CSRF token would mitigate the vulnerability.
  2. Deprecation: #350432 mentioned that the endpoint would be deprecated, and possibly removed, and replaced with GraphQL requiring a token to query the information. That would also work, and the report might expedite the process.
  3. SameSite cookies: if the __Host-session cookie were served with, for example, SameSite=lax, the attack would not be possible.

Variants to test

  • JSON search or listing endpoints whose processing time depends on whether a query matches, tested with a baseline query that returns nothing and a target query that returns something. A positive result is a consistent ordering bias across repeated request-pairs, with the target response arriving last more often than the baseline.
  • Count endpoints such as /bugs/count/, which the researcher found possibly affected but slightly less robust. A positive result is the same ordering bias, possibly needing more iterations.
  • Any endpoint on an HTTP/2 host where two concurrent streams are processed in parallel and responses are sent as soon as they are ready. A positive result is a measurable ordering difference from the browser, even at the microsecond scale.
  • Substring search features, to check whether secrets redacted in public content can be recovered character by character. A positive result is a query that matches only when the guessed substring is correct.

Hunting notes

This kind of bug hides in search and listing endpoints that do work proportional to the number of results, on sites served over HTTP/2. During recon, the signals are a JSON or count endpoint reachable from a page, a text query parameter, and a session cookie that is not restricted with SameSite. The researcher built a working proof of concept, reported the measured ordering counts for 10 iterations, and showed the attack held up under poor network conditions, including airport WiFi. The report also ties the leak to a concrete scenario, recovering which endpoint a victim reported a vulnerability on, and to brute-forcing redacted secrets, which is what turns a timing side channel into an information disclosure.

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

What happened, in plain words

HackerOne is a website where security researchers report bugs they find in other companies' software. Each of those reports is called a bug report, and HackerOne's public site lets anyone browse and search through the ones that have been made public.

The search feature is powered by something called an API endpoint. An API is a way for a web page to ask a server for data without reloading the whole page: the page sends a request to a specific address, and the server answers with data, usually in a format called JSON (a plain text way of writing lists and records that both people and programs can read). An endpoint is simply one of those addresses. The endpoint in this report is /bugs.json, which returns the bug reports matching a text search.

The researcher found that this endpoint takes a tiny bit longer to answer when the search finds something than when it finds nothing. That difference is far too small to see with a stopwatch, and normal network delays (called jitter) drown it out. So instead of measuring time, the researcher sent two searches at the same moment and looked at which answer came back first. Because of how the site's connection works, this ordering is a reliable clue about which search took longer on the server, and therefore about whether a search found anything.

Why does that matter? If an attacker can make a victim's browser run searches against the victim's own logged-in session, the attacker can ask yes/no questions about the victim's private bug reports, one at a time, and piece together information that was never meant to be public. This kind of leak is called information disclosure: data that should stay hidden becomes visible, bit by bit, without anyone breaking in.

Context

HackerOne's public site exposes a JSON search endpoint, /bugs.json, that lets a visitor query bug reports by text. The same endpoint is used from the /bugs page, and the report notes that the request for /bugs.json made from that page already carries an x-csrf-token header. A related endpoint, /bugs/count/, appears to behave in a similar way.

Two terms in that paragraph need unpacking. A header is a small piece of extra information attached to a web request or response, like the label on a parcel: it does not contain the main contents, but it tells the receiver something about them. x-csrf-token is a header whose name starts with x-, a convention for custom headers, and CSRF stands for Cross-Site Request Forgery, an attack where a malicious page makes a victim's browser send a request to another site using the victim's existing login. A token is a short value, usually random, that a server can check to confirm a request really came from the site's own pages and not from somewhere else.

The feature normally returns the reports matching a text query. The researcher's interest was not in the results themselves but in how long the server takes to produce them: a query that matches something takes slightly longer to process than a query that matches nothing. The report turns that small difference into a reliable signal by looking at the order in which two concurrent HTTP/2 responses arrive, rather than at their timings.

HTTP/2 is a version of the protocol browsers and servers use to exchange web pages and data. Its predecessor, HTTP/1.1, generally handled one request at a time per connection; HTTP/2 lets many requests travel over a single connection at once, each as a separate "stream". Concurrent means happening at the same time rather than one after another. A response is the server's answer to a request.

Setup

The work was done against hackerone.com from a browser. The researcher tested on a MacBook Pro, in both Chrome and Firefox (up-to-date versions), over a variety of network conditions: ethernet, WiFi and what the report calls crappy WiFi. No account, role or special tooling is described beyond the browser and a proof-of-concept page.

A proof of concept (often shortened to PoC) is a small, deliberately limited demonstration that a suspected weakness really works, built to convince others without being a full attack tool.

The precondition that makes the technique work is that hackerone.com serves requests over HTTP/2, so two requests issued at the same moment travel over the same TCP connection and are processed as concurrent streams on the server.

TCP is the underlying protocol that carries web traffic between two machines; a connection is an established channel between the browser and the server. Because both requests share one connection, they leave together and arrive together, which is the whole trick.

Finding it

The starting point was earlier work. A timing attack against /bugs.json had been reported in #350432 and again in #350432, and possibly in #4701, which is not public so the researcher did not know its details. Those reports tried to infer the response size, and from it the number of results for a query. For the two public reports, the timing measurements were not reliable enough for an attack. The researcher tried to replicate and improve them using the timing techniques from the HEIST work, and confirmed that no reliable results could be obtained, presumably because of relatively high network jitter.

A timing attack is a way of learning secret information by measuring how long something takes: if an operation is faster or slower depending on the answer, the time itself leaks the answer. Jitter is the natural variation in how long network traffic takes, caused by congestion, WiFi interference and similar factors; it is the noise that makes small timing differences hard to read. HEIST is a known body of research on timing attacks against encrypted web traffic, which the researcher had previously worked on.

The approach in this report is different. It does not use timing information at all, which is what makes it resilient to jitter, and it does not try to measure response size. It measures server processing time indirectly, through the ordering of responses.

Exploitation

Step 1: Send two requests at once

The attacker triggers two simultaneous requests with fetch(). One goes to a baseline query that returns no results, for example:

Text
/bugs.json?text_query=NO_RESULT_WILL_BE_FOUND

This is a URL path plus a query string. /bugs.json is the endpoint being called. The ? marks the start of the query string, the part that carries the search terms. text_query is the name of the parameter, the input the endpoint expects, and NO_RESULT_WILL_BE_FOUND is its value: a deliberately meaningless phrase chosen so that the search is certain to find nothing. This request is the baseline, the reference point against which the second request will be compared.

The other goes to a query the attacker is interested in, for example:

Text
/bugs.json?text_query=/bugs.json%20timing

Here the value is /bugs.json%20timing. The %20 is how a space is written inside a URL, because URLs cannot contain literal spaces; decoded, the search text is /bugs.json timing. This is the target query: the one whose result the attacker wants to learn about. If any bug report contains that text, the search returns something; if not, it returns nothing.

fetch() is a built-in browser function that a web page uses to send a request to a server and receive the answer, without navigating away from the page. It returns a Promise, which is JavaScript's way of representing a result that is not ready yet: a placeholder that will be filled in when the answer arrives. The page can attach code to run at that moment.

Because hackerone.com uses HTTP/2, both requests are sent over the same TCP connection, in two TCP packets following right after each other. Any jitter experienced by the first packet is also experienced by the second, so they arrive at the server at almost exactly the same time. The two HTTP/2 streams are concurrent and are processed in parallel on the server.

A packet is a small chunk of data that networks deliver individually. The key idea is that two packets sent back to back share the same journey, so whatever delay hits one hits the other, and the delay cancels out when you compare them.

Step 2: Read the order of the responses

Because processing times differ, even minimally, one request produces its response faster than the other. The server sends each response as soon as it is ready. As soon as the client receives the headers of a response, the Promise returned by the corresponding fetch() call resolves. That lets the attacker determine which response was generated first, and therefore which request took the least and which took the most execution time.

Resolving a Promise means the placeholder is filled in and the page's waiting code runs. The page does not need to read the body of the answer, only to notice which of the two answers started arriving first. That is why the technique survives jitter: it compares two things that travelled together, rather than comparing a measurement against a clock.

Against the researcher's own server, an execution time difference of 1 to 5 µsec was measurable from the browser.

A microsecond (µsec) is one millionth of a second. The point is that the difference being detected is extraordinarily small, yet still visible through ordering.

Step 3: Interpret the ordering

If the target query returns no results, its execution time is the same as the baseline, and the probability that its response arrives in the same order as the requests were sent is approximately 50%. If the target query does yield results, the probability that the response for the target query comes in last is higher, because the server needed additional time to process it.

In other words, when both searches are equally fast, which answer arrives first is essentially a coin flip. When the target search has real work to do, it tends to finish second more often than not. A single coin flip proves nothing, so the attacker repeats the experiment and counts.

Processing-time jitter still affects the result, but it is typically one or more orders of magnitude smaller than the network jitter seen in typical timing attacks. The attacker therefore collects a number of measurements and counts the response ordering for them. In the researcher's tests, 20 request-pairs were enough for a reliable result. In fact, every attack run was successful, including runs from airport WiFi.

An order of magnitude means a factor of ten. Airport WiFi is a useful stress test because it is often slow and unstable, so success there suggests the method does not depend on a good connection.

The only time the attack did not work was when the baseline query erroneously returned results. The researcher believes this is probably a bug in HackerOne caused by some sort of race condition, noticed while sending a lot of requests in parallel until the rate limiting in effect became apparent. It might be worth exploring further, as it could be just a bug or could somehow be exploitable, but it was hard to replicate. The researcher offered to open a separate report if it would be easier for the team to track, while noting that no security impact had been shown for it.

A race condition is a fault where the outcome depends on the exact timing of events that are supposed to happen in a fixed order, so results can occasionally come out wrong. Rate limiting is a server-side control that refuses or slows requests once a client sends too many in a short period.

Step 4: Run the proof of concept

A basic proof of concept was implemented and hosted at https://poc.tom.vg/hackerone/hackerone-bugs.json-concurrent-requests.html. To use it, change the text_query parameter to something that would have at least one result, click start and wait 6 to 7 seconds. If the value, or values if multiple iterations are selected, of numCorrectBaseline is lower than that of numCorrectTarget, the attack was successful, because the response for the target URL was slower.

An iteration is one repetition of the experiment. The page keeps two tallies, numCorrectBaseline and numCorrectTarget. When the target tally is higher, the target search is consistently the slower one, which means it found something.

These are the results obtained for 10 iterations on a home WiFi connection:

JSON
{
    "numCorrectBaseline": [11, 10, 9, 8, 6, 9, 10, 6, 10, 11],
    "numCorrectTarget": [15, 18, 14, 16, 15, 16, 14, 13, 16, 20]
}

This is a JSON object with two lists. Each list holds ten numbers, one per iteration. The first list, numCorrectBaseline, records the baseline tallies: 11, 10, 9, 8, 6, 9, 10, 6, 10 and 11. The second list, numCorrectTarget, records the target tallies: 15, 18, 14, 16, 15, 16, 14, 13, 16 and 20. In every one of the ten iterations the target number is higher than the baseline number, which is the pattern the attack predicts when the target query returns results.

From this it seems clear that the attack is quite robust. The researcher also notes that /bugs/count/, and possibly some other endpoint not tested, might be affected, though /bugs/count/ seems slightly less robust, presumably because it has to retrieve less information from the database.

A count endpoint is one that returns only how many items match, rather than the items themselves. The researcher assumes this is because it has to retrieve less information from the database.

screenshot-attack-from-airport-wifi.png
screenshot-attack-from-airport-wifi.png From the original on HackerOne

The screenshot shows 5 iterations run over the airport WiFi.

Root cause

The endpoint's processing time depends on whether the query returns results, and that difference is observable from the browser through the order in which concurrent HTTP/2 responses arrive. The design does not equalise processing time between queries that match and queries that do not, and the response is sent as soon as it is ready, so the ordering leaks the difference.

Existing defences did not stop it. The x-csrf-token header is present on the /bugs.json request made from /bugs, but its value is not validated, so it provides no protection. The report notes that if the __Host-session cookie were served with e.g. SameSite=lax, the attack would not be possible. The report also refers to a plan, mentioned in #350432, to deprecate the endpoint and replace it with GraphQL requiring a token to query the information.

A cookie is a small piece of data a site stores in the browser and the browser sends back with later requests; it is how a site recognises that you are logged in. __Host-session is the name of the cookie HackerOne uses for the session, the period during which the site remembers who you are. SameSite is a cookie setting that controls whether the browser will attach that cookie to requests started by other websites; a restrictive value such as lax blocks most of them. GraphQL is a different style of API where the client describes exactly what data it wants, and it can be set up to require a token before answering. To deprecate something is to announce that it will be retired.

Impact

The vulnerability gives the attacker search capabilities over the victim's reported bugs. The attacker could use it to discover vulnerable endpoints or other sensitive data. For instance, the attacker could start with a query for https://hackerone.com/, determine that the victim reported a vulnerability there, then cycle through all endpoints, https://hackerone.com/activities, https://hackerone.com/apps, and so on, and find which one was probably vulnerable, since the vulnerable endpoint will likely be present in the report. Knowing the endpoint, the attacker could further refine the type of vulnerability using several keywords, and perhaps find the query parameters.

Each of those URLs is a guess about what the victim's report might mention. The attacker does not read the report; they only ask the search whether a given piece of text appears in it, and the ordering trick answers yes or no. By trying many candidate strings, the attacker narrows down the subject of the report.

Because the text search matches any substring, not just on word boundaries, the attacker could also brute-force certain secrets, for example when they were redacted in a public report.

A substring is any run of characters inside a longer piece of text, so searching for abc matches abcdef as well as xabcx. To brute-force is to try every possibility systematically until the right one is found. Redacted means deliberately blacked out, as when a public report hides a sensitive value; if the search still matches the hidden text, the blacking out can be undone one character at a time.

Fix

The report lists three mitigations.

  1. CSRF token: the request for /bugs.json from /bugs already includes the x-csrf-token header, but its value is not validated. Validating such a CSRF token would mitigate the vulnerability.
  2. Deprecation: #350432 mentioned that the endpoint would be deprecated, and possibly removed, and replaced with GraphQL requiring a token to query the information. That would also work, and the report might expedite the process.
  3. SameSite cookies: if the __Host-session cookie were served with, for example, SameSite=lax, the attack would not be possible.

A mitigation is a change that reduces or removes a risk. The first fix makes the server check the token it already receives, so requests forged by another site are rejected. The second removes the feature entirely in favour of one that demands a token. The third stops the browser from attaching the login cookie to requests that other sites initiate, which cuts the attack off at the source.

Variants to test

  • JSON search or listing endpoints whose processing time depends on whether a query matches, tested with a baseline query that returns nothing and a target query that returns something. A positive result is a consistent ordering bias across repeated request-pairs, with the target response arriving last more often than the baseline.
  • Count endpoints such as /bugs/count/, which the researcher found possibly affected but slightly less robust. A positive result is the same ordering bias, possibly needing more iterations.
  • Any endpoint on an HTTP/2 host where two concurrent streams are processed in parallel and responses are sent as soon as they are ready. A positive result is a measurable ordering difference from the browser, even at the microsecond scale.
  • Substring search features, to check whether secrets redacted in public content can be recovered character by character. A positive result is a query that matches only when the guessed substring is correct.

A bias is a consistent tendency rather than a one-off result: if the target answer comes last clearly more often than chance over many repetitions, that is a bias. A variant is another place where the same underlying weakness might appear.

Hunting notes

This kind of bug hides in search and listing endpoints that do work proportional to the number of results, on sites served over HTTP/2. During recon, the signals are a JSON or count endpoint reachable from a page, a text query parameter, and a session cookie that is not restricted with SameSite. The researcher built a working proof of concept, reported the measured ordering counts for 10 iterations, and showed the attack held up under poor network conditions, including airport WiFi. The report also ties the leak to a concrete scenario, recovering which endpoint a victim reported a vulnerability on, and to brute-forcing redacted secrets, which is what turns a timing side channel into an information disclosure.

Recon, short for reconnaissance, is the early phase of looking around a target to see what features and endpoints exist. A side channel is an unintended way information escapes, such as through timing or ordering, rather than through the data itself.

Glossary

  • API: a defined way for one program, such as a web page, to ask another, such as a server, for data or actions.
  • Baseline: the reference request in an experiment, here a search deliberately chosen to return no results.
  • Bias: a consistent tendency in results over many repetitions, as opposed to random variation.
  • Brute-force: trying every possible value systematically until the correct one is found.
  • Bug report: a record submitted to HackerOne describing a security flaw found in some software.
  • Concurrent: happening at the same time rather than one after another.
  • Cookie: a small piece of data stored by the browser for a site and sent back with later requests, commonly used to keep you logged in.
  • Count endpoint: an endpoint that returns only how many items match a query, not the items themselves.
  • CSRF (Cross-Site Request Forgery): an attack where a malicious page causes a victim's browser to send a request to another site using the victim's existing login.
  • Deprecate: to announce that a feature will be retired and should no longer be used.
  • Endpoint: a specific address on a server that accepts requests and returns data.
  • fetch(): a built-in browser function for sending a request to a server and receiving the answer without leaving the page.
  • GraphQL: a style of API where the client describes exactly which data it wants, often protected by a token.
  • Header: extra information attached to a web request or response, separate from its main contents.
  • HEIST: a body of research on timing attacks against encrypted web traffic, referenced by the researcher.
  • HTTP/2: a version of the web protocol that lets many requests travel over one connection at the same time, each as a stream.
  • Information disclosure: a weakness where data that should stay hidden becomes visible to someone who should not see it.
  • Iteration: one repetition of an experiment.
  • Jitter: natural variation in how long network traffic takes, caused by congestion, interference and similar factors.
  • JSON: a plain text format for writing lists and records that both people and programs can read.
  • Microsecond (µsec): one millionth of a second.
  • Mitigation: a change that reduces or removes a risk.
  • Order of magnitude: a factor of ten.
  • Packet: a small chunk of data that networks deliver individually.
  • Parameter: a named input in a request, such as text_query, together with its value.
  • Proof of concept (PoC): a small demonstration that a suspected weakness really works.
  • Promise: JavaScript's placeholder for a result that is not ready yet, filled in when the answer arrives.
  • Query string: the part of a URL after the ? that carries inputs to the endpoint.
  • Race condition: a fault where the outcome depends on the exact timing of events that should happen in a fixed order.
  • Rate limiting: a server control that refuses or slows requests once a client sends too many in a short period.
  • Recon (reconnaissance): the early phase of exploring a target to see what features and endpoints exist.
  • Redacted: deliberately blacked out, as when a public report hides a sensitive value.
  • Resolve: the moment a Promise is filled in and the waiting code runs.
  • Response: the server's answer to a request.
  • SameSite: a cookie setting that controls whether the browser attaches the cookie to requests started by other websites.
  • Session: the period during which a site remembers who you are, usually via a cookie.
  • Side channel: an unintended way information escapes, such as through timing or ordering, rather than through the data itself.
  • Stream: one of several independent exchanges of requests and responses running at once inside a single HTTP/2 connection.
  • Substring: any run of characters inside a longer piece of text.
  • TCP: the underlying protocol that carries web traffic between two machines over an established connection.
  • Timing attack: learning secret information by measuring how long an operation takes.
  • Token: a short, usually random value a server can check to confirm a request is legitimate.
  • Variant: another place where the same underlying weakness might appear.

More by tomvg

View all

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

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.