CVE-2023-50227
Executive Summary
CVE-2023-50227 is a critical Out-Of-Bounds Write vulnerability in the virtio-gpu virtual device component of Parallels Desktop. This flaw allows a remote attacker to execute arbitrary code within the context of the hypervisor, effectively breaking out of the guest virtual machine. The attack requires user interaction, specifically a guest user visiting a malicious page or opening a malicious file. The vulnerability has a CVSS score of 8.3, indicating high severity. No public proof-of-concept or patch is currently available, making this a high-priority zero-day threat for organizations using Parallels Desktop.
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 Score: 8.3 (High)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
- Attack Vector (AV): Network (N) - The attack can be launched remotely.
- Attack Complexity (AC): Low (L) - No special conditions are required.
- Privileges Required (PR): None (N) - No authentication needed.
- User Interaction (UI): Required (R) - The guest user must perform an action (visit a page or open a file).
- Scope (S): Changed (C) - The vulnerability impacts resources beyond the original authorization scope (guest to host).
- Confidentiality (C): High (H) - Full host data compromise is possible.
- Integrity (I): High (H) - Full host system control is possible.
- Availability (A): High (H) - Full host denial of service is possible.
Threat Level: Critical. The ability to escape a virtual machine and execute code on the host hypervisor represents a complete compromise of the virtualization platform.
Deep Dive & Mechanics
The vulnerability resides in the virtio-gpu virtual device, which is a paravirtualized graphics card used in Parallels Desktop. The flaw is a classic Out-Of-Bounds Write (CWE-787) caused by insufficient validation of user-supplied data.
Technical Breakdown:
- Attack Vector: The attacker, controlling a malicious website or file, triggers the vulnerability from within the guest VM.
- Trigger Mechanism: The guest's graphics driver sends a crafted command to the virtio-gpu device. This command contains a buffer descriptor with a manipulated size or offset.
- Vulnerable Code Path: The hypervisor's virtio-gpu backend processes this command without properly validating the bounds of the provided buffer. It uses the attacker-controlled size to perform a memory copy operation.
- Out-Of-Bounds Write: The copy operation writes data past the end of the allocated buffer in the hypervisor's memory space.
- Code Execution: The attacker can carefully craft the data being written to overwrite critical hypervisor structures (e.g., function pointers, return addresses) and redirect execution flow to attacker-controlled shellcode.
This is a classic VM escape scenario. The attacker moves from a restricted guest environment to the full privileges of the host operating system.
Vulnerable vs. Patched Code
No official patch or source code diff is available. However, based on the vulnerability description, the fix would involve adding proper bounds checking in the virtio-gpu backend.
Vulnerable Code (Conceptual):
// Vulnerable: No bounds check on 'size' parameter
void virtio_gpu_transfer_to_host_2d(VirtIOGPU *g, struct virtio_gpu_ctrl_hdr *cmd) {
struct virtio_gpu_transfer_to_host_2d *req = (void *)cmd;
uint32_t size = req->size; // Attacker controlled
uint32_t offset = req->offset; // Attacker controlled
uint8_t *buf = g->backing_storage; // Pre-allocated buffer
// BUG: No check if (offset + size) > g->backing_storage_size
memcpy(buf + offset, guest_data, size); // Out-of-bounds write
}
Patched Code (Conceptual):
// Patched: Added bounds check
void virtio_gpu_transfer_to_host_2d(VirtIOGPU *g, struct virtio_gpu_ctrl_hdr *cmd) {
struct virtio_gpu_transfer_to_host_2d *req = (void *)cmd;
uint32_t size = req->size;
uint32_t offset = req->offset;
uint8_t *buf = g->backing_storage;
uint32_t buf_size = g->backing_storage_size;
// FIX: Validate bounds before copy
if (offset + size > buf_size || offset + size < offset) {
// Reject the command
return;
}
memcpy(buf + offset, guest_data, size);
}
Exploitation & Lab Setup
Red Team (Exploitation)
Lab Setup:
- Host: macOS or Windows with Parallels Desktop (vulnerable version).
- Guest: Any supported guest OS (e.g., Windows 10, Ubuntu).
- Tools: Python, a C compiler (for crafting the exploit), a debugger (WinDbg, GDB), and a network traffic analyzer (Wireshark).
Exploitation Steps:
- Reconnaissance: Identify the memory layout of the virtio-gpu device within the hypervisor process.
- Craft Payload: Create a malicious command for the virtio-gpu device. This command will contain a large
sizefield and a carefully crafted data payload. - Trigger: Deliver the payload via a malicious webpage (JavaScript) or a crafted file (e.g., a malformed image). The guest user must interact with this.
- Exploit: The out-of-bounds write overwrites a function pointer in the hypervisor's memory. The attacker's shellcode is then executed.
- Post-Exploitation: Once code execution on the host is achieved, the attacker can deploy a backdoor, exfiltrate data, or pivot to other systems.
Note: No public exploit code is available. This is a theoretical exploitation path.
Blue Team (Defense & Detection)
Detection Strategy:
- Monitor virtio-gpu Commands: Log and alert on unusual or malformed virtio-gpu commands from the guest to the host.
- Memory Integrity Checks: Use host-based EDR to monitor for unexpected memory writes to the hypervisor process.
- User Interaction Monitoring: Correlate guest user activity (browsing, file opening) with subsequent anomalous host behavior.
Hunting Queries:
- Windows (Sysmon): Look for
Event ID 10 (ProcessAccess)where the target process is the Parallels hypervisor process (e.g.,prl_hypervisor.exe). - macOS (Unified Logging): Search for kernel or hypervisor logs indicating a crash or memory access violation in the virtio-gpu driver.
Indicators of Compromise (IOCs)
- Network:
- Outbound connections from the host to unknown IPs on unusual ports (post-exploitation C2).
- Unusual traffic patterns between the guest and host on the virtio-gpu channel.
- Host System:
- Unexpected processes spawned from the Parallels hypervisor process.
- Modification of critical system files (e.g.,
prl_hypervisor.dll,prl_hypervisor.kext). - New scheduled tasks or launch daemons.
- Memory:
- Anomalous memory regions in the hypervisor process with RWX permissions.
- Overwritten function pointers in the virtio-gpu driver's dispatch table.
Detection Engineering
YARA Rule
rule CVE_2023_50227_Virtio_GPU_Exploit {
meta:
description = "Detects potential exploit attempts for CVE-2023-50227 in memory dumps"
author = "Valters IT"
date = "2024-01-01"
reference = "CVE-2023-50227"
strings:
$s1 = "virtio-gpu" ascii wide nocase
$s2 = "transfer_to_host_2d" ascii wide nocase
$s3 = { 48 8B 45 ?? 48 03 45 ?? 48 39 45 ?? } // Potential OOB check bypass
condition:
all of ($s1, $s2) or $s3
}
Sigma Rule
title: CVE-2023-50227 - Parallels Desktop virtio-gpu OOB Write
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects potential exploitation of CVE-2023-50227 via anomalous virtio-gpu commands.
author: Valters IT
date: 2024-01-01
logsource:
product: windows
service: sysmon
detection:
selection:
EventID: 10
TargetImage|endswith: '\\prl_hypervisor.exe'
GrantedAccess: '0x1FFFFF' # Full access
condition: selection
falsepositives:
- Legitimate Parallels updates
level: high
Suricata Rule
alert tcp $GUEST_NET any -> $HOST_IP any (msg:"CVE-2023-50227 - Potential virtio-gpu OOB Write Exploit"; flow:to_server; content:"|00 00 00 00|"; depth:4; offset:0; content:"|01 00 00 00|"; distance:4; within:4; content:"|FF FF FF FF|"; distance:8; within:4; sid:1000001; rev:1;)
Note: The Suricata rule is a placeholder and would need to be tuned based on the actual protocol structure of the virtio-gpu communication channel.
Remediation & Mitigation
Immediate Actions:
- Isolate: Disconnect affected systems from the network if possible.
- Monitor: Implement the detection rules above to identify any ongoing exploitation.
- Restrict: Limit user interaction with untrusted content (websites, files) within virtual machines.
Long-Term Fix:
- Patch: Apply the official patch from Parallels as soon as it becomes available.
- Update: Ensure all Parallels Desktop installations are updated to the latest version.
- Hardening: Disable the virtio-gpu device if not required. Use a simpler framebuffer device instead.
- Network Segmentation: Place critical VMs on isolated networks to limit the blast radius of a VM escape.
Workaround:
- If the virtio-gpu device is not essential, disable it in the VM configuration. This will prevent the attack vector but may degrade graphics performance.
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.