タグ

JavaScriptとsecurityに関するnagayamaのブックマーク (2)

  • imagejs

    imagejs is a small tool to hide javascript inside a valid image file. The image file is recognized as one by content checking software, e.g. the file command you might now from Linux or other Unix based operation systems. BMP Images are now viewable! By adding -l to the command an image is not only valid and runnable javascript, it can also be shown by a viewing program or a browser. Below you can

  • 機密情報を含むJSONには X-Content-Type-Options: nosniff をつけるべき - 葉っぱ日記

    WebアプリケーションにおいてJSONを用いてブラウザ - サーバ間でデータのやり取りを行うことはもはや普通のことですが、このときJSON内に第三者に漏れては困る機密情報が含まれる場合は、必ず X-Content-Type-Options: nosniff レスポンスヘッダをつけるようにしましょう(むしろ機密情報かどうかに関わらず、全てのコンテンツにつけるほうがよい。関連:X-Content-Type-Options: nosniff つかわないやつは死ねばいいのに! - 葉っぱ日記)。 例えば、機密情報を含む以下のようなJSON配列を返すリソース(http://example.jp/target.json)があったとします。 [ "secret", "data", "is", "here" ] 攻撃者は罠ページを作成し、以下のようにJSON配列をvbscriptとして読み込みます。もちろ

    機密情報を含むJSONには X-Content-Type-Options: nosniff をつけるべき - 葉っぱ日記
  • 1