Skip to content
RCE Write-up Advanced

Activation Context Cache Poisoning: Exploiting CSRSS For Privilege Escalation

The Windows CSRSS process builds and caches activation contexts for executables, and it accepted manifest data from unprivileged callers and performed some filesystem probing while impersonating them. An attacker could poison the per-session cache so that a later privileged process in the same session loaded an attacker-supplied DLL, escalating to SYSTEM.

Simon Zuckerbraun Follow

Published on zerodayinitiative.com

Starting in July of 2022, the Windows CSRSS process entered the consciousness of the infosec community as the source of several local privilege escalation vulnerabilities in Microsoft Windows. The first public information appeared on July 12 with the release of the patch for CVE-2022-22047, which was being actively…

Simon Zuckerbraun, on zerodayinitiative.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

CSRSS accepted manifest XML and filesystem lookups from untrusted clients and cached the resulting activation context session-wide, so attacker-influenced data was later reused for privileged processes.

Impact

A local user could escalate to NT AUTHORITY\SYSTEM, but only by targeting a privileged process that runs in the same session; the later variants were constrained by the earlier narrow patches.

What the attacker needed

Local unprivileged code execution; ability to write a DLL to disk; privileged process in same session

The fix

Microsoft patched each vector narrowly (blocking loadFrom redirection, then directory traversal in dependentAssembly, then adding impersonation to the file-ID lookup) and in December 2022 added the OBJ_IGNORE_IMPERSONATED_DEVICEMAP flag during manifest probing.

How it was found

  1. Craft a call into CSRSS requesting an activation context for a privileged executable, supplying a malicious manifest.
  2. Have the manifest redirect a DLL the target depends on to an attacker-controlled file on disk.
  3. Flood CSRSS with requests to clear existing cache entries, then send the final message that creates the poisoned entry.
  4. Wait for the privileged target to launch in the same session, so it receives the cached context and loads the attacker DLL.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Windows programs often load shared library files (DLLs) and use small XML files called manifests to decide which exact version to load. A background system process, CSRSS, works out those choices and remembers them in a cache shared by everything in the user's logon session. The bug was that an ordinary user could feed CSRSS a fake manifest, so the remembered answer pointed at the attacker's DLL, which a more powerful program then loaded.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by Simon Zuckerbraun

View all

16 more disclosed reports, best first.

More from Microsoft

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.