TLSã¨SPDYã®éã§Google Chromeãããã£ãèå¼±æ§(CVE-2014-3166ã®è§£èª¬)
1. ã¯ããã«ã
Googleãããã£ãã·ãªã¼ãºç¬¬3å¼¾ãä»åº¦ã¯ Chrome ã®èå¼±æ§ããã¼ãã§ãã
å
æ¥(8æ12æ¥é ï¼çªç¶Google Chromeã§SPDYã®æ©è½ãä¸æ¦åæ¢ããã¾ãããCloudFareã®äººãæ°ã¥ãã¦spdy-devへのMLの問い合わせããããGoogleã®aglããããã®è¿äºã§è¨ç»çã§ä¸æçãªãã®ã§ãããã¨ããããã¾ããã
twitterãfacebookãSPDYãå
¨ã¦ä½¿ããªããªãé常ã«é©ããã®ã§ãããç´å¾ã« Chrome ã® Stable/Beta/Dev ãã£ã³ãã«ãã¢ãããã¼ããããã»ã©ãªããã¦åé¡ãªãSPDYã使ããããã«ãªãã¾ããã
ãã®çç±ã¯å ¬å¼ã«ã¯æããã«ããã¦ãã¾ããããChromeのリリースアナウンスã«ãã³ããããã¾ãããããã«ã¯ã
High CVE-2014-3166: Information disclosure in SPDY. Credit to Antoine Delignat-Lavaud.
ã¨ããèå¼±æ§ã®ä¿®æ£é ç®ããªã¹ãã¢ããããã¦ãã¾ããããããGoogleã¯ãèå¼±æ§å¯¾çãããChromeã®ãã¼ã¸ã§ã³ã¢ãããå®å ¨ã«è¡ããããä¸æçã«SPDYã®å©ç¨ãåæ¢ããã®ã§ã¯ãªããã¨æ¨æ¸¬ããã¾ãã
Creditã®è¨è¼ãããã®èå¼±æ§ã¯ãç´åã®8æ6æ¥ã«ç±³å½ã§éå¬ãããBlackHat 2014ã§ã®Antoine Delignat-Lavaudæ°ã®ã»ãã·ã§ã³「The BEAST Wins Again: Why TLS Keeps Failing to Protect HTTP」ãå ãã¿ã§ãã
ãã®ã»ãã·ã§ã³ã®çºè¡¨è³æãè«æã»åç»ã¯ãThe BEAST Wins Again: Why TLS Keeps Failing to Protect HTTPã«æ²è¼ããã¦ãã¾ãããã BlackHatè¬æ¼æã¯ã¾ã Chromeãæªä¿®æ£ã ã£ããã¨ããããSPDYã®èå¼±æ§ã«é¢ãã詳細ãªè¨è¼ãåç»ã¯å ¬éããã¦ãã¾ããã§ããï¼ç¾å¨ã¯åç»ã®ã¿æ²è¼ï¼ã
ç¾å¨ã® Chrome Stableã¯ç·æ¥é¿é£çãªèå¼±æ§ã®ä¿®æ£ã§ã根本的な修正ã¯ä½æ¥ä¸ã§ãããä¿®æ£ãããã¯ãã«ãå¾ã®ã¨ã©ã¼ã§æ°å revert ããã¾ãããããã£ã¨æ¨æ¥ã®Canary(39.0.2129)ã§ç¡äºèå¼±æ§å¯¾å¿ãå®äºããããã§ãã
ããã§ä»åããã®Chromeã®èå¼±æ§(CVE-2014-3166)ãã©ãããåå ã§çºçãã¦ãã©ã対çãããã®ãã«ã¤ãã¦è§£èª¬ããã¦ã¿ããã¨æãã¾ãã
tl;dr
ãã®è¨äºã¯TLSã»PKIã»SPDYã«ã¤ãã¦åºç¤çãªç¥èãæã¤æ¯è¼çä¸ç´è åãã®ãã®ã§ãããã®è¾ºã®ç¥èããªãåå¿è ã®æ¹ã¯ãèªãã§ããããããããéå±ãã¦ãã¾ããããããªãã®ã§æ³¨æãã¦ä¸ãããã¾ãå½åããã®èå¼±æ§ã®éµã¨ãªã Public Key Pinningæ©è½ã«ã¤ãã¦ä¸ç·ã«èª¬æãçãè¾¼ãã¤ããã§ãããããã¾ãã«é·æã«ãªã£ã¦ãã¾ãæãããããæ念ãã¾ãããè¿ããã¡ã«å¥è¨äºãåºãã¾ãã®ã§ãå¾ ã¡ãã ããã
2. CVE-2014-3166ã®èå¼±æ§ã¯ã©ããããã®ãï¼
CVE-2014-3166ã«ã¤ãã¦èª¿ã¹ã¦ãã¨ã CVEデータãè¦ã¦ã詳細ãã¯ã£ããããªãã§ããæ¦è¦ãå訳ããã¨ã
Google Chrome ã® Windows, OS X, Linux ã® 36.0.1985.143 以å㨠Android ã® 36.0.1985.135 以åãã¼ã¸ã§ã³ã§ã¯ãPublic Key Pinningå®è£ ãSPDYæ¥ç¶ã®ç¹æ§ãæ£ããèæ ®ãã¦ããªããããé éã®æ»æè ãè¤æ°ã®ãã¡ã¤ã³åãå©ç¨ãããã¨ã«ãã£ã¦éè¦ãªæ å ±ãå ¥æãããã¨ãã§ããã
ã¨æ¸ãã¦ããã ãã§ããçºè¡¨è³æãè«æãèªãã¨ãªãã¨ãªãæ³åã§ãã¾ãããèå¼±æ§ä¿®æ£å¾ã®åç»「Impersonation exploit against SPDY connection pooling」ãè¦ãã¨ãããããã¾ãããããå°ã詳ããæ¸ãã¨ã
æªæãããæ»æè ããä¸æ£ãªSSL証ææ¸ã使ããã¯ã©ã¤ã¢ã³ãã®DNSåå解決ãæä½ã§ããã¨ãGoogleã®ãµã¼ãã«æããã¾ããã¨ãã§ããã
ã¨ãããã¨ã§ããï¼å®éã«ã¯ããã¡ãã£ã¨æ¡ä»¶ãªãæä½ãå¿
è¦ã§ãï¼ã
æªæã®ãã第ä¸è
ãGoogleã®ãµã¼ãã¹ã«æããã¾ããã¨ãã§ããã°ãã¯ããã¼ãªãéè¦ãªæ
å ±ãæãã¾ããããã£ãã·ã³ã°ã§èªãè¾¼ããã¨ãå¯è½ã«ãªãã¾ãã
ããã§ãã®èå¼±æ§ã®éµã¨ãªã2ã¤ã®æè¡é ç®ãSPDYã³ãã¯ã·ã§ã³éç´ã¨Public Key Pinningã«ã¤ãã¦èª¬æãã¾ãã
3. SPDYã³ãã¯ã·ã§ã³éç´æ©è½
ç¾å¨GoogleãFacebookãªã©å¤§è¦æ¨¡ã«SPDYããµã¼ãã¹ã«å±éãã¦ãããµã¤ãã¯ãSSLã®è¨¼ææ¸ã«ã¯ã¤ã«ãã«ã¼ã証ææ¸(*.google.comã¨ã)ãå©ç¨ãã¦ãã¾ããSPDYã§ã¯ã¯ã¤ã«ãã«ã¼ã証ææ¸ã使ãã¨ãè¤æ°ãã¡ã¤ã³å®ã¦ã®HTTPãªã¯ã¨ã¹ãã»ã¬ã¹ãã³ã¹ã1ã¤ã®SPDYæ¥ç¶ã«ã¾ã¨ãã¦éç´ããå¤éåãããé«ãã¦éä¿¡ã®å¹çåãå³ããã¨ãã§ãã¾ãã
ãã ãç¡æ¡ä»¶ã«ã©ããªãã¡ã¤ã³å®ã¦ã®ãªã¯ã¨ã¹ãã»ã¬ã¹ãã³ã¹ãä¸ç·ã«ãªãããã§ã¯ããã¾ããã
- ã¯ã©ã¤ã¢ã³ããããµã¼ãã¸ã®æ¥ç¶ã¢ãã¬ã¹(DNSã§è§£æ±ºããæã®IPï¼ãåä¸ã§ããã
- æ¥ç¶å ã®ãã¹ãåãSSL証ææ¸ã§èªè¨¼ã§ããã
ã¨ãã£ãæ¡ä»¶ãå¿
è¦ã§ãã
ä¾ãã°Proxyæ¥ç¶ãã¦ããã¯ã©ã¤ã¢ã³ãã¯ãã½ã±ããã®æ¥ç¶ã¢ãã¬ã¹ãDNSã§è§£æ±ºãããµã¼ãã®ã¢ãã¬ã¹ã¨ç°ãªãã®ã§SPDYã³ãã¯ã·ã§ã³ã®éç´ããã¾ãããã¾ãåä¸ã®IPã§ããã°ãSSL証ææ¸(X509æ¸å¼)ã§ã® Common Name ã subjectAltName ãã£ã¼ã«ããè¦ã¦ãåä¸ã®è¨¼ææ¸ã§èªè¨¼ã§ãããã©ãã調ã¹ã¾ããChromeã¯ãã®ãã¹ãåã®ãã§ãã¯ã«RFC6125ã§è¦å®ããã¦ããæ¹æ³ã使ã£ã¦ãã¾ãã
å®éã«SPDYã®ã³ãã¯ã·ã§ã³éç´ãããã¦ãããã©ããã¯ã chrome://net-internals/#spdy ãè¦ãã¨ãããã¾ãã赤ç·ã§å²ã£ãé¨åãè¦ãã¨è¤æ°ãã¡ã¤ã³ãï¼ã¤ã®SPDYæ¥ç¶ã«éç´ããã¦ããã»ãã·ã§ã³ã§ãã
ä»åã®èå¼±æ§ã¯ããã®SPDYã®ã³ãã¯ã·ã§ã³éç´æ©è½ãå©ç¨ãã¦Googleã®ãµã¼ãã«æããã¾ããè¡ããã®ã§ããã
4. Public Key Pinningæ©è½
ãã®æ©è½ã®è©³ç´°ã¯å¥è¨äºã§ç´¹ä»ããäºå®ã§ããç°¡åã«æ¸ãã¨ãä¸æ£ã«çºè¡ããã証ææ¸ãã©ãããã©ã¦ã¶ããã§ãã¯ã§ããæ©è½ã§ãã
è¿å¹´ãã©ã¦ã¶ã«ç»é²ããã¦ããæ£å¼ãªèªè¨¼å±(CA)ãå¤é¨ããä¾µå
¥ãåããä¸æ£ãªgoogle.comãã¡ã¤ã³ãªã©ã®è¨¼ææ¸ãçºè¡ããã¦ãã¾ãäºä»¶ãèµ·ãã¦ãã¾ããæ®éã¯æ£å¼ãªèªè¨¼å±ããçºè¡ãããä¸æ£ãªSSL証ææ¸ã®è¦åããã¤ããªãã®ã§ãããPublic Key Pinningæ©è½ã使ãã¨è¦ç ´ããã¨ãã§ãã¾ãã
ç¾å¨ IETF ã§仕様ãæ¤è¨ãããIESGã¬ãã¥ã¼ä¸ã§RFCåç´åã«ãªã£ã¦ãã¾ãã
ä»åã®èå¼±æ§ã¯ä¸æ£ãªSSL証ææ¸ã¨SPDYã³ãã¯ã·ã§ã³éç´ã使ãããã® Public Key Pinning ã®ãã§ãã¯ã®ãã¤ãã¹ãçããã®ã§ããã
5. CVE-2014-3166ã®èå¼±æ§ã®åå ã¨å¯¾ç
ãã£ã¨èå¼±æ§ã®è§£èª¬ã®æ¬ä¸¸ã§ããèå¼±æ§ã®åå ã¯ãChromeã®SPDYå®è£ ã§ã³ãã¯ã·ã§ã³ã®éç´ãè¡ãéã«ä»¥ä¸ã®ï¼é ç®ã®ãã§ãã¯ãæãã¦ãããã¨ã§ãã
- éç´ããæ¢åã®TLSæ¥ç¶ãã¨ã©ã¼ï¼expireã証ææ¸ãã§ã¼ã³ã®æ¤è¨¼ã«å¤±æçï¼ã«ãªã£ã¦ããªãã?
- éç´ããéã«å¯¾è±¡ã®ãã¡ã¤ã³ã® Public Key Pinning ã§ç»é²ããããã®ã¨æ¢åã®TLSæ¥ç¶ã®è¨¼ææ¸ãä¸è´ãããï¼
ãã®æããå©ç¨ããã¨ãGoogleãµã¼ãã«æããã¾ãã«ã¯ä»¥ä¸ã®æé ã«ãªãã¾ãã
- Googleãã¡ã¤ã³ã¨æ»æè ãã¡ã¤ã³ã®ä¸¡è ã§æå¹ãªè¨¼ææ¸ã¨SPDYãµã¼ããç¨æããã
- ãã£ãã·ã¥ãã¤ãºãã³ã°ãªã©ã«ãã£ã¦ã¯ã©ã¤ã¢ã³ãå´ã®DNSåå解決ãæä½ãã¦ãæ»æè ãµã¼ãå´ã«Googleãµã¼ãã¹ã®å½IPã¢ãã¬ã¹ãåããã
- ã¯ã©ã¤ã¢ã³ãããæ»æè ãã¡ã¤ã³ã®ãµã¼ãåãã«æåã®SPDYã»ãã·ã§ã³ãå¼µãããã
- å½IPã¢ãã¬ã¹ã®Googleãµã¼ãã¹ã«ã¢ã¯ã»ã¹ããããã«èªå°ããã
- ã¯ã©ã¤ã¢ã³ãã¯ä¸æ£ãªSSL証ææ¸ã ã¨ã¯æ°ä»ããã«ãæ»æè ãæããã¾ããGoogleã®ãµã¼ãã¸ã®ã¢ã¯ã»ã¹ããã
ã¨ããæé ã«ãªãã¾ãã
ãã®æé ãå®éã«è©¦ãã¦ã¿ã¾ããããsubjectAltName㧠hoge.example.jp 㨠*.iijplus.jp ã®äºã¤ã®ãã¡ã¤ã³ãç»é²ãã証ææ¸ãä½æãã¾ãããã ãCAã«ä¾µå
¥ãã¦ä¸æ£çºè¡ããã®ã¯ãã£ã¨é£ããã®ã§ãèªå·±ç½²å証ææ¸ã使ãã¾ãã
DNSæ
å ±ãæ¸ãæããæ¿ããã«ãhostsãã¡ã¤ã«ã§ä¸¡ãã¡ã¤ã³ãåãã¢ãã¬ã¹ã«åãã¾ãã *.iijplus.jpãã¡ã¤ã³ã®Public Key Pinningã®è¨å®ããã¦ãæ£å¼ãªè¨¼ææ¸ã®å
¬ééµã®ããã·ã¥å¤ãããããããã©ã¦ã¶ã«ç»é²ãã¦ããã¾ãããã®ããæ¹ã¯å¥è¨äºã§æ¸ãã¾ããDNSæ
å ±ãæ¸ãæããã®ã§ã¯ãªããhostsãã¡ã¤ã«ã§åãã¢ãã¬ã¹ã«åãã¾ãã
èå¼±æ§å¯¾çåã®Chrome Stable(36.0.1985.125)ã§æ¥ç¶ãã¦ã¿ã¾ãã
æåã« hoge.example.jpã®ãã¼ã¸ã«æ¥ç¶ãããã®å¾ demo-int.iijplus.jp ã«æ¥ç¶ããã¨ãSPDYã»ãã·ã§ã³ãéç´ããã¦ãããã¨ããããã¾ããèªå·±ç½²å証ææ¸ãªã®ã§ãSSLã¨ã©ã¼éç¥ã®ç»é¢ãåºã¦ããã®ã§ãããæå hoge.example.jp ã許å¯å¾ demo-int.iijplus.jp ã®æ¥ç¶ã«ã¯è¦åãã¼ã¸ãåºã¦ãã¾ããããã©ã¦ã¶ã®ã¢ãã¬ã¹ãã¼ã«ã¯è¦åãã¼ã¯ãåºã¦ãã¾ãã
ç¾ç¶ã® Chrome Stable ã¯ãç·æ¥é¿é£çã«ä¸å¾ã«SPDYã®ã³ãã¯ã·ã§ã³éç´ãç¡å¹ã«ãã対çãæ½ããã¦ãã¾ãããæ¨æ¥ã®Chrome Canary(39.0.2129)ãããSPDYã³ãã¯ã·ã§ã³éç´æã«SSLã¨ã©ã¼ã¨Public Key Pinningãã§ãã¯ãè¡ãå¦çã追å ããã¾ãããèå¼±æ§å¯¾çã®æå¹æ§ã確èªããããCanaryã§åæ§ã®è©¦é¨ããã¦ã¿ã¾ãï¼ãã ãSPDYæ¥ç¶ã®åé¢ãè¦ããã Public Key Pinningã®è¨å®ã¯å¤ãã¾ãï¼ãSPDYã»ãã·ã§ã³ã¯æ¬¡ã®ããã«ãªãã¾ããã
ä¸æ£ãªSSL証ææ¸ã使ã£ã hoge.example.jp 㨠demo-int.iijplus.jp å®ã¦ã®æ¥ç¶ãéç´ããã¦ããããå¥ã
ã®SPDYæ¥ç¶ã«ãªã£ã¦ãã¾ããSSLã¨ã©ã¼ãã§ãã¯ãå¹ãããã¨ã«ãããã®ã§ãããã®ä»ã®æ£å¼ãªGoogleãµã¼ãã¹ã¸ã®æ¥ç¶ã¯åé¡ãªãéç´ãããPublic Key Pinningã®è¨å®ããã¦ã¿ãã¨demo-int.iijplus.jp ã¸ã®æ¥ç¶ã¯é®æããã¦ã¡ããã¨è¨¼ææ¸ãã§ãã¯ãåãã¦ããã®ããããã¾ããã
ãã®æ»æãæ¬å½ã«ã¹ãã«ã¹çã«ããã«ã¯ãCAã«ä¾µå ¥ãã¦ä¸æ£ãªSSL証ææ¸ãå ¥æããã¯ã©ã¤ã¢ã³ããããã¯ã¼ã¯ã«MITMã®ç°å¢ãä»è¾¼ãã¨ãããªããªãé«ããã¼ãã«ãå¿ è¦ã§ãããæ¨ä»ã®NSAã«ãããããã¯ã¼ã¯çè´ãæ¹ããã®ææ³ãèãã¨çµ¶å¯¾å®ç¾ä¸å¯è½ã¨ãè¨ããªããã¨æãã¾ãã
6. TLSã¨SPDYã®éã«ããéé
ãã®èå¼±æ§ã®çºè¦è Antoine Delignat-Lavaud æ°ã¯ãIETF ã® TLS WGã®ã¡ã¼ãªã³ã°ãªã¹ãã§ãç¾ç¶ã®TLSã¨SPDYã®ä»æ§ã®éã§èæ ®ããã¦ããªãé¨åãããã®ãåé¡ã ã¨ææãã¦ãã¾ã(Re: Inter-protocol attacks)ã
TLSã使ã£ãSPDYã®åææ¥ç¶æã¯ãã¯ã©ã¤ã¢ã³ãã¯TLSä¸ã§ãµã¼ã証ææ¸ã§æ¥ç¶ãµã¼ããæ£å¼ãªãã®ãèªè¨¼(Authentication)ãããµã¼ãã¯TLSã®èªè¨¼æ å ±ãSPDYã®:hostããããªã©ä½¿ãã©ã®ãã¼ã¸ã«ã¢ã¯ã»ã¹ã§ããã®ãèªå¯(Authorization)ãè¡ããã¾ããããããåæ¥ç¶æ(resumption)ã¯ãTLS㯠session ID, ticket, channel ID çã®ä»çµã¿ã使ã£ã¦åæ¥ç¶ãã¾ãããSPDYã®åæ¥ç¶ã¯TLSæ¥ç¶ã®åå©ç¨ãè¡ãã®ã§TLSã®åæ¥ç¶ã®ä»çµã¿ã使ãã¾ããã
åææ¥ç¶æ㯠TLSã¨SPDYã®èªè¨¼ã»èªå¯ã®æ©è½ã¯ããç¨åº¦é£æºã§ãã¦ããã®ã«ãåæ¥ç¶æã¯å
¨ãéããã®ã«ãªã£ã¦ãã¾ã£ã¦ããã Antoine Delignat-Lavaud æ°ã¯ããããæ確ã«ãã¦ã¡ããã¨ä»æ§ã§å®ç¾©ãã¦ããå¿
è¦ãããã®ã§ã¯ã¨TLS WGã®MLã«æãããã¦ãã¾ãã
ä»åã®èå¼±æ§ã¯ãã¾ãã«ãã®TLSã¨SPDYã®éã«ããã£ãäºä¾ã ã¨è¨ããã§ãããã
ç¾å¨LastCallçµäºç®åã® HTTP/2 ã®ä»æ§ã§ã¯ãã®é¨åã«ã¤ãã¦9.1.1 Connection Reuseã®ç¯ã§ãsubjectAltName ãSNIã®å©ç¨ã«ã¤ãã¦ã®æ³¨æãè¨è¼ããã¦ãã¾ãããã®è¨è¼ã§æ¬å½ã«ååãã©ããã¯è°è«ãåãããã¨ããã§ãã
å½¼ã®çºè¡¨ã§ã¯ãä»ã«ãTLSã®ãã³ãã·ã§ã¤ã¯ã®SNIï¼Server Name Indicator)ã§æå®ãããµã¼ãåã¨HTTPä¸ã®ãã¹ãããããç°ãªãå ´åã«ä¾å¤å¦çãã¡ããã¨ããã¦ãªãããã«èå¼±æ§ãåå¨ãã¦ãããã¨(VirtualHost Confusion)ãææãã¦ãã¾ãã
å½¼ã®çºè¡¨ã§ã¯ãéç´åã®SSLãã¹ãã£ã³ã°ãCDNã§ã® exploit åç»ãå
¬éãã¦ãã¾ãããç¹ã« OpenProxyãçªããAkamaiã®èå¼±æ§ã«ã¯ã³ã£ãããnsa.govã®ãµã¤ããæããã¾ãã¦ãã¾ãã
ä»ã«ããåå²ãããTLSã»ã°ã¡ã³ããåãæ¨ã¦ããã¨ã«ããä¸å®å ¨ãªãã¼ã¿ã®åä¿¡ãçªãCookie Cutterèå¼±æ§ãã 2ã¤ã®TLSã»ãã·ã§ã³ã® master secret ãåæããã証ææ¸ãå¤æ´ãã renegotiation ã«ãã£ã¦ãä¸æ£ãã¼ã¿ãå ¥ãè¾¼ã Triple Handshake ãªã©TLSãã¿ãçãã ãããã§ãã
TLSã»ãã¥ãªãã£ã®æåç·ã«èå³ã®ããæ¹ã¯ãexploit åç»ã ãã§ãè¦ã¦ããã¦ãæã¯ãªãã¨æãã¾ãã