CVE-2021-22043 Overview
CVE-2021-22043 is a Time-of-Check Time-of-Use (TOCTOU) vulnerability affecting VMware ESXi and VMware Fusion. The vulnerability exists in the way temporary files are handled within the settingsd service. A malicious actor with access to settingsd may exploit this race condition to escalate their privileges by writing arbitrary files to the system.
Critical Impact
Successful exploitation allows an authenticated attacker to escalate privileges and write arbitrary files, potentially leading to full system compromise of the virtualization host.
Affected Products
- VMware ESXi 7.0 Update 1
- VMware ESXi 7.0 Update 2
- VMware ESXi 7.0 Update 3
- VMware Fusion (various versions)
Discovery Timeline
- 2022-02-16 - CVE-2021-22043 published to NVD
- 2024-11-21 - Last updated in NVD database
Technical Details for CVE-2021-22043
Vulnerability Analysis
This vulnerability is classified as CWE-367 (Time-of-check Time-of-use Race Condition). The flaw exists in how the settingsd service handles temporary files during configuration operations. When the service checks file properties and then subsequently uses those files, a window of opportunity exists where an attacker can manipulate the file between these two operations.
The attack requires the adversary to already have some level of access to the settingsd service, which manages various VMware configuration settings. By exploiting the race condition, an attacker can substitute a legitimate temporary file with a malicious one, causing the service to write attacker-controlled content to arbitrary file system locations.
Root Cause
The root cause is a classic TOCTOU race condition in the temporary file handling logic. The settingsd service performs a security check on a file (time-of-check) and then performs an operation on that file (time-of-use) without adequate protection against the file being modified between these two events. This allows an attacker to win the race by replacing the validated file with a malicious payload before it is consumed by the privileged operation.
Attack Vector
The attack vector is network-based but requires authentication and access to the settingsd service. The attacker must:
- Gain access to the settingsd service on the affected VMware ESXi or Fusion host
- Monitor for temporary file creation events during configuration operations
- Exploit the race condition by rapidly substituting a malicious file during the window between the check and use operations
- Achieve arbitrary file write with elevated privileges
The exploitation mechanism involves timing-sensitive file system operations. An attacker would typically create a symbolic link or replace the temporary file with attacker-controlled content during the brief window when the file has been validated but not yet consumed. Due to the network attack vector combined with the requirement for specific service access and precise timing, exploitation complexity is considered high.
Detection Methods for CVE-2021-22043
Indicators of Compromise
- Unusual file creation or modification events in VMware ESXi temporary directories
- Unexpected symbolic links appearing in paths used by settingsd
- Privilege escalation alerts from ESXi security logs
- Anomalous file write operations with elevated permissions
Detection Strategies
- Monitor file system activity for rapid creation and deletion of temporary files in ESXi configuration directories
- Implement file integrity monitoring (FIM) on critical ESXi system paths
- Analyze ESXi logs for suspicious settingsd service activity patterns
- Deploy behavioral detection rules to identify race condition exploitation attempts
Monitoring Recommendations
- Enable verbose logging for the settingsd service to capture detailed operation records
- Configure SIEM alerts for file system anomalies on virtualization hosts
- Implement process monitoring to detect unusual parent-child process relationships involving settingsd
- Review authentication logs for unauthorized access attempts to management services
How to Mitigate CVE-2021-22043
Immediate Actions Required
- Apply the latest VMware security patches referenced in VMSA-2022-0004
- Restrict network access to settingsd and other management services to authorized administrators only
- Review and audit user accounts with access to ESXi management interfaces
- Implement network segmentation to isolate management interfaces from untrusted networks
Patch Information
VMware has released security updates to address this vulnerability. Administrators should consult the VMware Security Advisory VMSA-2022-0004 for specific patch information and update instructions for affected products.
For VMware ESXi 7.0, ensure the latest update releases are applied that contain the fix for this TOCTOU vulnerability. VMware Fusion users should update to the latest available version as specified in the advisory.
Workarounds
- Limit access to the settingsd service to only essential administrative accounts
- Implement strict access controls on ESXi management networks
- Deploy host-based intrusion detection to monitor for exploitation attempts
- Consider temporarily disabling non-essential management services until patches can be applied
# Restrict network access to ESXi management interface
# Add firewall rules to limit access to trusted management IPs
esxcli network firewall ruleset set --enabled true --ruleset-id sshServer
esxcli network firewall ruleset allowedip add --ruleset-id sshServer --ip-address 10.0.0.0/24
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


