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?

【4個目】【XSS】Stored DOM XSS

Posted at

タイトル

Stored DOM XSS

概要

replaceによる脆弱性を利用し、投稿したコメントでスクリプトを実行させる格納型XSSとDOM-based XSSの複合攻撃

攻撃手順

  • 投稿したブログコメントがどういう形式で挿入されるかを確認
  • 開発ツールでコメント文字列がどうやってDOMに挿入されているのかを確認
  • 関連箇所の外部JSファイルを確認し、エスケープするためにreplaceを使用していることを確認
  • replaceは一個目にマッチした文字列のみを置換するため、二個目以降にスクリプトを挿入するスクリプトを作成

対策

  • 二個目以降にマッチする文字列も置換されるようにする
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?