Skip to content
XSS Disclosed report Beginner CVE-2019-11701

Remove the default protocol handler for webcal given it has serious XSS vulnerabilities

A default webcal protocol handler in Firefox sends the full webcal URL to a third-party site, which reflects it into a page without sanitisation, allowing script execution. An attacker could craft a webcal link that, when opened, runs JavaScript in the context of the third-party site.

Peter af Geijerstam Follow

Originally disclosed on Mozilla

  • Fixed in 34 days
  • Paid in 34 days
  • Disclosed after 34 days
Text
Operating system: Ubuntu Linux 18.04 LTS
Firefox version: Firefox Quantum 64.0 (Mozilla Firefox for Ubuntu canonical-1.0)

I was looking around in about:config researching a totally different bug and found the following handler installed (by default i presume as i have not installed it):

gecko.handlerService.schemes.webcal.0.name;30 Boxes
gecko.handlerService.schemes.webcal.0.uriTemplate;https://30boxes.com/external/widget?refer=ff&url=%s

This service is unfortunately vulnerable, and as your general eligibility states that third-party websites utilized are in-scope ("We will pay bounties for vulnerabilities in third-party libraries incorporated into shipped client code or third-party websites utilized by Mozilla.") i thought i would try to report this bug to get this handler removed.

To reproduce: either create the following url as a link or just paste it into the web-browser:

webcal://www.mozilla.org?q=<script>document.location='http://redirected.shellcode.se';</script>
(I created a simple link to this on a page on my domain: http://poc.shellcode.se/webcal.html)

Firefox asks if you want to open the link with the application "30 Boxes" (Unless the user has clicked "Remember my choice for webcal links"). Clicking ok will transfer the user to the url:

https://30boxes.com/external/widget?refer=ff&url=www.mozilla.org?q=webcal%3A%2F%2Fwww.mozilla.org%3Fq%3D%3Cscript%3Edocument.location%3D'http%3A%2F%2Fredirected.shellcode.se'%3B%3C%2Fscript%3E

This page is vulnerable to XSS and the javascript is executed. In this case only a "harmless" redirect.

I understand that the main bug is not on your domain, but the handler seems to be installed by default and thus affects the standard product.

Thanks for your time!
Best regards
Peter - Sweden

The original report as published on Mozilla's Bugzilla, by Peter af Geijerstam. 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

Impact

An attacker could execute arbitrary JavaScript in the context of the third-party site, though the user must first approve opening the webcal link.

What the attacker needed

Firefox with default webcal handler; victim clicks a crafted webcal link; victim approves opening the link

The fix

The default webcal handler should be removed or the third-party site should properly encode the URL parameter.

How it was found

  1. Create a webcal link containing a script payload.
  2. Open the link in Firefox.
  3. Confirm the prompt to open it with the '30 Boxes' application.
  4. Observe that the browser navigates to the third-party site with the payload in the URL.
  5. The script executes on that page.

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.

When you click a special link like webcal://, Firefox can hand it to another website. That website took part of the link and put it directly into its page without cleaning it, so a malicious link could make the browser run harmful code.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.