CFWebstore File Upload Vulnerability
There has been a recent outbreak of attacks on servers running the ColdFusion shopping cart CFWebstore, that is allowing the attackers to upload a ColdFusion variant of the C99 shell script. This is giving them full access to your server and it will get compromised if they get that file up there.
Here's what they do:
- Using the /customtags/uploadfile.cfm page, they are spoofing the MIME type to upload index.cfm and image.cfm to /images/accounts directory - these are their web shells (think of them like control panels).
- After having these web shells uploaded, things can go one of several ways:
- If you have cfexecute/cfregistry disabled, they will likely just inject JavaScript into every site on your server
- If you have cfexecute/cfregistry enabled, they will likely attack you with wminotify, this allows them to log and send back home all passwords used to log into the server for remote administration. At this point, you should probably plan to build a new server because this level of compromise is pretty deep and you likely won't clean it all up.
- If you had cfexecute/cfregistry disabled and Sandbox security on each site, then only the CFWebstore site that was attacked will be injected with JavaScript.
- The shell contains many references to seraph, this is likely his/their blog in China
- It looks like one of seraph's buddies, chanm is actually doing the attack as I've seen Windows users created with the name of chanm$.
- More info about wminotify.dll from Symantec
- Read through the comments on Ray Camden's post about this issue which includes many details from various people's experience with this attack
- The attacker is sometimes uploading a JSP file to get around the security layer in ColdFusion, which allows complete bypass of any Sandboxes you already had setup
- DO NOT blindly trust the MIME types that are sent by a browser, these are easily spoofed.
- DO upload outside you web root initially
- DO additional checks on uploaded files before pushing them live (file extensions should match, use functions like isImageFile() and isPDFFile() in ColdFusion, etc.)
- DO protect uploads with some sort of login (assuming your business rules preclude the public uploading content to your site)
- DO disable JSP handling in ColdFusion if you don't use it, see Adobe instructions.
Last Update: 2 July 2009 12:40 PM
5 comments - Posted by Brent Frye at 6:13 PM - Categories: ColdFusion | Security