April 28, 2008

Don’t forget to add a SECRET_KEY to WordPress

Reading Time: < 1 minute

If you’re like me and you’ve been using WordPress since before 2.5 came out, your wp-config file is probably missing a “SECRET_KEY”.  This is a new, one-line entry to the config file that generates a unique cookie for your site.  Some of the recent WordPress attacks have involved cookie spoofing, and this will help prevent that kind of thing.

As far as I can understand, WordPress 2.5.1 is completely secure even without a secret key.  I think this is just a pre-emptive move to prevent cookie-based attacks in the future.  Extra security is always a good thing.

Adding a key is very simple.  Just open up your wp-config.php file and add something like this:

define(‘SECRET_KEY’, ‘8675309 abc 123 secret key dont hack me’);

You don’t need to remember the phrase, so make it as long and complex as you can.  If you want, you can visit this WordPress page which will generate a unique key every time you load the page.

Comments

  1. David – That’s my understanding, yes. However, isn’t a bit of redundant security a good thing, especially on something that people work so hard to crack?

  2. Point taken, but if the vulnerability has wrapped in Kevlar, then a strip of duct tape over the top ain’t gonna bolster your defenses. Of course, if the new 2.5.1 security is just wads of duct tape, then some extra bullet proofing will be welcome. I’ve implemented the tip regardless, but then I have been known on occasion to tie a double bow in my running shoes too 😉

    db

  3. I would guess they always hope that it’s wrapped in Kevlar (especially if they call it a “secure” release), but people will eventually find a hole. If nothing else, this should say “Don’t mess with the cookies — you’re not getting in. Look elsewhere.”

    I really don’t know enough about security to fully understand it. However, if it makes WordPress 0.1% more secure, then I’m all for it. Getting hacked just makes for a bad day.

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

Random posts

Reading Time: 3 minutesI’ve been slowly migrating my notes from Obsidian to Tana, and part of that involves essentially visiting every blog post on here again (inside of…

Read More

The WordPress drama shows why WordPress remains the best choice

Reading Time: 2 minutesOver the last few months, the WordPress community has been a bit of a mess. The short version of the “mess” is that Matt Mullenweg…

Read More

20 years of WordPress

Reading Time: 2 minutesIt feels hard for me to believe, but today is the 20th anniversary of the first release of WordPress (you can see the initial announcement…

Read More