-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP协议 #53
Comments
. |
1 similar comment
. |
HTTP安全之跨域策略简介Web 基于同源政策 ( 但是,在历史上同源政策有一些例外。任何网站都可以:
为了修补这些安全副作用,引入了跨域资源共享 (CORS)协议和 一些关键术语:
为了确保访问强大的功能,如 安全头参考下面列出了可用于保护网站的最重要的安全头。
跨域共享Cross-Origin Resource Sharing (CORS) 跨源资源共享是一种基于 HTTP 标头的机制,允许服务器指示除其自身之外的任何来源(域、协议或端口),浏览器应允许从中加载资源。 CORS 还依赖于一种机制,浏览器通过该机制向托管跨源资源的服务器发出“预检”请求,以检查服务器是否允许实际请求。在该预检中,浏览器发送指示 HTTP 方法的标头以及将在实际请求中使用的标头。 出于安全原因,浏览器限制从脚本发起的跨域 HTTP 请求。例如, 先来看一个 200 OK
Access-Control-Allow-Headers: *
Access-Control-Allow-Methods: *
Access-Control-Allow-Origin: *
Connection: Keep-Alive
Content-Encoding: gzip
Content-Type: text/html; charset=utf-8
Cross-Origin-Embedder-Policy: credentialless
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Resource-Policy: cross-origin
Date: Mon, 18 Jul 2016 16:06:00 GMT
Etag: "c561c68d0ba92bbeb8b0f612a9199f722e3a621a"
Keep-Alive: timeout=5, max=997
Last-Modified: Mon, 18 Jul 2016 02:36:04 GMT
Server: Apache
Set-Cookie: csrftoken=25ab047d8bdf1cf4f6fc8272aaa9d8b8; expires=Mon, 17-Jul-2017 16:06:00 GMT; Max-Age=31449600; Path=/; secure
Transfer-Encoding: chunked
Vary: Cookie, Accept-Encoding
X-Backend-Server: developer2.webapp.scl3.mozilla.com
X-Cache-Info: not cacheable; meta data too large
X-kuma-revision: 1085259
x-frame-options: DENY
跨域隔离某些 Web API 会增加旁路攻击(例如 Spectre)的风险。为了降低这种风险,浏览器提供了一个基于选择启用的隔离环境,称为“跨域隔离”。在跨域隔离状态下,网页将可以使用特权功能,包括:
跨域隔离状态还会阻止修改 如需选择启用跨域隔离状态,您需要在主文档上发送以下 HTTP 标头: Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Opener-Policy: same-origin 这些标头会指示浏览器阻止加载尚未选择由跨源文档加载的资源或 iframe,并阻止跨源窗口直接与您的文档交互。这也意味着,这些跨源加载的资源需要选择启用才能使用。 您可以通过检查 HTTP Response Headers
减轻跨域隔离的影响确定哪些资源将受跨域隔离的影响后,请遵循以下一般准则,了解如何实际选择启用这些跨源资源:
问题1. IFrame credentiallessIFrame credentialless 为开发人员提供了一种使用新的临时上下文在 <iframe
src="https://en.wikipedia.org/wiki/Spectre_(security_vulnerability)"
title="Spectre vulnerability Wikipedia page"
width="960"
height="600"
credentialless>
</iframe> ref |
大纲
The text was updated successfully, but these errors were encountered: