ZeroHour
Kaspersky Securelistpublished ()ingested @Securelist

A patched Windows attack surface is still exploitable

Vulnerabilities mentionedAll →

CVEVulnerabilityCVSSEPSSFlagsAffectedExposurePublished
CVE-2022-22047
Local Privilege Escalation in Windows CSRSS Affects Nearly All Windows Versions

CVE-2022-22047 is an elevation-of-privilege vulnerability in the Windows Client Server Run-time Subsystem (CSRSS), a core user-mode process that handles console and system tasks, caused by an untrusted search path (CWE-426). An attacker who already has a low-privileged foothold on a Windows machine can trigger the flaw locally, with no user interaction, to elevate to SYSTEM/administrator-level privileges. Because CSRSS is present on essentially every Windows installation, the affected population spans Windows 7, 8.1, RT 8.1, Windows 10 (1507 through 21H2), Windows 11 21H2, and Windows Server 2008 and 2012, meaning virtually every Windows desktop, laptop, and server in active use is potentially affected. The vulnerability is confirmed exploited in the wild: CISA added it to the Known Exploited Vulnerabilities catalog on July 12, 2022 with an August 2 patch deadline for federal agencies, and EPSS assigns it an 18.8% probability of exploitation within 30 days (97th percentile).

Do: Apply Microsoft's July 12, 2022 (Patch Tuesday) security updates immediately across all affected releases, including Windows 7, 8.1, RT 8.1, and Server 2008/2012, where fixes arrive through the same July update servicing; CISA's KEV deadline for federal agencies is August 2, 2022. Treat any host where a local attacker has executed code as potentially compromised to SYSTEM level, and hunt for post-exploitation activity. Keep monitoring vendor guidance, as recent reporting suggests some patched Windows attack surfaces may still be exploitable, so continue applying follow-on Windows updates as they ship.

7.819% KEV
  • microsoft Windows 10 1507
  • microsoft Windows 10 1607
  • microsoft Windows 10 1809
  • +9 more
mass≈1 billion+ Windows devices and servers (the affected list spans Windows 7 through Windows 11 and legacy server releases)
CVE-2022-29104
Windows Print Spooler Elevation of Privilege Vulnerability

Windows Print Spooler Elevation of Privilege Vulnerability

NVD description · AI analysis pending
7.812%
  • microsoft windows 10
  • microsoft windows 11
  • microsoft windows 7
  • +1 more
CVE-2022-37989
Windows Client Server Run-time Subsystem (CSRSS) Elevation of Privilege Vulnerability

Windows Client Server Run-time Subsystem (CSRSS) Elevation of Privilege Vulnerability

NVD description · AI analysis pending
7.89%
  • microsoft windows 10
  • microsoft windows 11
  • microsoft windows 7
  • +1 more
CVE-2022-41073
Out-of-Bounds Write Privilege Escalation in Microsoft Windows Print Spooler

CVE-2022-41073 is an out-of-bounds write flaw (CWE-787) in the Microsoft Windows Print Spooler that allows a local, low-privileged user to elevate privileges (CVSS 3.1: 7.8, local attack vector, no user interaction required). It is triggered when the spooler service processes maliciously crafted content on the local machine, letting an attacker who already has a foothold run code at higher privileges. Successful exploitation effectively grants elevated (up to SYSTEM-level) control of the host, which attackers typically use to persist and move toward domain or ransomware objectives after initial access. Affected systems are essentially all listed Windows client and server editions with the Print Spooler running (enabled by default), spanning Windows 7 through Windows 11 22H2 and Windows Server 2008. The vulnerability was being actively exploited when Microsoft patched it in the November 2022 release, CISA added it to the KEV catalog on 2022-11-08 with ransomware use known, and no public PoC is cataloged despite confirmed in-the-wild exploitation.

Do: Apply Microsoft's November 2022 security updates across all affected Windows versions, prioritizing domain controllers, file/print servers, and other shared or internet-reachable hosts, consistent with CISA's required KEV action. Where patching must wait and printing is not required, disable or restrict the Print Spooler service as an interim mitigation, noting this breaks local and network printing. Because exploitation is confirmed in the wild and linked to ransomware activity, hunt for signs of local privilege escalation on endpoints that were unpatched as of the November 2022 Patch Tuesday.

7.82% KEV ransomware
  • microsoft Windows 10 1507, 1607, 1809, 20H2, 21H1, 21H2, 22H2 — all builds prior to the November 2022 security updates
  • microsoft Windows 11 21H2, 22H2 — all builds prior to the November 2022 security updates
  • microsoft Windows 7 all builds prior to the November 2022 security updates
  • +2 more
masshundreds of millions of Windows devices (Print Spooler is enabled by default on most Windows client and server installations)
CVE-2023-35359
Windows Kernel Elevation of Privilege Vulnerability

Windows Kernel Elevation of Privilege Vulnerability

NVD description · AI analysis pending
7.810%
  • microsoft windows 10 1507
  • microsoft windows 10 1607
  • microsoft windows 10 1809
  • +1 more
CVE-2023-36874
Local Privilege Escalation in Microsoft Windows Error Reporting Service

CVE-2023-36874 is a privilege escalation vulnerability in the Microsoft Windows Error Reporting Service, associated with improper handling of linked resources (CWE-59), that allows a local attacker to elevate privileges beyond their current user context. It is triggered when an attacker who can already execute code on a target Windows machine interacts with the Error Reporting Service such that the service processes attacker-influenced files or links in a way that grants it unintended access. Successful exploitation yields elevated privileges on the host, a common post-compromise step used to chain with malware or other exploits to disable defenses and move laterally. Any Windows system running the Error Reporting Service is affected — effectively all supported Windows client and server releases per CISA, though specific version ranges are not enumerated in the source data. CISA added the flaw to its Known Exploited Vulnerabilities catalog on 2023-07-11, confirming exploitation in the wild; no public proof-of-concept is documented, ransomware use is unknown, and EPSS estimates a 43.4% probability of exploitation within 30 days (99th percentile).

Do: Apply the Microsoft security updates that fix CVE-2023-36874 (July 2023 Windows security updates or any later cumulative update) on all Windows endpoints and servers, prioritizing hosts where untrusted users have interactive logon (RDS/VDI, kiosks, jump servers). Because the flaw requires local access, limiting interactive logon rights on shared systems reduces risk as a compensating measure. Federal agencies must patch within CISA's standard two-week KEV remediation timeline from the 2023-07-11 listing.

7.843% KEV PoC
  • Microsoft Windows
mass≈1 billion+ Windows devices (Error Reporting Service is a default OS component across supported Windows releases)
Full article1,694 words · extracted from securelist.com · click to collapse

On August 8, 2023, Microsoft finally released a kernel patch for a class of vulnerabilities affecting Microsoft Windows since 2015. The vulnerabilities lead to elevation of privilege (EoP), which allows an account with user rights to gain SYSTEM privileges on a vulnerable host. The root cause of this attack surface, according to a 2015 blog, is the ability of a normal user account to replace the original C:\ drive with a fake one by placing a symlink for the system drives in the device map for each login session. This fake drive will be followed by the kernel during impersonation instead of the original system drive. More than five months after the patches for these vulnerabilities were released, we’re still seeing some of their exploits in the wild because it’s a very easy way to get a quick NT AUTHORITY\SYSTEM and that’s why it may be favored by well-known threat actors.

We discussed these findings at the BlackHat MEA conference in November 2023, and in December 2023 and January 2024, we found two exploits that could still use this attack surface in the unpatched version of Windows. Both exploits are packed in UPX. After analyzing the first one, we saw that it was a packed version of a Google Project Zero PoC sample. The other sample was a packed version of an SSD Secure Disclosure public PoC, even using the same NamedPipe “\\\\.\\Pipe\\TyphoonPWN” without modifications. The PDB paths for both samples are:

  • C:\Users\Administrator\source\repos\exp\x64\Release\exp.pdb
  • C:\VVS-Rro\CVEs\spool\BitsPoc\src\x64\Release\PoC_BITs.pdb

Below we will highlight the key points and then focus on how to check if any of the vulnerabilities have been exploited or if there have been any attempts to exploit them, and enumerate popular CVEs included in this vulnerable surface.

Affected processes and services include native Windows services that run by default on most versions of the operating system. These include:

  • CSRSS
  • Windows Error Reporting (WER)
  • File history service
  • Background intelligence transfer service (BITS)
  • Print Spooler

Vulnerable Windows processes and services

The exploits affecting this attack surface share a common logic or pattern, including:

  • Searching for a DLL that runs with system integrity.
  • The DLL has an isolation-aware manifest file.
  • The ability to change the C:\ root to a writable directory via symlinks.

This Activation Context Cache Poisoning vulnerability leads to local privilege escalation. It’s one of the CVEs that was actively exploited by a threat actor called KNOTWEED | Denim Tsunami.

Reversing the in-the-wild exploit for the CVE-2022-22047 shows:

Here is a detailed blog post by ZDI explaining CSRSS Cache Poisoning.

The second vulnerability, involving CSRSS Cache Poisoning, was a workaround for the first CVE-2022-22047. After patching the undocumented “LoadFrom” attribute, there was another attribute that could be abused to load a manifest file from a user-controlled path by declaring a dependent assembly using path traversal in the name attribute.

The patch for the CVE-2022-37989 was simple: check if the name attribute of the dependency contains any forward or backward slashes, and set a flag to stop caching this suspicious manifest if name path traversal is detected. This CVE was discovered by ZDI.

Print Spooler | CVE-2022-29104

Print Spooler is a service that runs by default in almost all versions of Windows. It’s responsible for managing paper print jobs sent from a computer to a printer or print server. Reversing in-the-wild exploits of the CVE-2022-29104 Print Spooler vulnerability shows that it’s a .NET sample that creates a symbolic link from C:\ to the fake root C:\Imprint. The sample was uploaded to VirusTotal.

Fake C:\ drive structure:

  • C:\Imprint\Windows\system32
  • C:\Imprint\Windows\WinSxS

All folders inside the Imprint folder are writable, allowing an attacker to control their contents.

Path traversal is added to “AssemblyIdentity” to point to the Imprint writable path.

The vulnerability analysis shows that:

  • An attacker can remap the root drive (C:\) for privileged processes during impersonation.
  • During impersonation, all file accesses are performed using the DOS device map of the impersonated process.
  • CSRSS uses a user-modified side-by-side manifest for generating the activation context instead of the manifest in the WinSxS folder C:\Windows\WinSxS.
  • The WinSxS folder stores multiple copies of system files and components.
  • The WinSxS folder provides a central location for storing different versions of system files that are shared by multiple applications and processes.
  • The WinSxS folder provides system stability and compatibility by allowing different applications to use the specific versions of files they need.
  • WinSxS avoids DLL hell, a problem that occurs when different applications require different versions of the same DLL.

The Windows operating system uses the application manifest to determine which version is appropriate for which app.

The application manifest is stored in XML format and describes:

  • The dependencies associated with the application.
  • What permissions the application requires.
  • What compatibility settings the application supports.

CSRSS mitigation was enabled for spoolsv.exe and printfilterpipelinesvc.exe to stop impersonation while loading external resources, and then to resume impersonation after the external resources are loaded.

Print Spooler | CVE-2022-41073

After CVE-2022-29104 was patched, another vulnerability affecting Print Spooler was discovered – CVE-2022-41073. Reversing the in-the-wild exploit of this vulnerability shows some XML manipulation using path traversal to a writable path containing a modified version of prntvpt.dll that is loaded by Print Spooler.

According to Project Zero, mitigation was added to CSRSS, the patch simply stopped any impersonation prior to the LoadLibraryExW call in winspool!LoadNewCopy, and then resumed it.

After that the LoadLibraryExW call returned:

1

2

3

4

+if(RevertToProcess(&TokenHandle,x)>=0){

lib=LoadLibraryExW(arg1,0,dwFlags);

+ResumeImpersonation(TokenHandle);

+}

NtOpenFile is called with the OBJ_IGNORE_IMPERSONATED_DEVICEMAP flag. It will stop impersonation when loading any external resources while using the LoadNewCopy API. Stopping impersonation means that privileged processes will not use the fake root implemented with the medium integrity process, and instead it will use the original C:\ drive root to avoid loading untrusted or malicious resources.

Windows Error Reporting | CVE-2023-36874

Windows Error Reporting (WER) is a privileged service that analyzes and reports various software issues in Windows. The root cause for the exploitation of the CVE-2023-36874 vulnerability is CreateProcess API when a crash happens, because CreateProcess API can be tricked into following the fake root and creating the process from this writable fake root in the context of the privileged WER service, leading to privilege escalation.

CVE-2023-36874 was exploited in the wild and has several published PoCs. The exploit interacts with the IWerReport COM interface and calls SubmitReport, then UtilLaunchWerManager is called, which calls CreateProcess. CreateProcess API is then vulnerable to DoS device modification.

Once the exploit to submit a fake crash report is executed, it will end up calling the vulnerable CreateProcess API.

File History Service | CVE-2023-35359

File History Service can be used to automatically back up personal folders and files such as documents, pictures and videos. Reversing the in-the-wild exploit shows that when File History Service starts, it impersonates the current user and then loads a DLL called fhcfg.dll under impersonation. This DLL has an “application aware manifest config” that attempts to load another resource called msasn1.dll. The exploit starts with the usual technique of changing the C:\ root to a fake writable root.

Windows Error Reporting – 2nd exploit | CVE-2023-35359

After patching the first Windows Error Reporting vulnerability, which used the CreateProcess API inside the privileged WER service and follows the fake root to create a process. The patched WER service started using CreateProcessAsUser instead of CreateProcess API. However, after that patch, adversaries found another way that could lead to the use of CreateProcess again under certain conditions, which was considered a new vulnerability. For example, if the WER service was marked as disabled on a system and there was a privileged process impersonating a medium-integrity user on that system, and an unhandled exception occurs during impersonation that results in a crash, that crash tries to enable the WER service for reporting. The detailed analysis for this CVE shows that it does not appear to be exploitable.

The exploitation of CVE-2023-35359

BITS | CVE-2023-35359

The Background Intelligence Transfer Service (BITS) is responsible for facilitating the asynchronous and prioritized transfer of files between a client and a server. BITS operates in the background, which means it can perform file transfers without interrupting a user or consuming all of the available network.

You may notice that the number CVE-2023-35359 has not changed for the last three CVEs because Microsoft decided in the last patch to assign the same CVE to all vulnerabilities of this type. So there are different vulnerabilities in different processes/services but with the same CVE number.

Timeline for the bypassing/patching process from 2015 to August 2023

How was the patch for this attack surface applied?

The patch was applied to ObpLookupObjectName to check if the loaded resource is a file object and the call to ObpUseSystemDeviceMap succeeds. It then ignores the impersonation and uses SystemDevice.

ObpLookupObjectName checks FileObjectType followed by a call to ObpUseSystemDeviceMap.

The ObpUseSystemDeviceMap function checks for the SystemDevice to be used instead of the impersonated device.

How to check if a vulnerability was exploited or any attempts were made to exploit it?

When analyzing most of the exploits targeting this attack surface, we observed a common behavior that could be used as an indicator of whether there were any attempted exploits:

  • Most of the in-the-wild exploits create a writable folder inside the C:\ drive, and the structure of this folder mimics the structure of the original C:\ drive, for example:
    • C:\Windows\System32 → C:\FakeFolder\Windows\System32
    • C:\Windows\WinSxS → C:\FakeFolder\Windows\WinSxS
  • So finding a writable folder that mimics the C:\ drive folder structure may be an indicator of an exploitation attempt.
  • Copying the manifest files from the original WinSxS folder in C:\Windows\WinSxS to a writable directory and modifying them could be a good indicator of an exploitation attempt.
  • Manifest files that contain undocumented XML attributes such as “LoadFrom” or manifest files that contain path traversal in the “name” attribute could be a valid sign of an exploitation attempt.
  • Creating a symbolic link from the original system drive to a writable directory, especially from processes with medium integrity using the \RPC Control\ object directory.

Text extracted automatically; images, tables and formatting may be missing. Original: https://securelist.com/windows-vulnerabilities/112232/