WordPressでXSSの可能性?
社内のツールでWordPress2.5に対してセキュリティ診断かけたら、
1件Criticalが見つかるという始末。。
ちなみにWordPressはインストールしてすぐのデフォルトスキンの状態です。
コメントとトラックバックは無効にしました。
どこがXSSの原因になるのかと言うと、サイト内検索の結果画面でサイドバーに検索クエリーを表示をエスケープしてません。貼り付けた画像の赤い四角で囲ったところです。
修正箇所はwp-content/themes/default/sidebar.phpの33行目あたりになります。
get_search_query()をエスケープしてやればOKです。
<?php /* If this is a monthly archive */ } elseif (is_search()) { ?> - <p><?php printf(__('You have searched the <a href="%1$s/">%2$s</a> blog archives for <strong>‘%3$s’</strong>. If you are unable to find anything in these search results, you can try one of these links.', 'kubrick'), get_bloginfo('url'), get_bloginfo('name'), get_search_query() ); ?></p> + <p><?php printf(__('You have searched the <a href="%1$s/">%2$s</a> blog archives for <strong>‘%3$s’</strong>. If you are unable to find anything in these search results, you can try one of these links.', 'kubrick'), get_bloginfo('url'), get_bloginfo('name'), htmlspecialchars(get_search_query(), ENT_QUOTES) ); ?></p>
しかしコメント不可にしてるし、XSSは出ないだろーと思ったら
思いっきり見つかったので有名なソフトでも安心はできないですね。。