CSS3 の新しい機能はサイド·チャンネル攻撃に弱く、FacebookなどのSNSから個人情報を抜き出す事が出来る

2018.06.04

投稿者 :ブルーネット・ジャスティン

カテゴリ: IT News

こんにちは、ジャスティンです。

最近、Webのセキュリティの世界で危険な所が出てきているようです。CSS3が公開されたのはまだ一年ですが、もうバグが発見されました。
元の記事は:
https://www.evonide.com/side-channel-attacking-browsers-through-css3-features/
になります。
[日本語]

CSS3の新しいツールはサイド·チャンネル攻撃に弱く、Facebookの匿名を公開できる
 
ネットの匿名や情報防衛はセキュリティの最前線になっております。Facebookの社長、マーク·ザッカバーグ氏(Mark Zuckerberg)はユーザー情報漏洩の事件でアメリカ合衆国の国会で証言することがありました。しかし、このように広告会社に情報が漏れることだけが心配事ではありません。CSS3で登場した新しい機能を使う事で、サイド·チャネリング攻撃でソーシャル·メディア·ユーザーの個人情報を抜き出せる事が発見されました。
 
CSS3とHTML5には大規模な機能の追加により攻撃が可能となる表面積も増加しています。Googleのセキュリティ研究者、ルスラン・ハバロフ氏(Ruslan Habalov)とダリオ・バイイア氏(Dario Weißer)はCSS3のブレンド·ミックス·モード(Blend-Mix-Mode)にバグを見つけ、他のサイトから情報を入手出来てしまうことを証明しました。
 
CSSのiframeのDOMにはクロス·オリジン·リソース(Cross-Origin Resource)は通常禁止されています。
しかし、調査の結果バグが発見されました。
 
Iframeはリンクされたサイトの情報を表示してるので、研究者達はCSSの様々なツールを試して、ブラウザーとの対話でどのような状態情報が漏れるのかを確認しました。これによりCSS3のブレンド·ミックス·モードがクロス·チャンネル攻撃ができることを見つかりました。
 
このサイド·チャンネル攻撃は下記のような流れです:
1)ブレンド·ミックス·モードを付けたDIV属性を大量に重ねて、目的のiframeの上に重ねます。
2)下のピクセルの色はレンダリング時間で確認できます。
3) このDIVの "スキャン"スタックをiframeに移動させてレンダリング時間を測定すると、iframeの内容が明らかになります。
 
クリックジャッキング(Clickjacking)の似たような攻撃はJavaScript iframe busterやhttp header X-Frame-Optionsで対策はできておりますが、このサイド・チャネリング攻撃を使うと、ユーザーがソーシャルメディアアカウントにログイン中に個人情報を抜き出す事が出来ます。研究者のコンセプト証明は下記のリンクで証明しております:
https://www.evonide.com/wp-content/uploads/2018/05/image2.gif
https://www.evonide.com/wp-content/uploads/2018/05/image4.gif

この攻撃では、ユーザー名は20秒、プロフィール写真は5分、「いいね」されたサイトは500ミリ秒で盗み出せる事になっています。JavaScriptのパフォーマンスAPIのため、この攻撃スタイルは16ms(60Hz)あたり1ビットに制限されていました。
 
CSSブレンドモードは、PhotoshopやGimpと似ていて、積み重ねられたレイヤーが複数の方法で相互作用できるようになっております。 例えば、ブレンドは原点間のiframeと相互作用し、色を乗算して、color(bottom_layer)×color(top_layer)= new_color、またはrgb(255,255,255)と(255,0,0)は(255,0,0)となります。 乗算関数は単純すぎて、目的内容とは無関係に常に同じ計算時間になりますが、より多くの計算集約型ブレンドモードでは、「彩度」などの必要な再レンダリング時間がかかり、ピクセルの色を確認できることになります。研究者は以下のように擬似コードを提供します。



複雑さは乗算演算と比較しますと、入力した色に応じて色んなブランチを使用していることが重要です。これは、色んな色のレンダリング時間を強制し、どの色が使用されているかを明らかにします。たとえ、黒色のピクセルを表示するために、いくつかの彩度レイヤーを前処理ステージに積み重ねます:
|彩度|
|彩度|                        トリガー遅延(>200 層)
|彩度|
|前処理|
|クロスオリジンiframe|(目標ピクセル)

 
彩度の層は、同じ彩度ブレンドモードを適用してレンダリング時間に測定可能な遅延を引き起こるようになっています。iframeピクセルは任意の色を持つことができるため、彩度スタックを直接渡すことはできません。
 
バグの詳細については、前述のリンクの研究者レポートで詳しく説明しています。 最近のMeltdown and Spectreのウイルスは、サイドチャンネルの悪用がパッチを当てる事を困難にしていることに注意することが重要です。「私たちはFacebookに対する攻撃の可能性しか実証していません。 しかし、ウェブ全体では、このような攻撃の影響を受ける可能性のある他の重要なリソースが数多く存在します。」とハバロフ氏とバイイア氏は語りました。このCSS3のバグは氷山の一角なので、他の潜在バグにより社会から様々な情報を抜き出されてしまう可能性があります。 研修者たちの調査が進み、もっと多くのバグが明らかになってくれることを願います。
[English]

CSS3 Side-Channeling Attacks De-anonymizes Facebook Users
 
Online anonymity and protecting private information is in the forefront of IT security. Facebook CEO Mark Zuckerberg was under fire after from US Congress for security leaks that had occurred with the data firm Cambridge Analytica. But recent findings have found that data sharing amongst advertisers is not the only concern. Exploiting the recent additions to CSS3 can be used to de-anonymize social media users in a side-channeling attack.
 
The staggering additions added to CSS3 and HTML5 increased the attack surface of browsers and increasing the risk of security holes. Google security researcher Ruslan Habalov in collaboration with Dario Weißer found an exploit with CSS3’s “mix-blend-mode” that can leak information from other sites. 
 
The vulnerability was discovered by assessing the DOM of the CSS iframe which includes a cross-origin resource though usually forbidden by default. Since the iframe shows the content from the linked site, the researchers tested various CSS features to see if it would leak state information with interactions with browser features. They found that the “mix-blend-mode” has a bug that can be used for side-channel attacking.
 
The side-channeling attack works as follows: 1) a large stack of DIV elements with “mix-blend-mode” is overlayed on a target iframe with cross-origin. 2) The color of the underlying pixel can be determined by the amount of time it takes to render the DIV stack. 3) Moving the DIV “scan” stack across the iframe to measure the rendering times reveals the iframe’s content.
 
Similar attacks such a clickjacking are mitigated by JavaScript iframe busters and http header X-Frame-Options. However, this side-channeling attack still leaves personal data vulnerable while a user is logged onto a social media account. In a proof-of-concept, Habalov and Weißer have demonstrated here:
https://www.evonide.com/wp-content/uploads/2018/05/image2.gif
https://www.evonide.com/wp-content/uploads/2018/05/image4.gif
The attack took 20 seconds for the username, 5 minutes for the profile picture and 500 milliseconds for all sites that they liked. Due to the JavaScript performance APIs, this style of attack was limited to 1 bit per 16ms (60 Hz).
 
The CSS blend mode is similar to what is found in Photoshop or Gimp and allow stacked layers to interact in an abundance of ways. For example blend will interact with cross-origin iframes and multiply the colors to compute a new color such as: color(bottom_layer) × color(top_layer) = new_color, or in terms of rgb (255, 255, 255) and (255, 0, 0) will result in (255, 0, 0). Though a simple multiply function will always amount to the same computation time independent of the underlying content, more computation intensive blend modes would reveal the necessary re-rendering times such as “saturation.” The researchers provide a pseudocode as follows:



It is important to note that the complexity compared to multiply operation and using different branches depending on the input colors. This forces different rendering times for different colors, revealing which starts to reveal which colors are being used. To reveal black pixels, several Saturation layers were stacked on a preprocessing stage:
|Saturation|                     
|Saturation|                      Trigger delay (>200 layer)
|Saturation|                    
|Preprocess|                   
|Cross-Origin Iframe|     (target pixel)
 
The saturation layers are the same applying saturation blend mode with enough layers to cause a measurable delay in rendering time. Because the iframe pixel can have an arbitrary color, the saturation stack cannot be passed directly to it.
 
A more in depth coverage of the exploit is described at the researchers report in the link above. It is important to note that the recent Meltdown and Spectre virus showed that side-channel exploits are hard to patch.  Habalov and Weißer note, “We have only demonstrated the attack potential against Facebook. However, throughout the web there are tons of other sensitive resources which could be affected by attacks like this in a similar fashion.” While this only scratches the surface of CSS3 features, it already exposes the potential of how much information can be leaked from social media. We should expect more exploits to reveal itself in the future.