6 ms·
This post doesn’t mention the other reasons the same origin policy was necessary: intranets. If your company hosts content on https://company-news.corp.interna
by simonw 2y ago
This post doesn’t mention the other reasons the same origin policy was necessary: intranets.
If your company hosts content on https://company-news.corp.internal/ https://company-news.corp.internal/ it’s very important that some random malicious site on the internet can’t use fetch() or XMLHttpRequest to read that page and exfiltrate that information, just from one of your employees being tricked into visiting that site.
So it’s about more than just cookies.
- quohort 2y agoHmm, true. But perhaps you could mitigate this with cookies as OP suggests. Simply don't return anything unless the GET request has a valid intranet cookie? Or perhaps the client can tell the server what webpage it's fetching from and the security check can be done server-side? It is just strange to me that this security check has to be done on client-side (in the browser) as opposed to on the web server actually responsible for distributing the content.
- splix 2y agoYou definitely could. But I guess it should be secure by default. Even if you didn't implement any check on the server. Because people are lazy or they may forget to implement the security checks, or simply be unaware about them. Ex., when you hacked up a super simple script to display a number of today's users of your startup to display on the big screen in your office. You would probably want something as simple as possible. This page is just 3-5 lines of code. Maybe one-liner even. No authorization or other security, as it's for the office intranet. Without CORS any website that is visited by people from your office could fetch that number on screen.
- kevincox 2y agoEven with CORS, DNS rebinding may be a concern here. I think HTTPS may prevent that as the cert wouldn't contain the original site but in this setup where you want "no other security" it would probably work.
- marcosdumay 2y agoLAN segmentation is mostly stupid too. There is a case to make for old protocols and stuff Microsoft just won't fix (it's always Microsoft). But segmenting a web intranet because you expect the information not to escape is doubly stupid. It not only will escape through an infinity of exploits that exist everywhere; you have exactly 2 groups of people to make access control over, what it certainly insufficient; and finally, you constraint the capacity of people to work physically to inside your office.
- simonw 2y agoJust because it's stupid doesn't mean people haven't been doing it for more than twenty years.
- akira2501 2y ago> But segmenting a web intranet because you expect the information not to escape is doubly stupid. It's one layer in the security stack. It's not sufficient on it's own but there's no reason to get rid of it because it's not 100% effective. > you constraint the capacity of people to work physically to inside your office. Or, you know, just have a VPN.