Slashdot Mirror


Severe SQL Injection Flaw Discovered In WordPress Plugin With Over 1 Million Installs (bleepingcomputer.com)

According to BleepingComputer, "A WordPress plugin installed on over one million sites has just fixed a severe SQL injection vulnerability that can allow attackers to steal data from a website's database." The plugin's name is NextGEN Gallery, which has its own set of plugins due to how successful it is. From the report: According to web security firm Sucuri, who discovered the NextGEN Gallery security issues, the first attack scenario can happen if a WordPress site owner activates the NextGEN Basic TagCloud Gallery option on his site. This feature allows site owners to display image galleries that users can navigate via tags. Clicking one of these tags alters the site's URL as the user navigates through photos. Sucuri says that an attack can modify link parameters and insert SQL queries that will be executed by the plugin when the attacker loads the malformed URL. This happens due to improper input sanitization in the URL parameters, a common problem with many WordPress and non-WordPress web applications. The second exploitation scenario can happen if website owners open their site for blog post submissions. Because attackers can create accounts on the site and submit a blog post/article for review, they can also insert malformed NextGEN Gallery shortcodes. Sucuri says the plugin's authors fixed this flaw in NextGEN Gallery 2.1.79.

38 of 61 comments (clear)

  1. Not Wordpress!! by Anonymous Coward · · Score: 1

    It's known for being so secure!! How could this happen??!?!?

    1. Re:Not Wordpress!! by Tablizer · · Score: 2

      Yah, toldja to use SharePoint. *head duck*

  2. Friends by XparXnoiaX · · Score: 1

    Friends don't let friends use wordpress. Give your friends cocaine, it's better for them.

    --
    Irresponsible disclosure is responsible
    1. Re: Friends by slazzy · · Score: 1

      What CMS do you recommend to keep things secure? Concrete5? Drupal?

      --
      Website Just Down For Me? Find out
    2. Re: Friends by Aethedor · · Score: 1

      Banshee for sure!

      --
      It doesn't have to be like this. All we need to do is make sure we keep talking.
  3. Little Bobby Tables by jfdavis668 · · Score: 1, Funny

    Did you really name your son Robert'); Drop Table Students;--?

  4. Jesus wept by JustAnotherOldGuy · · Score: 4, Insightful

    "...This happens due to improper input sanitization in the URL parameters"

    Not this shit again. Look kids, use parameterized queries (prepared statements) or a decent sanitizer library (there are several available that are actually very good).

    To get hacked because of poor sanitizing of inputs is downright embarrassing in this day and age.

    --
    Just cruising through this digital world at 33 1/3 rpm...
    1. Re:Jesus wept by Tablizer · · Score: 1

      I find parameterized queries a pain to test and troubleshoot on some platforms because you cannot see the actual SQL the RDBMS is using. Maybe I'm doing it wrong, but I'm disappointed with them.

      Everyone wants sites ASAP and cheap, but debugging them is not ASAP and cheap. Grumble grumble.

    2. Re:Jesus wept by StormReaver · · Score: 2

      I find parameterized queries a pain to test and troubleshoot on some platforms....

      You need more training before you write anything that uses a database. Parameterized queries in PHP are easier to use and read than inline SQL, and are trivially easy to see the actual SQL the RDBMS is using.

      Maybe I'm doing it wrong, but I'm disappointed with them.

      If your statement is a true reflection of your opinion of parameterized queries, then: yes, you are doing it wrong.

    3. Re:Jesus wept by mark-t · · Score: 1

      I find parameterized queries a pain to test and troubleshoot on some platforms because you cannot see the actual SQL the RDBMS is using. Maybe I'm doing it wrong, but I'm disappointed with them.

      You're right....

      You're doing it wrong. Prepared statements are absurdly easy in any remotely modern rdbms, often even cheaper and easier than constructing the entire sql string yourself.

    4. Re:Jesus wept by drinkypoo · · Score: 1

      And this is why Drupal has a layer to handle this stuff for you. Now, granted, they did screw it up the first time and actually create a hole in it, but at least they fixed it rapidly :)

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
    5. Re:Jesus wept by dave420 · · Score: 1

      You can usually get the raw SQL out of it somehow. It's no excuse. You also have access to the SQL server logs, including the queries run against it.

    6. Re:Jesus wept by JustAnotherOldGuy · · Score: 1

      Drupal does a decent job of sanitizing stuff. I use a sanitizer from a place called jetscripts that seems to work very well. I've thrown a ton of stuff at it and haven't been able to by spoof it yet.

      --
      Just cruising through this digital world at 33 1/3 rpm...
    7. Re:Jesus wept by Tablizer · · Score: 1

      You also have access to the SQL server logs

      I do? Don't let the DBA's know.

  5. Obligatory xkcd by OhSoLaMeow · · Score: 3, Funny
    --
    They can take my LifeAlert pendant when they pry it from my cold dead fingers.
  6. Surprised by kugeln · · Score: 1

    I bet there is somebody, somewhere, that is actually surprised about this. And they're probably using a Mac.

  7. Re:That's PHP skill for you by Tablizer · · Score: 1

    But why are your alternatives, the COBOL and Lisp CMS so unpopular?

  8. Re:No way! by Frosty+Piss · · Score: 1

    It's so secure written in the professional engineered PHP...

    If I could down-vote you I would. I suppose you write all your code in C (not that C++ shit) when you don't have the time to pound it out in machine (with vi, only nubes use anything else). Or are you one of those trendy Ruby On Rails guys - oh, wait, that's old news. But never mind, I assume all your code is revolutionary and bug free...

    --
    If you want news from today, you have to come back tomorrow.
  9. Re:Sanitizing Untrusted Input by Dracos · · Score: 1, Insightful

    Because WP is the product of a lousy team with the lowest possible standard of practices, their tradition since 2004. Those attitudes permeate throughout the WP "development" landscape. If the core presented best practices and enforced using them, so many vulnerabilities would have been mitigated. Not only is WP shitty code, it begets shitty code.

  10. Re:Sanitizing Untrusted Input by Frosty+Piss · · Score: 3, Insightful

    I'm also glad I don't use PHP

    The is crap written in EVERY language, and variations of C are certainly not immune to this. I can write code that accepts unsanitized input in any language you choose.

    --
    If you want news from today, you have to come back tomorrow.
  11. Re:No way! by Billly+Gates · · Score: 1

    It's so secure written in the professional engineered PHP...

    If I could down-vote you I would. I suppose you write all your code in C (not that C++ shit) when you don't have the time to pound it out in machine (with vi, only nubes use anything else). Or are you one of those trendy Ruby On Rails guys - oh, wait, that's old news. But never mind, I assume all your code is revolutionary and bug free...

    Absolutely. I use Erlang Outlaw Techno Psychobitch like all the cool kids

  12. Comment removed by account_deleted · · Score: 2

    Comment removed based on user account deletion

  13. Screw the script kiddies... by __aaclcg7560 · · Score: 1

    I've gotten tired of script kiddies banging down my virtual doors because of PHP and MySQL. These days I'm converting my websites to static websites by using Pelican (Python). There's no bragging rights in hacking HTML files.

    1. Re: Screw the script kiddies... by __aaclcg7560 · · Score: 1

      If pages can be static, why weren't they already?

      The content was stored inside a MySQL database. I can export the database to a file and then run a script to convert the articles with metadata into Markdown files. Since I'm using Pelican as my static file generator, I can create scripts to convert Markdown files into Python data structures and create Jinja templates to manipulate the data structures. I also use JavaScript, JQuery and Bootstrap to create a responsive base template.

      Maybe other environments don't give you the choice?

      Other environments typically take six seconds to load the CMS first before showing your content. If your website can't grab the viewer's attention in three seconds, they move on to something else. There's no loading overhead with static web pages because all the work was done on the backend.

  14. Re:Sanitizing Untrusted Input by 2fuf · · Score: 1

    > It's not that hard when I do it.
    (...ehm, let's make sure we get the context right on that one.)

    Of course, with you HeartBleed wouldn't have happened either I bet. Still really old code, open source and used almost everywhere, but it took years to catch it.
    Never say never, it's so easy to judge with hindsight.

  15. Re: Sanitizing Untrusted Input by Aethedor · · Score: 1

    PHP is not the issue. Yes, it's an easy language which draws a lot of noobish programmers. But it's not hard to make a secure website with PHP. Take a look at this framework for example.

    --
    It doesn't have to be like this. All we need to do is make sure we keep talking.
  16. Re: Who the fuck uses anything PHP in production? by Aethedor · · Score: 1

    Having PHP on a server means it will get owned.

    I'm using PHP for many years, got a lot of hack attempts, but never got owned. So, give me your best shot.

    --
    It doesn't have to be like this. All we need to do is make sure we keep talking.
  17. Re:Sanitizing Untrusted Input by infolation · · Score: 1

    The WordPress Codex tells coders how to sanitize user input, but the NextGEN coders seemed to forget the parameterized URL is user input.

  18. Re:Sanitizing Untrusted Input by munch117 · · Score: 1

    Sure, but how large is the common subset between the people who choose to use PHP and the people who are capable of designing secure software? I imagine it's not a very large set.

  19. Re:Who the fuck uses anything PHP in production? by campuscodi · · Score: 1

    People on cheap shared hosting providers. Mom an' pop shops.

  20. Re:Sanitizing Untrusted Input by amicusNYCL · · Score: 1

    The fact that application documentation is trying to teach security practices that any programmer of the language should already know is a great indication of the quality of programmers involved in the Wordpress ecosystem. If someone who is trying to create Wordpress plugins needs to rely on the Wordpress documentation for basic security practices, then it seems like the barrier to entry is too low. This is why Wordpress has the reputation that it does. On one hand it's great that anyone can make a plugin for Wordpress, but on the other hand it sucks that just anyone can create a plugin for Wordpress. SQL injection vulnerabilities have been the #1 attack vector for web servers for over a decade, and it's because of shit like Wordpress. It's frankly embarrassing that SQL injection is still an issue, the people behind the NextGEN plugin should be ashamed of themselves. There's absolutely no excuse at all, it looks like Wordpress requires PHP 5 and if that's the case then the mysqli extension is available, and if that's the case then they should have a database abstraction layer where the usual way of using it is prepared statements and parameterized queries, all of their own code should be using that and all of their own examples should show that. This argument could have been made in 2004 also. Wordpress is only a year older than PHP 5, they could have been doing this for a long time but since their codebase looks like something that a first-year programming student produced as their first project it's no major surprise that the people writing code for them are still making first-year errors.

    --
    "Our two-party system is like a bowl of shit looking at itself in a mirror." - Lewis Black
  21. Well there's your problem by amicusNYCL · · Score: 1

    NextGEN Gallery is maintained by Imagely. We're the WordPress photography experts.

    Hey Imagely, maybe you should hire a programming expert to write your code while you take pictures.

    --
    "Our two-party system is like a bowl of shit looking at itself in a mirror." - Lewis Black
  22. Tremendous! by Mats+Svensson · · Score: 1

    if ($wordpress = $secure){
            $nukes_armed = true;
            echo "Welcome mr president!",
    }

  23. Re: Sanitizing Untrusted Input by dgatwood · · Score: 1

    Actually, to some degree, PHP is the issue. PHP has supported ways of performing MySQL queries that use placeholders for many years, but they also resisted breaking existing code by ripping out the old interfaces for way longer than made sense. Note that in PHP 7, they finally removed them, so we should start to see PHP app security improve dramatically as panicked admins realize that they have to replace all this crappy code.

    --

    Check out my sci-fi/humor trilogy at PatriotsBooks.

  24. Re: Sanitizing Untrusted Input by Aethedor · · Score: 1

    In any programming language, people can do stupid things. Also in PHP 7. And even with the older MySQL library in PHP, it was very well possible to write a secure database driven application. All it required was knowledge, like with any language.

    --
    It doesn't have to be like this. All we need to do is make sure we keep talking.
  25. Re: Sanitizing Untrusted Input by dgatwood · · Score: 1

    Yes, but when you have an API that is known to be fundamentally insecure, keeping it around for more than a decade solely to preserve code compatibility is generally a really bad idea that can only encourage the proliferation of dangerous code copied from other dangerous code. The assumption was that PHP 5 would be replaced by a new major version that broke backwards compatibility after just a couple of years, but instead it took eleven.

    --

    Check out my sci-fi/humor trilogy at PatriotsBooks.

  26. Re: Sanitizing Untrusted Input by Aethedor · · Score: 1

    Even the PDO library can be used in an insecure way. A language is just a language. It's the programmer that makes the application secure or vulnerable.

    --
    It doesn't have to be like this. All we need to do is make sure we keep talking.
  27. Re:Sanitizing Untrusted Input by cc1984_ · · Score: 1

    The is crap written in EVERY language

    Including English, it seems!