otsune tumblr まとめサイト 画像保管庫Q


Click here to lend your support to: tombloo and make a donation at www.pledgie.com ! View my page on tumblrist

ブログパーツならブログデコ!!

JSONのクロスドメイン制約を回避する攻撃方法としては、例えば__defineSetter__を使う方法や、UTF-7を使う方法などが知られています。具体的な攻撃方法の詳細は省略しますが、いずれの方法でも、JSONを攻撃者サイト上で<script>要素を使ってJavaScriptソースとして読み込むことで、Same Origin Policyを回避し、攻撃者の用意したJavaScriptから、JSON内のデータへのアクセスを可能にしています。

 XMLHttpRequestを使って、正規のWebアプリケーションのみJSONを読み込めるようにし、攻撃者サイトからの<script>によるJavaScriptソースとしての読み込みを防ぐためにはいくつかの方法があります。その場合、POSTのみに対応し、GETでのリクエストではJSONを返さないという対策をお勧めします。これは、ほかの方法に比べ副作用が小さく、後に示すJSONによるXSSへの対策にもなるからです。

[さらに気になる]JSONの守り方 - @IT (via dara-j)
otsune
Comments (18 notes)

Comments

  1. uchidajiro reblogged this from otsune
  2. takaakik reblogged this from tsukamoto
  3. tsukamoto reblogged this from otsune
  4. fafnir reblogged this from amiens2009
  5. amiens2009 reblogged this from otsune
  6. ryka reblogged this from d-d-d
  7. oosuka reblogged this from otsune
  8. d-d-d reblogged this from otsune
  9. forzando reblogged this from otsune
  10. softbear reblogged this from otsune
  11. shckor reblogged this from otsune
  12. tk78 reblogged this from otsune
  13. -nobby- reblogged this from otsune
  14. mthr reblogged this from otsune
  15. quote-list reblogged this from otsune
  16. otsune reblogged this from dara-j
  17. dara-j posted this