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?

サニタイズとは

Last updated at Posted at 2025-12-22

業務の中でサニタイズという用語が出てきたのでそれについてまとめる

サニタイズ

  • サニタイズはwebアプリケーションセキュリティの分野で、ユーザーからの入力データや外部データに含まれる、不正なコードや悪意のある文字列を無効化する処理のこと

目的

  • 一般的なweb攻撃であるXSSを防ぐ
  • 不要な部分を削除してデータの信頼性を高める

  • テキストコードに悪意のあるHTMLなどが入力された場合
    悪意のある入力:Bob <script>alert('XSS攻撃!');</script> Smith
    PHP/WP関数:sanitize_text_field()
    サニタイズ後の表示結果:Bob Smith

  • メールアドレス入力欄に空白が含まれていた場合
    無効な入力:user@example   .com
    PHP/WP関数:sanitize_email()
    サニタイズ後の表示結果:user@example.com

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?