0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

XSS(クロスサイトスクリプティング)と予防

Posted at

はじめに

メモ程度ではあるが、XSSについてアウトプットし理解を深める。

XSSとは

クロスサイトスクリプティングのこと。
動的なWebサイトの脆弱性を悪用した攻撃。

例えば悪意あるユーザが攻撃用のスクリプトをサイトの入力に含め、Webサイトがそれを表示、実行することにより利用者が意図しないコードを実行できてしまう。

予防策

  • サニタイジング
    HTMLタグやスクリプトタグをエスケープし無害化する。

  • 入力制限
    不必要な入力値を許容しないようにする。

  • CSPの設定
    コンテンツの取得元やスクリプトの実行を許可するドメインを制限する。

  • Cookieへのアクセス制御
    Set-CookieHttpOnly属性の設定しCookie情報へのアクセスを制限する。どちらかというと攻撃された時の軽減策。
    尚、Secure属性は中間者攻撃の予防に役立つらしい。

  • WAFの導入
    一般的なXSSは防いでくれるらしい。
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?