Uh-oh. According to this security announcement from WordPress, a server hosting WordPress downloads was recently compromised, and a cracker modified the 2.1.1 download, adding code in wp-includes/theme.php and/or wp-includes/feed.php.
The announcement states:
It was determined that a cracker had gained user-level access to one of the servers that powers wordpress.org, and had used that access to modify the download file. We have locked down that server for further forensics, but at this time it appears that the 2.1.1 download was the only thing touched by the attack. They modified two files in WP to include code that would allow for remote PHP execution.
This is the kind of thing you pray never happens, but it did and now we’re dealing with it as best we can. Although not all downloads of 2.1.1 were affected, we’re declaring the entire version dangerous and have released a new version 2.1.2 that includes minor updates and entirely verified files. We are also taking lots of measures to ensure something like this can’t happen again, not the least of which is minutely external verification of the download package so we’ll know immediately if something goes wrong for any reason.
If you downloaded 2.1.1 in the last few days, you may have a compromised version. However, for safety, even if you downloaded it before then, it’s probably worth upgrading anyway. Get 2.1.2 from the WordPress download page, then follow the upgrade instructions.
Once I upgraded my installation, I took a look at wp-includes/theme.php and feed.php, but did not see anything suspicious, so I suspect my version was downloaded before the attack. I’ll take a closer look though.
This is something that really shouldn’t have happened, but I hope that it won’t dent people’s confidence in WordPress. It’s worth highlighting that the WordPress team have dealt with this in exemplary fashion so far, being completely open about the problem, as opposed to some software companies who would prefer to pretend there isn’t a problem and “sweep it under the rug”.
According to the announcement, Ryan, Barry, Donncha, Mark, Michael, and Dougal worked through the night to investigate this issue and get it sorted – well done guys, nice work.
So, if you run WordPress 2.1.1, upgrade now. If you know anyone else that does, please tell them immediately.
My upgrade steps
The upgrade page linked to above gives the basic instructions on what you need to do, but here’s what I did:
- Disabled all plugins (the only one I had was Akismet)
- Renamed my wordpress folder to wordpress-old
- Backed up the database with mysqldump wordpress > wordpress.sql
- Extracted the new 2.1.2 tarball
- Copied wp-config.php and wp-content/ from the old dir to the new one
- Ran the upgrade script (wp-admin/upgrade.php)
- That was it, all went smoothly.
Hopefully that will be useful to someone. If it helped, please leave a comment and let me know.