有没有办法通过指定您不想发送任何浏览器数据来发送跨域请求?

Is there a way to send cross-domain requests by specifying you do not want to send any browser data?

据我所知,浏览器允许向其他域发送请求似乎是合理的,只要没有 cookie 被发送到该域。

据我所知,跨域攻击会 - 如果没有适当的保护 - 利用 ajax 请求(我正在做 ajax)将浏览器的 cookie 发送到另一个域,这将允许恶意域中的脚本访问可能敏感的数据。

因此,如果您不发送任何 cookie,这与从您未登录任何内容的隐身模式发送请求基本相同。我无法想象它会引入任何利用的可能性,除了可能如果某些网站只使用一些基于 ip 的验证,这本身似乎是相当愚蠢的,并且用例不太可能受到标准的保护成本高

因此,我觉得我遗漏了一些东西,并且有一种非常明显的方式告诉浏览器“嘿,请为我获取这张图片,无需发送 cookie 或任何东西 - 你不需要无论如何都要登录访问它。

在吗?如果不是,为什么?

As far as I can see, it seems reasonable for a browser to allow sending requests to a different domain as long as there are no cookies being sent to that domain.

考虑一个允许访问与服务器位于同一本地网络的任何人的公司内部网。

Thus, I feel like I'm missing something and there's a very obvious way to tell the browser "hey just get this image for me please, no need to send cookies or anything - you don't need to be logged in to access it anyway".

没有。


同源策略采用默认安全方法。它没有加载包含潜在可利用异常的复杂规则。