Facebook Google Plus Twitter LinkedIn YouTube RSS Menu Search Resource - BlogResource - WebinarResource - ReportResource - Eventicons_066 icons_067icons_068icons_069icons_070

Carbon Black Installer Multiple Vulnerabilities

Medium

Synopsis

The CarbonBlack installer package for macOS (CbDefense Install_3.4.3.44 and prior) has been discovered to contain multiple security-related issues.

The installer utilizes insecure directories during the installation process. The two directories in question are "/tmp" (this is a symlink to "/private/tmp" on modern macOS variants) and "/private/var/tmp". The following files make use of these directories during the installation process (primarily in the "preinstall" binary): .cbd, .confer_install_type, cloud.pem, confer.ini, cfg.ini, and dynamic log files. Since these files are all user-readable/writable at this point, they are all vulnerable to manipulation by a local attacker, most prominently, symlink attacks.

As the installer access these files as root and copies their contents into the main application directory later in the process, which are then world-readable, a local attacker can use this vector to copy information into these file from files they would not normally have access to, which they can later read at the new location. For example, an unprivileged user could do something like the following:

while true; do
  ln -f -F -s /some_root_only_file /tmp/cbdefense-install/cloud.pem
done

The above, while inelegant and inconsistent, has two possible outcomes based on the timing of the attack. In the first possible outcome, the installer will simply overwrite whatever the symlink points to. This outcome happens because of the initial copy from the installer to the tmp directory. This could cause system instability and result in a denial of service like condition for the entire host. In the second possible outcome, which happens if triggered after the initial copy, the content of the target file will be copied to "/Applications/Confer.app/cloud.pem" (or whatever directory is configured for the host), which is readable by unprivileged users. This can be used as an information disclosure.

While we were not able to achieve privilege escalation with these vectors during our investigation, we do consider it a theoretical possibility. 

Additionally, the "postinstall" binary contains a buffer overflow due to an unchecked call to "strcpy()" when parsing configuration files. The following is a snippet from our reverse engineering process showcasing problematic logic:

if (config_file[0] == '[') {        // Checks that we're in a config section
  _strcpy(local_438,config_file);   // copies the file (controllable via the above issues) into a buffer whose bounds are not validated

When combined with the attacks above (such as manipulating "confer.ini"), an attacker could use this to execute code in the context of the root user. This attack is exceedingly complicated, however, in terms of timing required (the file must remain valid for a short period before the vulnerable code is executed). While unlikely to be exploited, VMware has opted to fix the issue out of an abundance of caution.

Disclosure Timeline

September 16, 2020 - Tenable discloses to vendor.
September 21, 2020 - Tenable requests acknowledgement.
September 22, 2020 - Vendor acknowledges.
October 7, 2020 - Tenable requests status update.
October 16, 2020 - Vendor sends status update.
November 13, 2020 - Tenable requests status update.
November 16, 2020 - Vendor provides status update. More info to follow.
November 16, 2020 - Vendor provides detailed status update.
November 16, 2020 - Tenable acknowledges.
November 20, 2020 - Vendor requests extension.
November 23, 2020 - Tenable declines.
December 8, 2020 - Vendor asks who to credit and proposes new CVSS score.
December 9, 2020 - Tenable responds.
December 11, 2020 - Vendor requests clarification.
December 14, 2020 - Tenable provides clarification.
December 15, 2020 - Vendor releases patch without prior notification.

All information within TRA advisories is provided “as is”, without warranty of any kind, including the implied warranties of merchantability and fitness for a particular purpose, and with no guarantee of completeness, accuracy, or timeliness. Individuals and organizations are responsible for assessing the impact of any actual or potential security vulnerability.

Tenable takes product security very seriously. If you believe you have found a vulnerability in one of our products, we ask that you please work with us to quickly resolve it in order to protect customers. Tenable believes in responding quickly to such reports, maintaining communication with researchers, and providing a solution in short order.

For more details on submitting vulnerability information, please see our Vulnerability Reporting Guidelines page.

If you have questions or corrections about this advisory, please email [email protected]

Risk Information

CVE ID: CVE-2020-4008
Tenable Advisory ID: TRA-2020-69
Credit:
Jimi Sebree
CVSSv3 Base / Temporal Score:
5.8 / 5.2
CVSSv3 Vector:
AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:L
Affected Products:
Carbon Black Sensor installers prior to version 3.5.1
Risk Factor:
Medium

Advisory Timeline

December 15, 2020 - Initial release