Update PrintNightmare - Remote Code Execution vulnerability

Table of Contents

Update “PrintNightmare” gets its own CVE

Official recommendation published by Microsoft

We are releasing a fourth update for the “PrintNightmare” vulnerability, which affects the Windows Printer Spooler Service, and are updating our recommendations because the updates do not effectively protect against exploitation of the vulnerabilities under certain conditions. Last Friday we reported on the new “Locale Privilege Escalation” vulnerability in the Print Spooler Service with CVE-2021-34481. Last Sunday evening, another (fourth) gap in the service became known, for which there is currently no security update and little information.

Got a security incident?
Trust our certified IT forensic experts in the event of anomalies.
Inquire now

Overview of the “PrintNightmare” gaps

Print nightmare table
Type of gapCVEdiscoveryUpdate available?
Local Privilege EscalationN/A18.07.2021No
Local Privilege EscalationCVE-2021-3448115.07.2021No
Remote Code ExecutionCVE-2021-3452727.06.2021Ja
Local Privilege EscalationCVE-2021-167508.06.2021Ja

Background of the new gap

Under Microsoft Windows, regular users without admin rights can also install printer drivers via “point and print”. In this way, a printer can load any program libraries into the print spooler process, which runs with SYSTEM privileges by default.

Description

With the update MS16-087 The attack vector should be avoided because in the future printer drivers should be digitally signed by MS itself or a trustworthy party. 

Although driver packages are now signed, printers can still reload certain files. However, these files do not currently need to be signed and can be transferred to a Windows client via point-and-print installation. These files can then be used with another printer that has SYSTEM privileges, resulting in a “Local Privilege Escalation”. 

Affected systems:

It can currently be assumed that all common Windows systems are affected by the new gaps.

Suggestion:

The following recommendation applies to the newly discovered gap:

Block outgoing SMB connections:

The exploits known so far use SMB to establish a connection to a shared printer. Blocking outgoing SMB connections can reduce the attack surface on the internal network. Microsoft also points out that about the [MS-WPRN] Web Point and Print Protocol Theoretically, any printer driver could be installed without using SMB.

Configuration of PackagePointAndPrintServerList:

There is a group policy “Package Point and Print – Approved servers” which is in the registry values
“HKLM\Software\Policies\Microsoft\

WindowsNT\Printers\

PackagePointAndPrint\

PackagePointAndPrintServerList" and "HKLM\Software\Policies\Microsoft\

WindowsNT\Printers\

PackagePointAndPrint\ListofServers"

Group Policy can be used to restrict which servers can install regular printer drivers via point-and-print. This can prevent the drivers from being installed via any server.

References to the new gap:

Update recommendation for the RCE vulnerability CVE-2021-34527

We had already reported on the gap with CVE-2021-34527. Unfortunately, despite the update provided by Microsoft, there is still the possibility of exploiting the vulnerability under certain conditions. We recommend the following procedure for checking. The recommendation is based on the official recommendations from Microsoft.

1st step - installing the updates

Make sure the latest updates are installed. The updates can be found below Link

Step 2 - Check the registry and set GPO for point and print restrictions:

After installing the update, the following two conditions should be checked:

  1. Within the registry: HKEY_LOCAL_MACHINE \ SOFTWARE\Policies\Microsoft\Windows NT\Printers\PointAndPrint
  • NoWarningNoElevation OnInstall = 0 (DWORD) or not defined (default setting)
  • UpdatePromptSettings = 0 (DWORD) or not defined (default setting)

(If NoWarningNoElevationOnInstall is set to 1, the system is vulnerable)

  1. The Group Policy to restrict Point and Print has not yet been configured

If both conditions apply, there is no vulnerability to CVE-2021-34527 and therefore no further action is required to prevent this vulnerability. Otherwise, proceed as follows:

Open the Group Policy Editor at: computer configuration > Administrative Templates > printer

Configure the “Point and Print Restrictions” setting as follows:

  • Set Group Policy to Enabled
  • “When installing drivers for a new connection”: “Show warning and elevation prompt”
  • “When updating drivers for an existing connection”: “Show warning and upgrade prompt”

The picture shows the recommended settings again:

recommended settings:

Important – The policy should be applied wherever the Print Spooler Service is active.

Step 3 - Confirmation of correct implementation of the policy:

The following registry keys confirm that the policy was implemented correctly:

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers\PointAndPrint

  • NoWarningNoElevation OnInstall = 0 (DWORD)
  • UpdatePromptSettings = 0 (DWORD)

If these values not are zero, the affected device is vulnerable to the CVE-2021-34527 vulnerability despite the update

Configuring this setting does not disable the Point and Print feature or requires a reboot.

Step 4 (optional, but still recommended by us) -

Override point-and-print restrictions so that only administrators can install printer drivers on printer servers:

To do this, the value RestrictDriverInstallationToAd ministrators must be set to 1 in the registry under HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\PointAndPrint. This will result in all point-and-print restriction policies being overwritten.

Further information is below Link a DAK Bungalow.

Update 16. July 2021

The new vulnerability CVE-2021-34481 once again makes it possible for a local attacker to extend his rights to system rights. Since the new gap once again affects the Print Spooler Service, the recommendation for workarounds still applies.

Affected systems:

It is currently unclear which systems are affected in detail, which is why caution is advised.

Suggestion:

First, the patch published by Microsoft should be installed to fix the existing gaps. Since there is no patch for the new vulnerability yet, here is the recommendation for a workaround:

Microsoft recommends the following steps:

Check whether the service is used using PowerShell (as domain admin)

Get-Service -Name Spooler

If the service is used, there are two options to switch it off or restrict it:

Option 1 - Shutdown Print Spooler Service

If the service can be turned off without restrictions, the following PowerShell commands can be used:

Stop Service -Name Spooler -Force

Set-Service -Name Spooler -StartupType Disabled

A notice!: Switching it off deactivates the service and thus also the ability to print locally and remotely.

Option 2 - Disabling remote access to the printer service through Group Policy

 

As an alternative, the remote access service can be restricted via group policy:

In the Group Policy Editor under “Computer Configuration\Administrative Templates\Printers"

the policy: “Allow accepting client connections to the print spooler” can be set to “Disabled”.

This policy blocks remote requests, but still allows local printing on the device as long as the printer is connected directly to the PC.

More information is available at use-group-policy-to-control-ad-printer to find