CVE-2021-34527: Microsoft Windows Print Spooler Remote Code Execution Vulnerability
A remote code execution vulnerability exists when the Windows Print Spooler service improperly performs privileged file operations. An attacker who successfully exploited this vulnerability could run arbitrary code with SYSTEM privileges. An attacker could then install programs; view, change, or delete data; or create new accounts with full user rights. UPDATE July 7, 2021: The security update for Windows Server 2012, Windows Server 2016 and Windows 10, Version 1607 have been released. Please see the Security Updates table for the applicable update for your system. We recommend that you install these updates immediately. If you are unable to install these updates, see the FAQ and Workaround sections in this CVE for information on how to help protect your system from this vulnerability. In addition to installing the updates, in order to secure your system, you must confirm that the following registry settings are set to 0 (zero) or are not defined (Note: These registry keys do not exist by default, and therefore are already at the secure setting.), also that your Group Policy setting are correct (see FAQ): HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers\PointAndPrint NoWarningNoElevationOnInstall = 0 (DWORD) or not defined (default setting) UpdatePromptSettings = 0 (DWORD) or not defined (default setting) Having NoWarningNoElevationOnInstall set to 1 makes your system vulnerable by design. UPDATE July 6, 2021: Microsoft has completed the investigation and has released security updates to address this vulnerability. Please see the Security Updates table for the applicable update for your system. We recommend that you install these updates immediately. If you are unable to install these updates, see the FAQ and Workaround sections in this CVE for information on how to help protect your system from this vulnerability. See also KB5005010: Restricting installation of new printer drivers after applying the July 6, 2021 updates. Note that the security updates released on and after July 6, 2021 contain protections for CVE-2021-1675 and the additional remote code execution exploit in the Windows Print Spooler service known as “PrintNightmare”, documented in CVE-2021-34527.
CVE-2021-34527 is a remote code execution vulnerability in the Microsoft Windows Print Spooler service, also known as PrintNightmare. It stems from the service improperly performing privileged file operations, allowing an attacker who successfully exploits it to run code with SYSTEM privileges on affected Windows systems. This matters because Print Spooler is widely enabled by default across Windows environments, and the flaw has been used in ransomware campaigns, elevating the urgency for IT and security teams to identify and address exposure.
How it works
The weakness is classified as CWE-269, improper privilege management. In this case, the Windows Print Spooler service fails to correctly handle privileged file operations. An attacker can abuse that behavior to achieve remote code execution under the highly privileged SYSTEM context. Public detail on exact exploit mechanics is limited; defenders should treat any untrusted interaction with the Print Spooler service as potentially dangerous and confirm technical specifics against the vendor advisory. Successful exploitation grants the attacker the ability to execute arbitrary code with full system rights, which can lead to persistence, lateral movement, or deployment of further payloads including ransomware.
Am I affected? How to find it in your systems
The vulnerability affects Microsoft Windows systems that run the Print Spooler service. This service is commonly present on workstations, member servers, and domain controllers. Inventory every Windows host and determine whether the Print Spooler service is installed and running. Check service state with standard administrative tools (services.msc, PowerShell Get-Service, or equivalent enterprise inventory agents). Because exact affected builds are not listed here, compare your OS builds and patch levels directly against the Microsoft advisory for CVE-2021-34527.
- Enumerate hosts where the spooler service (spoolsv.exe) is present or set to automatic/start.
- Review recent authentications, print-related RPC activity, and unexpected driver or DLL loads under the spooler process.
- Look for anomalous file writes or process creations originating from the Print Spooler service context in endpoint detection and Windows event logs.
- Prioritize internet-facing or highly privileged systems (especially domain controllers) that have the service enabled.
Telemetry signs of exploitation are not exhaustively specified in public summaries; treat unexplained SYSTEM-level activity tied to the spooler as suspicious and investigate promptly.
How to remediate
Patch first. Apply the updates Microsoft released for this vulnerability exactly as directed in the vendor advisory. CISA’s required action is to apply updates per vendor instructions. After patching, verify the installed updates and confirm the service behaves as expected.
- Deploy the vendor security update across all Windows systems in scope through your normal patch management process.
- Reboot where required by the update and validate that the Print Spooler service is running the remediated binaries.
- Where printing is not required, disable the Print Spooler service as a hardening step after confirming business need.
- Restrict who can add printer drivers and limit point-and-print related privileges according to Microsoft guidance.
- Re-inventory to ensure no residual unpatched systems remain, especially domain controllers and jump hosts.
If you can't patch immediately
Implement compensating controls to reduce attack surface until the vendor update can be applied.
- Disable the Print Spooler service on systems that do not need to print or act as print servers; this is especially important on domain controllers.
- Segment networks so that only authorized print clients can reach spooler endpoints; block unnecessary RPC and SMB paths at internal firewalls.
- Apply application control or attack-surface reduction rules that constrain the spooler process from loading untrusted libraries or writing to unexpected locations.
- Increase monitoring and alerting on spooler process creations, driver installations, and SYSTEM-level child processes.
- Use virtual patching or host-based controls where available to enforce least privilege around print-related operations, while still planning rapid patch deployment.
These measures lower risk but do not replace the official update; schedule patching as soon as possible.
If your data may have been exposed
Actively exploited vulnerabilities that grant SYSTEM code execution are frequently leveraged in ransomware and broader intrusion campaigns. If you have evidence of exploitation or suspect compromise, follow your incident response plan: isolate affected hosts, preserve forensic data, reset credentials, and hunt for persistence. As an additional check, you can run a free exposure scan of your email addresses against known breach data to see whether associated credentials or personal information have appeared in prior incidents.
AICompiled with AI assistance from public sources and published under our editorial standards.
Details
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HReferences
- msrc.microsoft.com/update-guide/vulnerability/CVE-2021-34527
- packetstormsecurity.com/files/167261/Print-Spooler-Remote-DLL-Injection.html
- portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2021-34527
- www.kb.cert.org/vuls/id/383432
- www.vicarius.io/vsociety/posts/cve-2021-34527-printnightmare-detection-script
- www.vicarius.io/vsociety/posts/cve-2021-34527-printnightmare-mitigation-script
- www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2021-34527