Talos Vulnerability Report

TALOS-2018-0675

Shimo VPN helper tool writeConfig privilege escalation vulnerability

April 15, 2019

CVE Number

CVE-2018-4006

Summary

An exploitable privilege escalation vulnerability exists in the Shimo VPN 4.1.5.1 helper service in the writeConfig functionality. A non-root user is able to write a file anywhere on the system. A user with local access can use this vulnerability to raise their privileges to root. An attacker would need local access to the machine to exploit it successfully.

Tested Versions

Shimo VPN 4.1.5.1

Product URLs

CVSSv3 Score

9.3 - CVSS:3.0/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

CWE

CWE-19: Improper Input Validation

Details

Shimo VPN is a VPN client for Mac OSX used to connect to and manage multiple VPN accounts in one place. The application uses what is defined as a "Helper Tool" to do some of the privileged work on its behalf. The helper tool is installed as root when the application is first installed and is a LaunchD daemon, meaning it will be restarted if it is killed. The service listens using:

The second argument registers the string passed in as a service and tells it to begin listening. This opens the service up to be connected to using Objective-C XPC calls. To connect a client to this service, a similar section of code needs to be executed.

At [1], the same call as the one above is used, except this time, the options variable is used to signify that the client is connecting rather than listening. At [2], a special protocol is passed in, which defines all the functions available to the client. The server must have the same protocol defined in order for these calls to work. We can begin to see the vulnerabilities arise by looking at the protocol.

The next function to look at is called writeConfig:atPath:withReply:. The relevant code is shown below.

Location [3] has a passed in an argument being used to construct a proper string. Then, [4] checks if this argument exists as a file. A directory structure is attempted to be created for it if it does not exist. At [5], the passed-in file is removed if it exists and, finally, at [6], the data passed into the function is written out to the file provided. This allows a non-privileged user to write to a privileged location crossing a privilege boundary and creating a privilege escalation vulnerability.