7 ms·
> This comment comes off as either disingenuous or needlessly contrarian, and in the process tries to make points that fall somewhere between completely wrong a
by hn_throwaway_99 5y ago
> This comment comes off as either disingenuous or needlessly contrarian, and in the process tries to make points that fall somewhere between completely wrong and miopic.
Bluntly, your response is the one coming off as needlessly argumentative, and the parent comment made plenty of sense to me. I don't think it's disingenuous to clearly explain the difference between the Same-Origin Policy and CORS, and to emphasize that CORS relaxes the Same-Origin Policy.
- blurker 5y agoActually, I agree with OP. Grandparent's phrasing: > All of this is completely wrong. Is not only needlessly argumentative but also wrong itself. The 3rd point they include as "completely wrong" is not wrong, and they end up just rephrasing it later in their correction.
- JimDabell 5y ago> The 3rd point they include as "completely wrong" is not wrong It is: > With cURL, no CORS takes effect, so the attacker has direct access with the full rights of the user. The attacker has direct access with the full rights of the user because this is not a situation where one origin is making a request for a resource from another origin, so there’s nothing that says this shouldn’t happen. It’s got absolutely nothing to do with CORS at all.
- vinnymac 5y agoYou and OP make a good point. In that most people I’ve come across don’t understand how the Same-Origin Policy and Cross-Origin Resource Sharing differ and relate. I believe it’s important developers learn the nuances, otherwise we will likely see more faulty implementations.
- pshc 5y agoRegardless of their tone, fivea is correct to point this out as myopic. The grandparent comment argues about semantics and provides information that is technically correct, but not in a useful sense. To say that "CORS decreases security" because it opens up cross origin communication is perhaps not disingenuous (who can say?) but certainly misleading. All browser users would be worse off without CORS. I think we are arriving at the word 'security' with different starting points and lenses, and a different chunking of what constitutes CORS. So I too am guilty of making a semantic argument.
- JanSt 5y agoI disagree. Just read the article „cors protects us“ - things like these come from misunderstandings like this one.
- unclebucknasty 5y ago>All browser users would be worse off without CORS. You and fivea are conflating functionality with security. Yes, it may be functionally desirable for an app to allow cross-origin requests, as enabled by CORS. But, you're granting permissions, and that is opening things up, possibly making them less secure. I think great-grandparent's point highlighting this is worth making, given that there is so much confusion around CORS.
- Dylan16807 5y ago> You and fivea are conflating functionality with security. fivea wasn't conflating functionality and security. They were saying that a world without CORS would be a world where those rights are always granted.
- JimDabell 5y ago> a world without CORS would be a world where those rights are always granted. We’ve already seen a world without CORS, and that didn’t happen. Cross-origin restrictions were brought in almost immediately after the introduction of JavaScript and existed for over a decade before CORS was introduced.
- unclebucknasty 5y ago>a world without CORS would be a world where those rights are always granted. Or a world where those rights are never granted. Which of those you conclude is a matter of semantics, and this interpretability contributes to the confusion around what CORS actually does. It's that confusion which another commenter was addressing [0] and that my comments sought to support/clarify. You may be unaware that some people believe that CORS is intended to "lock things down" vs. "open them up". They don't understand that it's opt-in or the default behavior without it. But, it's a matter of fact that usage of CORS presents risks vs the default policy, and those risks must be considered. That's really the point vs the idea that CORS has no utility. It's worth noting too that, strictly speaking, there are frequently workarounds to the default policy that don't require CORS, some of which are arguably more secure by way of being less prone to configuration errors. [0] https://news.ycombinator.com/item?id=30320613 https://news.ycombinator.com/item?id=30320613
- deleted 5y ago[deleted]