Skip to content

Instantly share code, notes, and snippets.

@ts0818
Last active November 5, 2015 08:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ts0818/d5a3a8cafa45cfd32ebb to your computer and use it in GitHub Desktop.
Save ts0818/d5a3a8cafa45cfd32ebb to your computer and use it in GitHub Desktop.
パーフェクトPHP パス・ディスクロージャ
<?php
/**
* このプログラムは脆弱性のサンプルです。
* 公開サーバに設置しないでください
*/
// GET変数で指定があった場合は、出力する$string変数にセット
if (isset($_GET['string']) === true) {
$string = $_GET['string'];
} else {
$string = '';
}
// $string変数をエスケープして出力
echo htmlspecialchars($string, ENT_QUOTES, 'utf-8');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment