Elastic Details DirectComposition Use-After-Free Exploit in Windows DWM

· Original article ↗

Summary

Elastic Security Labs details a DirectComposition-triggered use-after-free in Windows DWM, the GetRECT heap spray and exploit chain, and a patch that forces resource removal to prevent the dangling pointer.

Key points

  • The article identifies a use-after-free in CSynchronousSuperWetInk::~CSynchronousSuperWetInk in dwmcore.dll, caused when a compatibility check skips removing the object from the manager.
  • It describes how a user-mode application can trigger the flaw through DirectComposition commands, leaving a dangling pointer that DWM later dereferences.
  • The GetRECT technique uses attacker-controlled CRegionGeometry RECT buffers to reclaim the freed allocation with controlled data.
  • The described exploit chain uses Windows callback and COM gadgets to make the spray memory executable and run inline shellcode.
  • The article reports successful code execution in DWM and says the researchers developed an alternative path to SYSTEM, but withhold details of that path.
  • The patch adds Feature_1732988217 to ensure RemoveSource() runs during destruction; the article identifies dwmcore.dll version 10.0.26100.7623 as fixed, versus 10.0.26100.7309 as vulnerable.
  • The author reports that newer LLMs shortened the time from vulnerability discovery to a functional exploit, while noting the resulting dual-use risk.

Article Details

Attack Vectors
  • A regular user-mode application uses D3D11/DXGI and DirectComposition to create an ink-trail resource, change LookupMode, and release it, leaving a dangling pointer that DWM later dereferences.
  • The GetRECT heap spray uses attacker-controlled CRegionGeometry RECT buffers sized to reclaim the freed allocation and supply a fake vtable.
  • The exploit chains the user32.dll __fnINSTRING handler with combase.dll CStdAsyncStubBuffer2_Disconnect to make the spray memory executable and run inline shellcode.
Defensive Notes
  • The article identifies dwmcore.dll version 10.0.26100.7623 as patched; the fix adds Feature_1732988217 to ensure RemoveSource() runs during destruction.
  • The author recommends defenders use AI-assisted offensive testing to find vulnerabilities and detection gaps in their code, security products, and enterprise environments.

MITRE ATT&CK

People

Vendors

Products

Tools

Related Articles