要瀏覽器不要送出 Referrer 的 Referrer Policy

在讀「The No CAPTCHA problem」這篇的時候看到的:「Referrer Policy」。

<meta name="referrer" content="never">

目前正式版本的瀏覽器中,只有 Google Chrome 有支援,而其他瀏覽器正在開發,像是 Firefox 上個月才進 trunk:「Bug 704320 - Implement <meta name="referrer">」,預定在 36 版才會納入 (目前是 34)。

還蠻新的 HTML5 標準 (還在制定),可以來定期追進度...

OpenSSL 產生並簽出 SHA2 (SHA256) 的憑證

因為 Google Chrome 39 出來的關係,一些以前簽出來只包含 SHA-1 的 SSL certificate 因此導致了綠色 icon 變成黃色 icon,所以都要重簽一次產生 SHA-2 資訊。

有人說可以只要在簽名產生 crt 的部份做就好,不過這邊還是都提出來,並且給驗證的方式。

如果本來就已經有寫好 script,那麼只要在產生 csr 與簽名產生 crt 的步驟都加上 -sha256 就可以解決了。

這是產生 csr 的:(${HOST} 以及 subj 的內容自己代換)

openssl req -new -key ${HOST}.key -subj "/C=TW/ST=Taiwan/L=Taipei/O=MyOrganization/OU=MyUnit/CN=${HOST}" -sha256 -out ${HOST}.csr

而 csr 檢查的方式是:

openssl req -in ${HOST}.csr -text

看 Signature Algorithm 是不是 sha256WithRSAEncryption。

簽名產生 crt 也要加上 -sha256

openssl x509 -req -days 365 -in ${HOST}.csr -CA ca/ca.crt -CAkey ca/ca.key -sha256 -out ${HOST}.crt

而 crt 檢查的方式是:

openssl x509 -in ${HOST}.crt -text

一樣是看 Signature Algorithm 這邊是不是 sha256WithRSAEncryption。

Google Chrome 39 釋出,拔除對 SSLv3 的支援

看到 Google Chrome 39 釋出,拔除對 SSLv3 的支援:「Google Removes SSLv3 Fallback Support From Chrome」,官方的 post 反而沒有特別著墨這點:「Stable Channel Update」。

可以利用「POODLE Attack and SSLv3 Support Measurement」測試瀏覽器是否支援 SSLv3。

Ubuntu 上把 Chrome 拔掉 RC4 連線的方法

首先先看「SSL Cipher Suite Details of Your Browser」這個網站,會列出你目前瀏覽器支援的 cipher suite,會需要知道要拔掉哪些號碼。

接下來的資料是參考「Remove RC4 from SSL/TLS ciphers in Chromium」這篇的方法。

Ubuntu 的使用者可以到 /usr/share/applications/google-chrome.desktop 這邊修改,本來是:

Exec=/usr/bin/google-chrome-stable

改成:

Exec=/usr/bin/google-chrome-stable --cipher-suite-blacklist=0x0004,0x0005,0xc011,0xc007

其中的十六進位數字就是出自最前面提到的網站:

  • 0x0004 對應 RSA-RC4128-MD5,
  • 0x0005 對應 RSA-RC4128-SHA,
  • 0xc011 對應 ECDHE-RSA-RC4128-SHA,
  • 而最後的 0xc007 對應 ECDHE-ECDSA-RC4128-SHA。

這樣就可以將 RC4 禁用掉。

Ubuntu 下強制 Google Chrome 使用 TLS 1.0+

在「How do I patch/workaround SSLv3 POODLE vulnerability (CVE­-2014­-3566)?」這篇文章裡提到了強制 Google Chrome 使用 TLS 1.0+ 的方法。

打開 /usr/share/applications/google-chrome.desktop,把這行:

Exec=/usr/bin/google-chrome-stable %U

改成:

Exec=/usr/bin/google-chrome-stable --ssl-version-min=tls1 %U

然後重新啟動 Google Chrome 就可以了...

Google Chrome 對只有 SHA-1 fingerprint 的淘汰過程

現在 Google Chrome 是 37 版,接下來的幾個版本會開始針對只有 SHA-1 fingerprint 的 SSL certificate 降低安全評價:「Gradually sunsetting SHA-1」。

這是 39 版預定的情況,會出現警告:

這是 40 版預定的情況,安全 icon 會消失:

而這是 41 版直接廢止的情況,當作不合法的 SSL certificate 處理:

另外,預先安裝的 root certificate 不受影響,因為並不是看 SHA-1 hash:

Note: SHA-1-based signatures for trusted root certificates are not a problem because TLS clients trust them by their identity, rather than by the signature of their hash.

整個過程大約會在 2015Q1 告一個階段。

Firefox 也要支援 Public Key Pinning Extension for HTTP

在「Mozilla to Support Key Pinning in Firefox 32」看到的新聞,目前的標準還是 draft:「Public Key Pinning Extension for HTTP」。

被簡稱 PKP 與 HPKP:(一般比較常用前者)

We call this "public key pinning" (PKP); in particular, this document describes HTTP-based public key pinning (HPKP).

可以看到 Google Chrome 程式碼裡面是怎麼使用 PKP 技術預載的:「/trunk/src/net/http/transport_security_state_static.json」。

目前 Google Chrome 使用的方式是限制 Google 的網域只能由某些特定的 CA 才能簽,這樣可以降低其他 CA 簽出高經濟價值的 SSL certificate 的效益。

Mozilla 的 wiki 上面可以看到對應的條目:「SecurityEngineering/Public Key Pinning」,目前 Firefox 的版本是 31,也就是從下一個版本就支援了。

第一波的 32 版會支援 Mozilla 自己的某些站台,以及一些 Twitter 的網域。

第二波的 33 版會把 Twitter 的部份擴充到 *.twitter.com,另外還會支援 Google 所擁有的網域。

第三波的 34 版會支援 Firefox account (*.accounts.firefox.com)、Tor 以及 Dropbox

判斷是否為付費文章的瀏覽器套件

AdDetector 是個 ChromeFirefox 的套件,可以在頁面上顯示這篇文章是不是付費文章:

AdDetector reveals articles with corporate sponsors.

會在最上面出現紅底的警告說明:

這個套件之所以未被發展出來,主要是因為付費內容即使被標注,也都是很不明顯的標注。這個套件的目的就是希望讓標注更清楚。

Google Chrome 上使用 Native Client (NaCl) 執行 Vim...

Twitter 上看到有人講:「Vim console application running using NativeClient」,實際跑起來長這樣:

只是跑起來測試,因為平常用的平台 (UbuntuMac OS X) 都有原生的 Vim 可以用...

這算是 Native Client 的火力展示嗎?