冰古blog » 冰古相关 » 2005 » 05 » 28 » What’s wrong!

What’s wrong!

WordPress1.5.1版本问题可真不少,前段时间是trackbacks的问题,更新到1.5.1.1。现在有出现了安全问题(安全最重要!)!看看是怎么回事!

It has come to our attention that under certain circumstances there is a security vulnerability in WordPress that may be triggered if you’re running the default template. We were able to respond very quickly (under 40 minutes) and update the download to 1.5.1.2. You can upgrade by overwriting your old 1.5 files or if you would like to apply the fix manually it is relatively simple:

1、Open the wp-includes/template-functions-category.php file in a text editor like Wordpad.
2、Go to around line 103 where it says get_the_category_by_ID.
3、Create a new line after that and paste in $cat_ID = (int) $cat_ID;

One note, even if the vulnerability was present in your blog, you would still be safe if your host ran mod_security on their servers. It is an Apache module which can provide very high-level protection against everything like the vulnerability above to comment spam. We will be updating the hosting page shortly to reflect which hosts there support mod_security or not.

当你使用的theme是默认theme的时候,将会引发这个安全漏洞(其他模板不会??为了更安全还是补上的好!),但如果你的服务器运行于mod_security下,这个问题也就不是问题了!(我在使用的服务器没有这个哦~查看方法:下载一个PHP探针,打开后,看“服务器解译引擎”或phpinfo中的”SERVER_SOFTWARE”)

补丁方法:
1、去wordpress下载1.5.1.2版本,覆盖原文件即可;
2、如果你想自己动手,很简单。打开wp-includes/template-functions-category.php(可以在后台的Manage→Files中打开,方便!),查找到get_the_category_by_ID(在103行,是个函数名),在这行的下面加上$cat_ID = (int) $cat_ID;
既是把
function get_the_category_by_ID($cat_ID) {
$category = &get_category($cat_ID);
return $category->cat_name;
}
改为
function get_the_category_by_ID($cat_ID) {
$cat_ID = (int) $cat_ID; //添加这行
$category = &get_category($cat_ID);
return $category->cat_name;
}

Comments are closed.