Skip to content
DoS Disclosed report Intermediate CVE-2022-22755

Code execution after tab and window close.

An XSLT stylesheet could keep making network requests and performing computation after its tab or window was closed. An attacker could use this to track a user, consume their computing resources, or generate traffic for denial-of-service.

Jack Wrenn Follow

Originally disclosed on Mozilla

  • Fixed in 5.2 years
  • Paid in 2.1 years
  • Disclosed after 5.2 years
Text
Created attachment 8800292
Minimal Test Case

STEPS TO REPRODUCE:
  1 Download 'exploit.xsl' (a minimal testcase of the bug).
  2 Run `python -m SimpleHTTPServer 8080` in a terminal.
  3 Navigate to 'http://localhost:8080/exploit.xsl'.
  4 Check the output of the server started in Step 2.
  5 Open another tab.
  6 Close the 'exploit.xsl' tab.
  7 Check the output of the server started in Step 2.
  8 Close the browser window. Grab lunch.
  9 Check the output of the server started in Step 2.

EXPECTED BEHAVIOR:
  - At Step 4, the server IS reporting incoming GET requests.
  - At Step 7, the server is NOT reporting incoming GET requests.
  - At Step 9, the server is NOT reporting incoming GET requests.

ACTUAL BEHAVIOR:
  - At Step 4, the server IS reporting incoming GET requests.
  - At Step 7, the server IS reporting incoming GET requests.
  - At Step 9, the server IS reporting incoming GET requests.

POSSIBLE EXPLOITATION
A. User Tracking
I've constructed a proof-of-concept user-tracking server that serves
each request a variant of 'exploit.xsl' which has been tagged with a 
unique identifying number. The server sleeps for several seconds before
responding to each incoming request, so as not to cause an undue amount
of network traffic. Upon each request, the server logs the time of the
heartbeat, the user ID, and their IP address. This leaks, roughly, the
user's possibly-changing location and their computer usage habits.

B. Theft of Computing Resources
This bug can be exploited to force the user's browser to perform general
computation after the user has left the page. The attached file does not
have a base-case to its recursive calls, but can be easily modified to
have one that forwards the result of the computation to the attacker.

C. Denial-of-Service Attacks
This attack can be used to generate a large volume of network trafic
from a user after they have left the page. Combined with an XSS attack,
Firefox users could be co-opted into bombarding a site long after they
have left the page.

OTHER OBSERVATIONS
  1 This bug is exploitable with javascript disabled (unsurprising from
    a technical perspective, but given the possible attacks, probably
    surprising from a user's perspective).
  2 If the firefox process ends and then is restarted with the session
    restored, the requests pick right up from where they left off.
  3 If the recursion reaches a base case after the window is closed,
    Firefox appears to do some DOM processing. This can be tested by
    modifying 'exploit.xslt' to output an HTML file containing,
      <link rel="prefetch" href="/test.png">
    upon reaching its base case. The server logs will display a request
    to 'test.png', even though the window was closed before processing
    the XSLT completed. It may be able to combine this bug with other
    bugs to produce other exploits at this point.
  4 The attacker can detect when the tab is closed since the pending 
    request is interrupted.
  5 The attacker may modify an in-progress computation by serving a
    different 'exploit.xsl?n=N' at a particular value of N. (I haven't
    explored this in much depth, yet.)
  6 This bug is exploitable with javascript disabled (unsurprising from
    a technical perspective, but given the possible attacks, probably
    surprising from a user's perspective).

The original report as published on Mozilla's Bugzilla, by Jack Wrenn. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the browser did not cancel an in-progress XSLT transformation and its associated network requests when the tab or window was closed.

Impact

An attacker could track a user's location and habits, force the browser to perform computation, or generate network traffic for denial-of-service, even with JavaScript disabled; the text notes the attack works in Firefox and can continue after a session restore.

What the attacker needed

Victim visits a malicious XSLT page; JavaScript not required; Firefox browser

How it was found

  1. Download the minimal test case XSLT file.
  2. Start a simple HTTP server on port 8080.
  3. Navigate to the XSLT file served by that server.
  4. Observe that the server receives GET requests.
  5. Open another tab and close the XSLT tab.
  6. Observe that the server still receives GET requests, and continues after the browser window is closed.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A web page can contain a special file called an XSLT stylesheet that tells the browser how to transform data. Normally, when you close a tab, the browser should stop everything that page was doing. Here, the browser kept running the stylesheet and making requests to a server even after the tab and window were closed, which could be abused to track you or waste your computer's power.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.