Presentation
Netskope is a cloud security platform that provides a complete security solution for companies that use cloud applications, access cloud data and use the Internet for their daily activities. On Windows, the Netskope Client ships two components: a stAgentSVC service running with NT/SYSTEM privileges, and a stAgentUI.exe client running with user privileges that communicates with the service over a local socket.
During a security audit requested by a customer who wanted to know whether their corporate laptops could be compromised, HDW Sec identified several vulnerabilities in the Netskope Client that, when chained together, allow a local low-privileged user to elevate to NT/SYSTEM. The root cause tracked as CVE-2023-2270 is a path-traversal (Zip Slip) flaw in the connection handler, which uses a relative path when downloading and unzipping configuration files, letting a local user place arbitrary files in privileged-only directories.
Issue(s)
The privilege escalation is built by chaining the following weaknesses:
- Netskope writes a JSON configuration file (
nsbranding.json) that is readable and writable by the user. This file holds the URLs Netskope loads when starting the service. - A ZIP file is downloaded and extracted by the
stAgentSVCservice (running as SYSTEM). The extraction is vulnerable to Zip Slip (path traversal), allowing extraction of archive content to arbitrary locations on disk. - A DLL can be injected into the Netskope client (
stAgentUI.exe) to communicate with the service (stAgentSVC), bypassing the client-path integrity check. netsh.execan be launched by Netskope with SYSTEM privileges and is vulnerable to DLL side loading (a missingwow64log.dll).
Combining these makes it possible to execute code on the host with SYSTEM privileges.
Full technical analysis
The complete write-up (root cause, exploitation, proof of concept) is available on the HDW Sec blog: https://www.hdwsec.fr/blog/20230622-netskope/
References
- HDW Sec blog: https://www.hdwsec.fr/blog/20230622-netskope/
- CVE-2023-2270 (NVD): https://nvd.nist.gov/vuln/detail/CVE-2023-2270