Archive for the ‘Privacy’ Category
You are currently browsing the archives for the Privacy category.
You are currently browsing the archives for the Privacy category.
By now, I’m sure we have all heard about the numerous WordPress sites that have been hacked on several of the major hosting providers. From all of the reports so far, no one can seem to figure out what the problem is or how the breaches are happening.
Is the problem a server misconfiguration, outdated WordPress blog, weak passwords or a serious bug in WordPress itself?
If your site has been hacked and you have access to the access_logs, post them along with any other relevant information that you have and as a community let’s go through the information to see if we can find the problem.
GHTime Code(s): fa962 d7fedThe nDarkness community has recently been working with the wonderful developers over at DutchMonkey.com to review and point out security flaws in some of their freely available software.
During this review process, there were several issues found and we will be posting them in the coming weeks for educational purposes. It is our hope that this information will be used to help others write more secure code and realize the dangers involved with these mistakes.
The first major issue we found was with DM-Albums version 2.0. After reviewing this software and helping to add greater support for WPMU installations, we moved on to DM-FileManager version 3.9.6. The fist major issue we found with this software prompted us to take a deeper look at the authorization model used by this file manager software. Below is the vulnerable code and the method used to exploit it. Please be aware that this has since been fixed and is no longer vulnerable.
I discovered that cookie variables were being used to determine a users ability to access certain features of the software. The cookies I found that mattered were:
GROUP=ADMINISTRATORS; GROUPID=1;
The group id cookie gives you the admin.php button (footer.php, line 49) – Not necessary but it was a start.
if($GROUPID == 1)
{
print(" <a href=\"admin.php\" class=\"admin\"><img src=\"ui/$USERINTERFACE/png/admin.png\" border=\"0\" height=\"15\"/></a> ");
}
Being in the administrator group (admin.php, line 116) lets you use the admin.php page.
if($GROUP != "ADMINISTRATORS") redirect("/?currdir=$currdir");
To exploit this we used javascript injection. From the log in page I entered the following in the address bar and reloaded the page:
javascript:void(document.cookie="GROUP=ADMINISTRATORS");void(document.cookie="GROUPID=1");
When the page reloaded, the admin button was in the footer of the page and it allowed me to use the admin.php page. Once in the admin interface you have full control of the file manager software and can for example, change the admins email address to yours and use the forgot password feature to receive the admins unencrypted password (more on this issue in future posts).
All DM-FileManager users are strongly encouraged to upgrade their software to the latest version.
GHTime Code(s): b0b5f ncThe latest version of DM Albums was released on 10/21/2009 to all WordPress users and it contains a serious flaw that can allow an attacker to remotely delete any file or folder they wish. The author has been notified of the problem and I have listed a work around below to prevent directory traversal.
After upgrading to the latest version of DM Albums I was playing with the new features and noticed the function to delete albums. I dug into the code located at wp-content/plugins/dm-albums/wp-dm-albums-ajax.php and found that there is no check to see if someone has used directory traversal. This means that anyone can delete files or directories outside of the upload directory.
Example:
http://someblogsite/wp-content/plugins/dm-albums/wp-dm-albums-ajax.php?delete_album=../../../public_html
The vulnerable section that allows this to take place is:
In this code there is no check to see what is contained in the GET variable and you don’t even need to be logged in to delete files.
Below is a quick and dirty work around to prevent the problem and I would suspect there will be more checks to ensure that user input is sanitized in the near future. This work around will not prevent malicious users from deleting your albums but it will keep folders outside of the upload directory safe.
//delete the album directory
dm_get_album_delete($DM_UPLOAD_DIRECTORY . $_GET["delete_album"]);
}
Once I hear back from the author I will update this post to let everyone know the outcome.
Update: A new release, v2.0.1, with the above mentioned work around has been released. We should also expect to see another update in the next few days that will employ more security checks and some upgrades for WordPress multi user environments as well.
GHTime Code(s): dc678 16e08 522fd 08095 nc 68ef8