Skip to content
RCE Write-up Advanced

Bullied by Bugcrowd over Kape CyberGhost disclosure

The CyberGhost VPN client's privileged Windows service accepted JSON requests over a named pipe and built an OpenVPN command line without properly validating the ServerIp field, allowing command line injection. An attacker could exploit this to execute arbitrary code with SYSTEM privileges, leading to full system compromise.

Ceri Coburn Follow

Published on pentestpartners.com

The CyberGhost VPN client suffers from an elevation of privilege vulnerability and is filed under CVE-2023-30237. A specially crafted JSON payload sent to the CyberGhost RPC service can lead to command line injection when the OpenVPN process is launched, leading to full system compromise.

PTP Admin, on pentestpartners.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The service failed to properly sanitise the ServerIp field before concatenating it into the OpenVPN command line, and its argument filtering was bypassed because CommandLineToArgvW strips quotes in a way that hid the dangerous -plugin argument from the filter.

Impact

An attacker could achieve full system compromise by executing arbitrary code with SYSTEM privileges, but only locally because the named pipe is not accessible over the network.

What the attacker needed

Local access to the machine; ability to run code as a low-privileged user

The fix

The vulnerability was fixed in version 8.3.10.10015 released on 24 February 2023.

How it was found

  1. Connect to the named pipe MachineNameCyberGhost8Service, bypassing the process name check by spoofing the process name or injecting into Dashboard.exe.
  2. Send a JSON request to the ConnectToVpnServer method with a crafted ServerIp field containing the injection.
  3. The service builds an OpenVPN command line including the injected arguments and a null character to truncate the rest.
  4. OpenVPN is launched with the -plugin argument pointing to a malicious DLL, which executes the attacker's code.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

The VPN program has two parts: a normal user interface and a background service that runs with high privileges. The background service trusted input from the user interface too much and used it to build a command for another program (OpenVPN). By sneaking extra instructions into that input, an attacker could make the background service run their own code with high privileges.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by Ceri Coburn

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.