Timthumb Vulnerability: Your Site Security Could Be Compromised

Timthumb Vulnerability

Nobody likes one of those days - when you wake up to see that your website’s security is compromised. Hacked or close to it.

Well, I just had one of those days (and on a weekend!).

Thanks to the participants of the Blogging Tips 101 Contest. They were the ones who reported to me first that they could not direct their friends to their contest post and they can’t access their contest posts as well.

At first I took a couple of those emails lightly and told them that it could be a temporary issue and asked them to try again later. I was able to load my blog(s) both in the front end and the back end without any problems. So I didn’t take it seriously.

Then the number of emails I got from other people increased. Everyone were complaining that my site was redirected to a strange domain which didn’t load at all.

This is what happened

Since I realized that the issue is getting serious I dived in to explore the issue. I found that there were some nasty lines of code in my .htaccess file. Following is the code just in case anyone is curious (or may need it in future, although I wish it never happens).


Looks nasty isn’t?

What the code basically does is, it hijacks my search engine and external traffic. So if someone finds my blog’s pages through search engines (all major and unknown search engines are listed in the code) or if someone clicks on a direct url to one of my blog posts (as it would happen if a contest participant sends an email to his friend with a link to his contest post), people will be directed to the following url

http://uaroyalys-daliachu.ru/industry/index.php

The thing is that the above domain is blacklisted. So basically all my search engine and direct traffic were ending up on a dead page.

What I did

As a tensed website owner, all I did was to delete those lines of code, save the .htaccess file and checked if the redirect was still in place. I also cleared my browser cache and found that the problem was solved.

I did a google search to one of my review posts and YES I could load the page correctly from Google SERP.

I breathed and started doing my regular work. And in about 10 minutes I got another email that the issue was not solved yet. I asked that reader to clear his browser cache and try again, but still no luck.

I went back to my .htaccess files and those lines of code were back there. I felt as if I was being haunted or something.

Tim thumb script was the blacksheep

Well not exactly. I had to spends hours on chat with my hosting provider Hostgator, cleaning up and other “this and that” stuff. Ultimately this is the response (in a short form) from Hostgator:

Your account was compromised through direct exploit of the timthumb script. This script is used in gallery management.

What is Tim Thumb?

Here’s the original definition:

A small php script for cropping, zooming and resizing web images (jpg, png, gif). Perfect for use on blogs and other applications.

Developed for use in the WordPress theme Mimbo Pro, and since used in many other WordPress themes.

As you can read, many themes and plugins are using this script, if they’re in need to deal with thumbnails.

I doubted Thesis theme

Now since I’m using Thesis theme on all my websites, I thought that Thesis theme was the one that had the outdated Tim thumb script. Also because Thesis theme was the one common thing with all the websites - I suspected some plugins, but I was not using those plugins on all my sites.

I Googled a bit and found that Thesis theme does not permit this issue. However I went ahead and posted a thread in their forum just to confirm. And yes I learned for sure that Thesis theme could not be the problem.

It is because Thesis theme uses its own version of Timthumb script which does not fall into this vulnerability issue.

The original cause

The technicians at Hostgator did a great job in combing through my files to spot the issue. And here’s the reply:

After reviewing the logs provided I see that the website was compromised using the timthumb script found in the theme dailyedition. Below is the related log showing the malicious user pulling the avatar2.php file on to the account which was later used to compromise the account. As you can see the GET request was made via the wp-content/themes/dailyedition/thumb.php file.

OK I’m glad that I now know the root cause. But at the same time, I was really upset because of the time and effort it took to even to find out the cause.

I’m sure not all bloggers are technically skilled to understand php scripts and vulnerability issues.

Bullet points

You need to be aware that the timthumb script is used widely by many free and even some premium themes and plugins.

You need to make sure that the version of the timthumb script you have is up-to-date. This is how the security of my sites was compromised - just because I had an outdated version of the script.

It is not necessary that the (outdated version of the) script has to be in your active themes or plugins. It can be in one of your inactive themes/plugins and can still cause vulnerability issues. So look out for the bunch of unused themes and plugins you have installed in your site’s folder.

I know this is all overwhelming and upsetting. You might have the following questions in mind.

How would you know if I have Timthumb script in any of the themes or plugins you have?

Go to the control panel of your hosting account. Go to File Manager. You will usually have a search option. Search for timthumb.php or thumb.php. If you find that the script is used by any theme or plugin that you are not using, simply delete that particular theme/plugin (the folder).

What if the Timthumb script is present in a theme I’m using?

In this case, you need to make sure that the script is up to date (that is, the latest version). The official updated code can be obtained from here.

This is a tiring process. I can’t remember to check often.

Yes I understand. There is a WordPress plugin for the purpose. Timthumb Vulnerability Scanner. The plugin will automatically check everyday if your timthumb script is up-to-date. If not, you can update with a click.

Timthumb vulnerability scanner

OK but there’s one more thing. If you’re using Thesis theme you should not use this plugin. It is because Thesis theme uses its own version of the script so that it does not run into this issue at all. But the plugin just checks for the version number and will prompt you to update. If you update, you will lose the script that is Thesis-specific and will have the generic Timthumb script. You will have issues with thumbnails and later on you may run into vulnerability issues as well.

On the other hand, if you’re not using Thesis theme (and I think Genesis and Headway themes are also safe), in particular, if you’re using any free theme make sure you click “Upgrade” if you find any outdated versions while scanning with the plugin.

Something more

It is also good to use some sort of security plugin to make sure you know when there arises a threat. I’m using WordPress Firewall 2.

Takeaway

It is absolutely not enough if you just write blog posts. Running a blog or a website needs something more. Either, you should equip yourself with the knowledge needed on the tech side.

Or you should outsource the task to a friend or someone you trust.

On a side note, I would like to hear more about this issue. If you know more share it in the comment so that it might be useful to others to keep their websites safe. Thanks.

And, don’t forget to share this post and show some social media love. Your friends/followers will surely appreciate that; of course, me too!

Name: Email: 0 subscribers We respect your privacy Email Marketingby GetResponse Jane Sheeba has an excellent understanding of blogging ~ Annabel Candy
  • Rosemary Jayne

    “It can be in one of your inactive themes/plugins.”
    This is something that could be quite scary. I recommend to everyone that they go through and delete all of the plugins, themes and so on that they are not using on a regular basis. You could do it while doing a monthly check-up on which plugins you’re actually using and de-activating the ones you’re not.

    I’m sorry to hear that this happened to you, but congrats for getting it sorted!
    For the bloggers that aren’t technically skilled enough to find the problem ask your hosting company to help. And even if you are it’s worth asking them for a hand with things. I managed to mess up something with my site recently and the folks at Bluehost helped me out really quickly and were really nice to boot. I’m glad Hostgator helped you out just as well Jane!

    • http://www.probloggingsuccess.com/ Jane Sheeba

      Thanks Rosemary, I feel a lot relieved actually, since I was able to pin point the root cause instead of simply finding a way out!

      And yes, “It can be in one of your inactive themes/plugins.” is the scariest part!

  • http://freedomcelebration.com Jim Jenks

    I don’t know why people waste their time with that sort of junk. They don’t add any value to their own lives by doing this. People just have way too much boredom time on their hands…

    Thanks for the heads up, much appreciated.

    • http://www.probloggingsuccess.com/ Jane Sheeba

      I too don’t understand why hackers hack! Seems there’s so much fun with making others upset!

  • http://www.techyhuman.com umashankar

    I have been using Timthumb Vulnerability Scanner in my thesis ,thanks for the info.

    • http://www.probloggingsuccess.com/ Jane Sheeba

      You’re very welcome Umashankar!

  • http://www.thewritestuff.be/ Michael Leahy

    Thanks. It’s really important to talk about these things (and the solutions!). A friend of mine saw his site plummet in rankings last year. After poking about on his site if found literally dozens of pages have been created with links to porn and warez sites inserted in them. They were not in the menu and he had never noticed them. But it was enough for the search engines to decide the site was a total spam farm.

    I cleaned out the pages, updated everything and requested that Google visit him again and things gradually went back to normal.

    • http://www.probloggingsuccess.com/ Jane Sheeba

      Hey Michael, glad that you sorted it out for your friend! Its really a nightmare when such things happen!

  • http://www.techlineinfo.com Sujith

    Awesome post Jane. Its almost impossible to make a site bulletproof, however we can minimise the chances by blocking known vulnerabilities.

    • http://www.probloggingsuccess.com/ Jane Sheeba

      Indeed Sujith, if we’re on the internet, we’re on the cloud and nothing is safe!

  • Aidy

    Glad you resolved the issue. Indeed annoying and even better you had great support in helping resolve the issue!

    • http://www.probloggingsuccess.com/ Jane Sheeba

      Aidy, yes for sure, if Hostgator hadn’t been so helpful, I would have been in more trouble!

  • http://4stephenpeters.com Stephen Peters

    Thanks Jane!

    It is always good to be aware of what to look out for. And how to fix the problem should it arise.

    My Best,
    Stephen

    • http://www.probloggingsuccess.com/ Jane Sheeba

      Fixing is the key Stephens. That’s what I’m happy about :)

  • Kulwant

    Really a very informative article… I didn’t know about such thing.. after leaving this comment i am going to scan my theme with the plugin you mentioned here…

    Thanks a lot sheeba for this article for WP Security…

    • http://www.probloggingsuccess.com/ Jane Sheeba

      Glad that I could put this on your spotlight Kulwant!

  • Jai

    Timthumb is already fixed in Thesis Theme, in fact it is using the older version of timthumb script but I highly recommend to upgrade to the latest version of Timthumb..

    • http://www.probloggingsuccess.com/ Jane Sheeba

      Jai, Thesis is using its own version of Timthumb. Its not old by the general definition. With every upgrade of Thesis you’ll get the code update as well, that’s integrated.

      You should not upgrade to the latest (common, non-Thesis) version of Timthumb if you’re using Thesis.

  • http://www.itechcode.com Amit Shaw

    Nice Info on Timthumb . Really we should concentrate on update of Timtumb on regular basis. Awesome work you just explain your work what you did :). Thanks a lot for sharing your valuable Article on security.

    • http://www.probloggingsuccess.com/ Jane Sheeba

      You’re very welcome Amit!

  • http://www.aha-now.com Harleena Singh

    Informative post Jane!

    I had absolutely no idea about Timthumb, and all that you just mentioned was surely an eye opener for me!

    I have Thesis on my writing blog and would surely be checking out as you mentioned, though the other blog is on Genesis, which I guess would be safe, or does that also have to be checked?

    Thanks so much for sharing, and am glad your problem is solved now :)

    • http://www.probloggingsuccess.com/ Jane Sheeba

      Hey Harleena, if you have Thesis or Genesis, you should not be worried about since these two themes don’t have that issue. To me the issue was on my other blog (on the same hosting account as this) where I once installed the dailyedition theme and then deactivated it.

      This has nothing to do with Thesis :)

  • http://growwithstacy.com/ Stacy

    Hi Jane,

    I’m glad that you got it all figured out! It is so stressful when things go wrong with our blogs. Right now I’m having issues with my floating sidebar which erases all of my post content so I had to disable it. I don’t have the time to figure it out and I haven’t heard back from them yet.

    Thanks for sharing in detail what you’ve learned!
    Stacy

    • http://www.probloggingsuccess.com/ Jane Sheeba

      Stacy, yes, one of the hardest things about doing an online business is to deal with technical difficulties. We’re lucky if we have the right persons to help us!

  • http://www.techcrates.com Salman

    Truly an informative article… Agree with you that not all bloggers are technically skilled ! Bookmarked this article, could be of great help if such a thing happens with my blog

    Thanks for the share Jane …

    • http://www.probloggingsuccess.com/ Jane Sheeba

      Glad you’ve bookmarked it Salman. But I truly wish you won’t need it.

  • http://www.moretricks.com samad

    Last weak my blog too got hacked :(

  • Mark

    These Hackers don’t actually give up. WordPress still has lots of bugs yet to be fixed, not to mention all the themes and plugins there. I’m glad that you shared this issue with us Jane, thanks

    M Mark

    • http://www.probloggingsuccess.com/ Jane Sheeba

      I’m glad to have shared this with my readers, Mark!

  • Alex

    I’m surprised you did not notice all the fuss about this vulnerability a few months ago. My host - hostmonster, took matters into their own hands and simply ran a script which took out the issue without me doing anything.

    • http://www.probloggingsuccess.com/ Jane Sheeba

      Alex, indeed, Hostgator was so helpful. I was tired just because of the time it took for me to know what actually was wrong and my time on chat with Hostgator team.

      • Hamid

        hello sheeba i want this commentluv plug in…any website that i can get this for free

        • http://www.probloggingsuccess.com/ Jane Sheeba

          Hamid, Commentluv premium is a premium plugin, not available for free. Although there is a free version if you want to try it. IF you want a premium version at a discount, check out this post of mine - http://www.probloggingsuccess.com/commentluv-premium-plugin-cashback-offer/

          • PRO BLOGGING

            nups i will searh that and i will download it …i dont want invest money in this plug in
            were as thank for ur comment back,
            Allah hafiz

  • Cat Alexandra

    Hi Jane,

    I had a similar problem with TimThumb vulnerability just this past week! I have installed TimThumb vulnerability scanner to “keep an eye” out on this.

    It’s pretty important that we keep mindful, also, for vulnerabilities our WordPress sites may have as a result of various plugins. I have found some to be especially problematic over the recent months.

    Great fixes here. A must RT!

    Cat Alexandra

    • http://www.probloggingsuccess.com/ Jane Sheeba

      Hey Cat, yes we should be always vigilant :)

  • http://niallm1.com Niall

    I’m sorry to hear this. Personally TimThumb is more of a headache than it’s worth and this proves my point!

    • http://www.probloggingsuccess.com/ Jane Sheeba

      Yup I agree totally Niall. But it seems that we really can’t take it out of the equation, since all of our websites deal with images, and also since this script is integrated into most themes and plugin! I wish though!

      • http://niallm1.com Niall

        Yeah, unless you know how to manually update it you may have a bit of a problem.

  • http://www.computerhowtoguide.com Peter Lee

    I’ve just installed TimThumb Vulnerability Scanner and scanned my site, turned out that mine was way outdated. It’s creepy that this thing could actually happen without you knowing about it and I’m glad you got it all back to normal now and shared your experience with us. Thanks Jane.

    • http://www.probloggingsuccess.com/ Jane Sheeba

      I’m so glad you took the action Peter :)

  • http://www.teechworld.com Shivkumar

    Congrats! Sheeba, that you resolve this problem quickly.
    After dropping comment here I will immediately going to switch to my editor to scan with your plugin mention above!
    Thanks!! :)

    • http://www.probloggingsuccess.com/ Jane Sheeba

      Thanks Shivkumar. Yes please check your blog with the scanner and keep things up-to-date and safe.

  • Harriet

    Its good to know that keeping your security on your website is as simple as deleting some unwanted codes! Thanks for the tips and for putting them across so clearly.

    • http://www.probloggingsuccess.com/ Jane Sheeba

      Herriet, however, its not always that easy! That’s the bitter truth.

  • http://www.richescorner.com Richard

    Hi Jane,
    I’m glad you were able to quickly find and solve your problem. I do find that keeping a close eye on third party plugins is a really important part of running a blog. I find that third party plugins can break my site or slow my load speed down in addition to potential security vulnerabilities.

    • http://www.probloggingsuccess.com/ Jane Sheeba

      That’s right Richard.

  • http://race2hugo.net/blog HollyJahangiri

    This is really good to know, Jane. I’m going to take precautions, myself, now! Thanks for the very specific info and suggested plug-ins!

    • http://www.probloggingsuccess.com/ Jane Sheeba

      You’re very welcome Holly.

  • http://www.onwaweb.com Obinna

    This is quite creepy. Thank God you found out about it on time. Who knows what else could have happened?

    • http://www.probloggingsuccess.com/ Jane Sheeba

      That’s right Obinna. But I ran some tests and confirmed that I’ve lost nothing else.

  • http://www.techblowup.com/ Prakash

    It’s really a big issue, I have also faced this prob once. But now got the real reason why that happened.
    Thanks Jane………

    • http://www.probloggingsuccess.com/ Jane Sheeba

      Glad I could be of help Prakash!

  • http://www.techdesighn.com Ahsan

    This post will be a good lesson for new bloggers. Most new bloggers don’t think regularly about site’s security & other precautions matter. I have also need to be more careful on my site

  • http://crohnsandibsbreakthrough.com/blog/feed/ John Cooper

    It’s usually a super rare situation, but I’ve had 2 or 3 themes in the last year that I built that really benefited from the flexibility of timThumb. Case in point: If you’re trying to build a dynamic image size system where users have full control on the backend to control the thumbnail sizes (for instance), it makes a lot more sense to use timThumb and pass in the Width/Height as variables from the database (theme options table) as opposed to registering a new image size or using other built in WP stuff. BUT, as WP grows, it gets easier and easier to just use the built in functions. Either way, for now, timThumb definitely has some practical uses for the creative themer.

    • http://www.probloggingsuccess.com/ Jane Sheeba

      That’s totally right John. Timthumb is a great code. Just that the un-updated version is used by evil humans :) If we make sure that the code at our site is up-to-date we seriously have nothing to worry about.

  • http://crohnsandibsbreakthrough.com/blog/ Rizwan Sultan

    Timthumb vulnerability scanner is good plugin but mostly I avoid plugins because of sites speed issue and mostly plugins are working as a black sheep for site it give chanced to hackers to attacked on WordPress sites.

    • http://www.probloggingsuccess.com/ Jane Sheeba

      Yes Rizwan, but this plugin runs only once a day at a particular time… no extra scripts or loading time as far as I know.

  • Umair Abid

    Whoa! This timthumb (jquery/php) plugin is one of the most frequently used plugin in the projects where clients want gallery sort of thing but we never heard a problem like this. I guess their will be a problem in the timthumb plugin for wordpress or it has some hole through which hacker can easily get to your root directory and write .htaccess file to redirect users.

    • http://www.probloggingsuccess.com/ Jane Sheeba

      Yes Umair. Actually the whole of Timethumb is not a problem. Only if your theme or plugin (even the inactive ones) has the outdated version of it, then it gives hackers some good room!

  • http://www.seagreennatural.com Cathy

    I found this useful. I had no idea. I’m glad you shared this. I saved this for reference. Thanks

    • http://www.probloggingsuccess.com/ Jane Sheeba

      I’m glad that I could tell you this, Cathy! Thanks for stopping by :)

  • Prithvi

    I really cant make out why do they do so.. It surely cant give them a better way to survive.. They just do it because they like to irritate others.. Anyways it was nice going through the ways to minimize the security attacks.. Thanks for sharing.

    • http://www.probloggingsuccess.com/ Jane Sheeba

      That’s right Prithvi. As a website owner all we can do is hate hackers lol.

  • Andrew Walker

    The first moment I saw the coding, I was like “What in the world is this???” LOL! But now after reading the whole article, I understand how useful your post is. Thanks a lot for sharing this with us.

    • http://www.probloggingsuccess.com/ Jane Sheeba

      LOL Andrew, sorry to have scared you with the code!

  • http://avgjoegeek.net Jason M

    I just read about the timthumb vulnerabiltiy. Ironically enough my host had updated their PHP libraries which broke the GD Library (used to run timthumb.php).

    It was interesting to stumble across this exploit - and now I read your post about it!

    My research had me reviewing my .htaccess file, anyone who registered on my site - to the thumb.php that Thesis uses. So I inadvertently performed all of the steps you mentioned in your article (my site is clean yay!) without even being aware of it.

    So who knew something bad would turn out to be good? Oh, and it turns out my host has to update the OS on the server to the latest version then re-compile PHP *whee* - hopefully he doesn’t break the whole server when he does it.

    Speaking of which - time to go backup my site again! Hopefully all of you are backing up your sites too!

    • http://www.probloggingsuccess.com/ Jane Sheeba

      Jason yes, same here. I’m really happy that it happened - I learned a lot of good stuff!

  • Annie Andre

    I’m sorry to say that i am glad i am not the only person this happened too. A month ago the same thing happened to me. Being the pesky person i am i was determiend to figure it out and it came down tothe Tim Thumb. Now i back up my site daily and if this ever happens again i will load the previous install. I wasted too much time trying to trouble shoot the issue. SIGH.

    • http://www.probloggingsuccess.com/ Jane Sheeba

      Annie, doesn’t your host offer auto backups? Did you check with them? Daily manual backups should be tiresome!

  • Jonathan

    I haven’t had Tim Thumb problems but got my sites hacked two weeks ago and lost a weeks worth of traffic and another weeks worth of time wasted fixing things. Security for your blog is so, so, so important.

    • http://www.probloggingsuccess.com/ Jane Sheeba

      Amen Jonathan :)

  • http://creativefashionglee.com/ creativefashionglee

    I´m using Vaultpress for regular backup and i remembered receiving a message mid last year from the Vaultpress security management telling me that my site is vulnerable to hacking due to the timthumb script used in my related post plugin. I immediately googled about this issue and found the updated version of timthumb script so I was able to avoid this scary event.

    I´m glad you´ve fixed this issue.

    • http://www.probloggingsuccess.com/ Jane Sheeba

      I see. Glad that you sorted it out too gal :)

  • http://customers.agriya.com/products/party-planet shaam

    Getting update with timthumb its most important for maintaining website else it will lead to some issues

  • Jai

    I am having tough time in integarting timthumb in Genesis, could you please tell me how should I do that..?

  • http://www.speakingoflove.net Sally Brown

    Hi Jane,

    I saw this post from ‘Grow With Stacy’. So glad I did. Thanks for the information so I can keep my site secure before a problem arises. Sally

    • http://www.probloggingsuccess.com/ Jane Sheeba

      Glad you found it useful Sally :) Thanks for coming by.

  • http://amyhagerup.com/best-vitamin-supplements-how-choose/ Amy Hagerup

    That is so funny that Sally found this at GrowWithStacy because I did too! Thanks for the great info. And thanks for the free ebooks too.

    • http://www.probloggingsuccess.com/ Jane Sheeba

      Oh I’m so glad. Welcome to my blog Amy :)

  • http://ftechblog.com Yogesh Vashist

    That is really a tensed situation for a website owner and Jane thanks for sharing your experience with us. I hope it will be helping us in preventing our blog from such scripts.