Cake Phpでの安全なサイトの作り方2(Xss)

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Cake Phpでの安全なサイトの作り方2(Xss) - Presentation Transcript

    1. CakePHP での安全なサイトの作り方 2 ~クロスサイトスクリプティング~ 第 12 回 高蔵寺 SE 勉強会  2008/8/24 (日)
    2. クロスサイトスクリプティングとは
    3. Web サイトの訪問者の入力をそのまま画面に表示する掲示板などのプログラムが、悪意のあるコードを訪問者のブラウザに送ってしまう脆弱性のこと。 IT 用語辞典より
    4. クロスサイトスクリプティングの 脆弱性があるとどうなるのか?
    5. ・ Cookie の漏えい ・ページの改ざん
    6. サンプルを紹介します (別画面になります)
    7. CakePHP ではどのように対応するか?
    8. 例 <?php e(h($value)); ?> View において、 h(htmlspecialchars) を付けて表示させる cake/basics.php で、下記のように処理されている htmlspecialchars($text, ENT_QUOTES, $charset);
    9. 注意点 htmlspecialchars($text, ENT_QUOTES , $charset); 先ほどの例の 「 ENT_QUOTES 」がないと、シングルクオート をエスケープしてくれないので、これが入っていることが重要! ちなみに、これは CakePHP1.2 の話。では、 1.1 では????
    10. CakePHP1.1 の場合 htmlspecialchars($text); cake/basics.php でどの様に書いてあるかというと、 「 ENT_QUOTES 」がないですね。  入れておきましょう!!
    11. これで安心? CakePHP では表示する部分に全て h を付ける事で クロスサイトスクリプティングが防げるかというと、そうでもない。 script タグ、 style タグ、タグの属性に動的要素を出力する場合は、 h を付けてもクロスサイトスクリプティングが起こりうる可能性があるので、注意を払う必要がある。
    12. 終わり

    + あつ あつ , 2 years ago

    custom

    1659 views, 0 favs, 0 embeds more stats

    第12回の高蔵寺SE勉強会の資料です

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1659
      • 1659 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 0
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories

    Tags