otsune tumblr まとめサイト 画像保管庫Q
otsune
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)Comments
-
uchidajiro
reblogged this from
otsune
-
takaakik
reblogged this from
tsukamoto
-
tsukamoto
reblogged this from
otsune
-
fafnir
reblogged this from
amiens2009
-
amiens2009
reblogged this from
otsune
-
spherical-moss liked this
-
ryka
reblogged this from
d-d-d
-
oosuka
reblogged this from
otsune
-
proto-jp liked this
-
d-d-d
reblogged this from
otsune
-
forzando
reblogged this from
otsune
-
softbear
reblogged this from
otsune
-
shckor
reblogged this from
otsune
-
tk78
reblogged this from
otsune
-
-nobby-
reblogged this from
otsune
-
mthr
reblogged this from
otsune
-
quote-list
reblogged this from
otsune
-
otsune
reblogged this from
dara-j
-
dara-j
posted this

