do you trust all wordpress plugins?

ohne die masse an plugins, die es mittlerweile zum glück gibt, wäre wordpress mit sicherheit nicht so beliebt: wenn man ein wenig sucht, so findet man eigentlich immer ein plugin, welches genau die funktionalität bietet, die man gerade benötigt – und wenn nicht, dann ist es auch nicht sonderlich schwer ein eigenes zu basteln.

doch: kann man eigentlich darauf vertrauen, dass das eben heruntergeladene plugin auch genau das tut, was es vorgibt? und zwar nur das?

hand aufs herz: ich bin mir sicher, dass der überwiegende anteil der anwender es genau so macht:
– plugin herunterladen
– nach /wp-content/plugins hochladen
– aktivieren
– eventuell in der options page noch konfigurieren und oder ins template einbauen
– fertig

den php code des plugins kontrolliert niemand – das ist auch teilweise aufgrund der größe gar nicht so einfach; sicherlich, der großteil der plugins hat eine überschaubare anzahl von zeilen; aber bei plugins wie z.b. sk2 würde man schon einige zeit benötigen um zu kontrollieren, welche funktionen es genau ausführt (bzw eher: was es macht, aber nicht machen sollte…)

was soll ein plugin schon großartig anstellen? gut, machen wir ein experiment – ich habe hier ein plugin namens wp-surprise vorbereitet. mache es so wie immer – also herunterladen, einspielen und aktivieren. keine angst, es passiert nichts schlimmes, versprochen. erst dann lese weiter…

gut – nun checke deine mailbox…

keine panik – es ist nichts weiter passiert – nur du hast dieses mail bekommen; der inhalt ist auch nicht weiter besonders aufregend: es sollten alle in deiner wordpress installation angelegten user enthalten sein, samt dem passwort als md5 hash. mit dem hash fangt man nicht wirklich etwas an – man kann den hash nicht einfach wieder zurück in das eigentliche passwort umwandeln; aber trotzdem: es sind zumindest alle loginnames ersichtlich, so könnte man zumindest versuchen, schwache passwörter zu erraten.

wie hat das nun funktioniert?

wenn ein plugin aktiviert wird, so können bereits beliebige funktionen ausgeführt werden; dazu verwendet man die funktion “register_activation_hook” – das ist z.b. für plugins, die einen eigenen sql table anlegen müssen unbedingt notwendig und daher auf jeden fall eine wichtige funktionalität. in dem plugin gibt es weiters eine funktion namens “hipslu_wp_surprise_init”, welche beim aktivieren des plugins sofort aufgerufen wird. diese funktion baut das mail zusammen und sendet es an die e-mail adresse des admins.

denkbar wären hier aber ganz andere funktionen:
– man könnte die passwörter der user nicht nur auslesen, sondern einfach neu setzen; das ist mit einem einfachen sql statement kein problem. der eigentliche anwender wäre somit ausgesperrt und könnte das passwort nur mehr direkt über die sql datenbank wieder ändern
– man könnte alle posts, pages, kommentare etc löschen, ändern, neue erstellen, etc
– man könnte aus der installation einen art spam-bot machen: sowohl mail spam als auch trackback spam ist kein problem
– usw, usw…

das würde aber natürlich alles auffallen und ist abgesehen davon auch wenig sinnvoll – die gefahr ist wohl auch sehr gering, weil kaum jemand daran interesse haben wird – es lohnt nicht wirklich, und nur ein sehr populäres plugin ist wirklich halbwegs oft installiert – doch gerade die populären plugins werden eher früher als später unter die lupe genommen und damit würde es auffliegen.

eines wäre aber sehr wohl eine nicht ganz unwahrscheinliche möglichkeit:
alle funktionen, die in der /wp-includes/pluggable.php enthalten sind, kann man leicht durch ein plugin ersetzen. eine dieser funktionen trägt den namen “wp_login” und ist – erraten – für das login zuständig; überprüft also, ob es den user gibt und ob das eingegeben passwort dem in der datenbank gespeicherten gleicht. mit einer minimal angepassten funktion ist es also kein problem mit irgendeinem passwort z.b. als admin einsteigen zu können…

ist diese – logischerweise vorhandene gefahr – zu vernachlässigen bzw nicht existent – weil man der wordpress gemeinde trauen kann und es sich niemand trauen würde, da es früher oder später entdeckt werden würde – oder sollte man hier sehr wohl misstrauisch sein?

9 thoughts on “do you trust all wordpress plugins?

  1. … das war mir nicht bewusst, auch wenn es eigentlich logisch ist; ich werde also in zukunft vorher mal einen blick in das plugin werden 😯

  2. 😯 WTF! no, I don´t always check all the plugins I download and install, but this one give us a clear example of what can a “script kiddie” can do to fuck an entire community.

    Thank you very much for this clear example of weakness. Is there a way you can advice WordPress developers about how can we protect agains malicious plugins?

    Somebody should do a Anti-malicious Plugin, that protects our information from going out to an external source or e-mail.

    Regards!

  3. i think due to the power of php and the power of the wordpress plugin mechanism it would be very difficult to automatically find out which plugin contains “evil code”. in fact everybody has to check the plugin code himself; but: not anybody has php skills… the question is: do you think that this risk is just theoretically?

  4. I understand, I will check for now and on every plugin source code, one short advice could be “don´t download and install plugins from supicious sources”, you know something like that.

    And about your question, I don´t really understand it, or I don´t want to understand it maybe, it scares me a little. I can´t tell if this is theorical or somebody is doing it right now and nobody knows about it. How can we know?

    Do you remember Sub7? the trojan horse, the owner wrote some code inside the application so it can search for a specific ICQ number and if the application was installed in a computer that has that ICQ profile installed, the Sub7 was made to destroy that computer using the “Hard Disk Killer” progam.

    I don´t know, the sky is the limit for a person with PHP skills, if you let it enter to your server, giving him read, write, erase and execution permission.

    This could panic the entire community, I hope everybody can keep it cool. 🙁

    Regards!

  5. “This could panic the entire community”

    Surely you all realize this is nothing new what so ever and every “plugin” across every application / web app has had this exact same possibility?

    Come on folks. Nobody can protect you from yourself. “Don’t download suspicious plug-ins from suspicious places.” is the obvious solution.

  6. The security problem is clear… it would be fine, to have a central website, which certifies every plugin after checking. But this would cost hours, so they have to earn a lot of money by advertisment to kepp the project alive. 🙂

  7. Excellent exercise in exposing the true flaws in *trusting* open source plugins.

    As to the worries about the community keeping their cool, I’m more worried about the potential harm that could always be done by a malicious coder.

    Still, it is interesting that few instances have appeared like this. There are a few plugin providers, however, that *have* put self-serving code in their offerings. Not so much malicious, as they were invisible and not revealed on the developer’s download/FAQ pages.

Comments are closed.