我正在查看https://twitter.com和https://encrypted.google.com的 HTTP 响应。这两个响应在其安全定义方面具有有趣的相似之处和不同之处。
出于安全目的,Twitter 和 Google 都具有以下共同的标题元素:
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Server: *custom*
Expires: *in the past*
Cache-Control: private***
但是,twitter 有更广泛的cache-control
声明并使用 HSTS:
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
strict-transport-security: max-age=631138519
问题:
- 有什么理由不使用 HSTS?谷歌是否依赖于 HSTS 预加载,并且“普通”网络应用程序应该启用 HSTS?
- 由于
cache-control
定义不同,Google 用户是否比 Twitter 用户更容易受到 Cache 相关信息泄露的影响?
为了完整起见,我已经包含了两个站点的完整 HTTP 标头。
来自https://encrypted.google.com的 HTTP 响应:
HTTP/1.1 200 OK
Date: Sun, 06 Oct 2013 19:27:33 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=UTF-8
Set-Cookie: PREF=REMOVED
P3P: CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info."
Server: gws
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Alternate-Protocol: 443:quic
Content-Length: 100392
来自https://twitter.com的 HTTP 响应:
HTTP/1.1 200 OK
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
Content-Length: 50221
content-type: text/html;charset=utf-8
date: Sun, 06 Oct 2013 19:33:08 GMT
expires: Tue, 31 Mar 1981 05:00:00 GMT
last-modified: Sun, 06 Oct 2013 19:33:08 GMT
ms: S
pragma: no-cache
server: tfe
set-cookie: _twitter_sess=REMOVED
status: 200 OK
strict-transport-security: max-age=631138519
x-frame-options: SAMEORIGIN
x-transaction: 699d2669d76b27f5
x-ua-compatible: IE=10,chrome=1
x-xss-protection: 1; mode=block