主题潜在 XSS 安全问题修正
感谢这位朋友的提醒,我对所有主题可能存在的 XSS 安全问题进行了修正。
这次更新实际上在8月4号就已经完成,涉及 Unnamed,Unnamed Special Edition,Blue Memories 和 Spring。
由于之前已经针对 functions.php 做了一次大面积的修正,所以 Unnamed 1.2 及以上版本只涉及两处改动,使用者可以用新版本的 theloop.php 和 livesearch.js.php 替换原有文件即可。或者如果你愿意手动修改代码,可以将 theloop.php 中的
printf(__(‘Search Results for \’%s\”,’unnamed’), $s);
替换为:
printf(__(‘Search Results for \’%s\”,’unnamed’), attribute_escape(stripslashes(get_query_var(’s’))));
并使用下面的代码替换 livesearch.js.php 的最后一行:
FastInit.addOnLoad( function() { new Livesearch(’searchform’, ‘<?php bloginfo(‘template_url’); ?>/livesearch.php’, ’searchquery=’, ‘<?php echo attribute_escape(__(‘Type and Wait to Search’,'unnamed’)); ?>’); } );
类似的,Blue Memories 需要替换原有的 theloop.php,而 Spring 需要替换原有的 theloop.php 和 searchform.php。
而 Unnamed Special Edition 由于之前并未对此问题作特殊处理,所以建议进行一次整体更新,如果是从 1.02 更新的话,需要替换 theloop.php,livesearch.js.php 和 functions.php。
I’ve fixed some XSS vulnerabilities in Unnamed, Unnamed Special Edition, Blue Memories and Spring. Please download the latest versions to fix the problem.
Great thanks to Phoenix and Vite Digitali.