CVE-2024-30051 — Windows DWM Core Library Elevation of Privilege Vulnerability
Executive Summary
None
Overview
Verified Attribution
Binary/function confirmed from a public vendor or researcher report; this pin overrides the keyword heuristic.
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H/E:F/RL:O/RC:C
EPSS Score
Affected Products
| Product | KB Article | Severity | Impact | Restart Required |
|---|---|---|---|---|
| Windows 10 for 32-bit Systems | 5037788 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 for x64-based Systems | 5037788 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 1607 for 32-bit Systems | 5037763 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 1607 for x64-based Systems | 5037763 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 1809 for 32-bit Systems | 5037765 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 1809 for ARM64-based Systems | 5037765 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 1809 for x64-based Systems | 5037765 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 21H2 for 32-bit Systems | 5037768 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 21H2 for ARM64-based Systems | 5037768 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 21H2 for x64-based Systems | 5037768 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 22H2 for 32-bit Systems | 5037768 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 22H2 for ARM64-based Systems | 5037768 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 22H2 for x64-based Systems | 5037768 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 version 21H2 for ARM64-based Systems | 5037770 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 version 21H2 for x64-based Systems | 5037770 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 Version 22H2 for ARM64-based Systems | 5037771 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 Version 22H2 for x64-based Systems | 5037771 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 Version 23H2 for ARM64-based Systems | 5037771 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 Version 23H2 for x64-based Systems | 5037771 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows Server 2016 | 5037763 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows Server 2016 (Server Core installation) | 5037763 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows Server 2019 | 5037765 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows Server 2019 (Server Core installation) | 5037765 (Security Update) |
Important | Elevation of Privilege | Yes |
Patches
| Article | Type | Restart |
|---|---|---|
5037788 |
Security Update | Yes |
5037763 |
Security Update | Yes |
5037765 |
Security Update | Yes |
5037768 |
Security Update | Yes |
5037770 |
Security Update | Yes |
5037771 |
Security Update | Yes |
Patch Diff
Patch diff 10.0.22621.3527 -> 10.0.22621.3593 (ITW heap overflow in CCommandBuffer::Initialize)
| Function | Address | Change | Note |
|---|---|---|---|
std::_Func_impl_no_alloc<<lambda_dc2c95d2c2f70bb2af203226fe5ee6fa>,void,void_*,unsigned_long,unsigned___int64,unsigned_short_const_*,enum_ProcessAttributionFlags,ProcessAttributionResourceCounters_const_&>::_Delete_this |
1800e90e0 -> 1800e9ef0 |
length, address, called | similarity 1.0 |
CBaseExpression::EnsureExpressionIsUnregistered |
18008c560 -> 18009ba80 |
refcount, address | similarity 1.0 |
CExpressionValueStack::Sqrt |
180258ce0 -> 18025cac8 |
code, length, address, calling, called | similarity 0.38 |
CExpressionValueStack::Matrix4x4FromPerspectiveOffCenter |
180256c9c -> 1802598dc |
code, length, address, calling, called | similarity 0.23 |
Microsoft::WRL::ComPtr<CPathData>::InternalRelease |
1800e2430 -> 1800e1860 |
refcount, address, calling | similarity 1.0 |
CKeyframeAnimation::ApplyPlaybackStateChanges |
18005bca0 -> 180056fb0 |
code, refcount, length, address, called | similarity 0.45 |
CExpressionValueStack::ToDegrees |
180258ec8 -> 18025cdb0 |
code, length, address, calling, called | similarity 0.38 |
CExpressionValueStack::Transform |
180258fe0 -> 18025cf68 |
code, length, address, calling, called | similarity 0.3 |
CExpressionValueStack::QuaternionFromLerp |
1802587a0 -> 18025c208 |
code, length, address, calling, called | similarity 0.23 |
CConditionalExpression::CalculateConditionValue |
180220170 -> 180221cdc |
code, length, address, called | similarity 0.24 |
CD2DBitmapCache::GetCachedTexture |
180037bc0 -> 180033ec0 |
code, length, address, called | similarity 0.36 |
CExpressionValueStack::Swizzle |
180087de8 -> 1800c1a68 |
code, refcount, length, address, calling, called | similarity 0.45 |
CConditionalExpression::~CConditionalExpression |
18021fddc -> 18022187c |
code, length, address, called | similarity 0.78 |
CExpressionValueStack::LengthSquared |
180255b80 -> 1802580c8 |
code, length, address, calling, called | similarity 0.27 |
CExpressionValueStack::QuaternionFromYawPitchRoll |
1802589ac -> 18025c544 |
code, length, address, calling, called | similarity 0.27 |
CExpressionValueStack::Min |
180257a30 -> 18025af88 |
code, length, address, calling, called | similarity 0.24 |
memcpy |
18010f568 -> 180114248 |
refcount, address, calling | similarity 0.89 |
CPrimitiveGroup::EnsureDrawListGenerator |
18000f594 -> 180010214 |
refcount, address | similarity 0.96 |
CExpressionValueStack::Vector3 |
1800eb344 -> 1800bced8 |
code, refcount, length, address, called | similarity 0.21 |
CExpressionValueStack::Vector4 |
1802599a0 -> 18025dea0 |
code, length, address, calling, called | similarity 0.2 |
CExpressionValueStack::TimeSpanFrom |
180258e3c -> 18025ccc4 |
code, length, address, calling, called | similarity 0.38 |
CExpressionValueStack::Matrix3x2FromRotation |
18025654c -> 180258bf0 |
code, length, address, calling, called | similarity 0.24 |
CExpressionValueStack::GreaterThanEquals |
1802557dc -> 180257bec |
code, length, address, calling, called | similarity 0.27 |
CExpressionValueStack::QuaternionFromAxisAngle |
1802586bc -> 18025c088 |
code, length, address, calling, called | similarity 0.23 |
CExpressionValueStack::Asin |
180254c04 -> 180256a50 |
code, length, address, calling, called | similarity 0.38 |
CExpressionValueStack::ColorLerpRgb |
180254f20 -> 180256f54 |
code, length, address, calling, called | similarity 0.23 |
__GSHandlerCheck |
18010f340 -> 180114018 |
refcount, address | similarity 1.0 |
_guard_xfg_dispatch_icall_nop |
18010f5b0 -> 180114290 |
refcount, address, calling | similarity 0.89 |
CExpressionValueStack::Vector4Transform |
180259ba0 -> 18025e298 |
code, length, address, calling, called | similarity 0.28 |
CExpressionValueStack::Matrix3x2FromSkew |
1802566e4 -> 180258e84 |
code, length, address, calling, called | similarity 0.19 |
atexit |
18010b888 -> 18010f818 |
refcount, address, calling | similarity 1.0 |
CExpressionValueStack::Negate |
18006fdf4 -> 1800c12b8 |
code, refcount, length, address, called | similarity 0.4 |
CNaturalAnimationScalarForceAdapater::Update |
18026e270 -> 180272ab0 |
code, length, address, called | similarity 0.2 |
CPrimitiveGroup::BuildHeatMap |
1802407a8 -> 180242498 |
refcount, address, calling | similarity 0.97 |
CScrollScaleKeyframeAnimation::EnsureChainingConfigUpdated |
18025cd90 -> 180261580 |
code, length, address, called | similarity 0.27 |
CExpressionValueStack::Matrix3x2FromScale |
1800f1430 -> 1800f430c |
code, refcount, length, address, called | similarity 0.19 |
CExpressionValueStack::Scale |
180013ac0 -> 180014dbc |
code, refcount, length, address, calling, called | similarity 0.15 |
CExpressionValueStack::Matrix4x4FromQuaternion |
180256e80 -> 180259c6c |
code, length, address, calling, called | similarity 0.34 |
CExpressionValueStack::Lerp |
180255d0c -> 18025828c |
code, length, address, calling, called | similarity 0.09 |
CExpressionValueStack::Matrix4x4FromPerspectiveFieldOfView |
180256b30 -> 180259634 |
code, length, address, calling, called | similarity 0.25 |
CExpressionValueStack::Matrix4x4 |
1800e15d4 -> 1800c1664 |
code, refcount, length, address, called | similarity 0.34 |
CExpressionValueStack::Vector2Dot |
180259140 -> 18025d180 |
code, length, address, calling, called | similarity 0.28 |
CExpressionValueStack::Ceil |
180254d38 -> 180256c24 |
code, length, address, calling, called | similarity 0.35 |
CExpressionValueStack::Matrix4x4FromRotationY |
18025708c -> 180259fd4 |
code, length, address, calling, called | similarity 0.24 |
CExpressionValueStack::Matrix4x4FromYawPitchRoll |
180257708 -> 18025aae8 |
code, length, address, calling, called | similarity 0.24 |
CExpressionValueStack::DistanceSquared |
180255328 -> 1802575b0 |
code, length, address, calling, called | similarity 0.22 |
CKeyframeAnimation::CalculateValueWorker |
18005b360 -> 180056670 |
code, length, address, called | similarity 0.97 |
CExpressionValueStack::Conditional |
1800e46a8 -> 1800c1dc8 |
code, refcount, length, address, called | similarity 0.37 |
CExpressionValueStack::GreaterThan |
18001eefc -> 1800201d4 |
code, refcount, length, address, called | similarity 0.29 |
wil::details::WilApi_GetFeatureEnabledState |
1800ca5b4 -> 1800b09c4 |
refcount, address, calling | similarity 1.0 |
CExpressionValueStack::Vector3Transform |
18025972c -> 18025dae4 |
code, length, address, calling, called | similarity 0.27 |
CExpressionValueStack::Vector2TransformNormal |
1802593d0 -> 18025d55c |
code, length, address, calling, called | similarity 0.26 |
wil::details::EnabledStateManager::EnsureSubscribedToFeatureConfigurationChangesImpl |
1800ca314 -> 1800b0724 |
refcount, address, calling, called | similarity 0.98 |
CGdiSpriteBitmap::RegisterWithSurfaceManager |
1800ace48 -> 1800a9b88 |
length, address | similarity 1.0 |
CExpressionValueStack::Square |
18001c748 -> 18001d954 |
code, refcount, length, address, called | similarity 0.38 |
wil::srwlock::lock_exclusive |
1800ca5dc -> 1800b09ec |
refcount, address, calling | similarity 1.0 |
CDataStreamWriter::FlushData |
1800a95f8 -> 1800bc594 |
length, address | similarity 1.0 |
wil::com_ptr_t<CAtlasBitmapResource,wil::err_returncode_policy>::~com_ptr_t<CAtlasBitmapResource,wil::err_returncode_policy> |
1800297e4 -> 180034694 |
refcount, address, calling | similarity 1.0 |
CExpressionValueStack::ColorHsl |
180254dc0 -> 180256cfc |
code, length, address, calling, called | similarity 0.21 |
CExpressionValueStack::Ln |
1802563d4 -> 1802589d8 |
code, length, address, calling, called | similarity 0.36 |
CExpressionValueStack::ToRadians |
180258f54 -> 18025ce8c |
code, length, address, calling, called | similarity 0.38 |
CExpressionValueStack::Max |
180257840 -> 18025ad10 |
code, length, address, calling, called | similarity 0.24 |
CPrimitiveGroup::GenerateDrawList |
18000f520 -> 180010140 |
code, refcount, length, address, called | similarity 0.35 |
wil::details::ReportUsageToService |
1800837f0 -> 180051570 |
refcount, address, calling, called | similarity 0.98 |
CCommandBuffer::Initialize |
1800106b8 -> 180011454 |
code, refcount, length, address, called | similarity 0.12 |
CExpressionValueStack::Clamp |
18001e2b4 -> 18001f5ec |
code, refcount, length, address, called | similarity 0.11 |
CExpressionValueStack::Concatenate |
180255088 -> 1802571bc |
code, length, address, calling, called | similarity 0.27 |
ReleaseInterface<ID2D1Geometry> |
18003341c -> 1800927a4 |
refcount, address, calling | similarity 1.0 |
wil::details_abi::heap_buffer::push_back |
1800f6a14 -> 1800fa5c4 |
refcount, address, calling | similarity 1.0 |
CExpressionValueStack::LessThanEquals |
18001ee84 -> 180020018 |
code, refcount, length, address, called | similarity 0.28 |
CExpressionValueStack::Add |
1800132ac -> 180013f58 |
code, refcount, length, address, called | similarity 0.13 |
CExpressionValueStack::Round |
180258ab0 -> 18025c748 |
code, length, address, calling, called | similarity 0.38 |
CExpressionValueStack::Vector3Dot |
180259624 -> 18025d924 |
code, length, address, calling, called | similarity 0.24 |
memset |
18010c4d8 -> 180110468 |
refcount, address, calling | similarity 0.89 |
CExpressionValueStack::Divide |
180072980 -> 1800c0ef0 |
code, refcount, length, address, called | similarity 0.24 |
CExpressionValueStack::Vector4Dot |
180259aa4 -> 18025e0dc |
code, length, address, calling, called | similarity 0.26 |
CExpressionValueStack::LessThan |
1800e2500 -> 1800c1eb0 |
code, refcount, length, address, called | similarity 0.28 |
wil::details::unique_storage<wil::details::resource_policy<_RTL_SRWLOCK*___ptr64,void_(__cdecl*)(_RTL_SRWLOCK*___ptr64),&void___cdecl_ReleaseSRWLockExclusive(struct__RTL_SRWLOCK*___ptr64),wistd::integral_constant<unsigned___int64,1>,_RTL_SRWLOCK*___ptr64,_RTL_SRWLOCK*___ptr64,0,std::nullptr_t>_>::~unique_storage<wil::details::resource_policy<_RTL_SRWLOCK*___ptr64,void_(__cdecl*)(_RTL_SRWLOCK*___ptr64),&void___cdecl_ReleaseSRWLockExclusive(struct__RTL_SRWLOCK*___ptr64),wistd::integral_constant<unsigned___int64,1>,_RTL_SRWLOCK*___ptr64,_RTL_SRWLOCK*___ptr64,0,std::nullptr_t>_> |
1800ca140 -> 1800b060c |
refcount, address, calling | similarity 1.0 |
CExpressionValueStack::Inverse |
180255894 -> 180257d60 |
code, length, address, calling, called | similarity 0.38 |
CExpressionValueStack::Subtract |
1800168d4 -> 180018bd8 |
code, refcount, length, address, called | similarity 0.21 |
CExpressionValueStack::Vector3Cross |
180259524 -> 18025d768 |
code, length, address, calling, called | similarity 0.23 |
CExpressionValueStack::ColorLerpHsl |
1800152a4 -> 180015e44 |
code, refcount, length, address, calling, called | similarity 0.21 |
CExpressionValueStack::Distance |
180255148 -> 18025733c |
code, length, address, calling, called | similarity 0.24 |
CExpressionValueStack::Matrix4x4FromTranslation |
1800e412c -> 1800bdc4c |
code, refcount, length, address, called | similarity 0.18 |
CExpressionValueStack::NotEquals |
180257e8c -> 18025b5c4 |
code, length, address, calling, called | similarity 0.33 |
DefaultHeap::Free |
18007c514 -> 1800898a4 |
refcount, address, calling | similarity 1.0 |
operator_new[] |
180038c50 -> 180034c10 |
refcount, address, calling | similarity 1.0 |
API-MS-WIN-CORE-SYNCH-L1-1-0.DLL::SetEvent |
EXTERNAL:00000062 |
refcount, calling | similarity 1.0 |
CExpressionValueStack::Equals |
180255500 -> 180257824 |
code, length, address, calling, called | similarity 0.3 |
CExpressionValueStack::Matrix4x4FromPerspective |
1802569cc -> 18025938c |
code, length, address, calling, called | similarity 0.25 |
CBaseExpression::CalculateValue |
180086550 -> 180054250 |
code, refcount, length, address, called | similarity 0.28 |
CExpressionValueStack::QuaternionFromRotationMatrix |
1802588b8 -> 18025c418 |
code, length, address, calling, called | similarity 0.36 |
CExpressionValueStack::Absolute |
180254918 -> 180256608 |
code, length, address, calling, called | similarity 0.27 |
CExpressionValueStack::Matrix4x4FromRotationZ |
1802571cc -> 18025a234 |
code, length, address, calling, called | similarity 0.24 |
CExpressionValueStack::Length |
1802559f0 -> 180257f00 |
code, length, address, calling, called | similarity 0.27 |
CExpressionValueStack::Matrix4x4FromAxisAngle |
1802568c0 -> 1802591ec |
code, length, address, calling, called | similarity 0.24 |
CConditionalExpression::GetValue |
1802205e0 -> 1802221a0 |
code, length, address, called | similarity 0.44 |
CNaturalAnimation::PeekStackValue |
180235b84 -> 180237794 |
code, length, address, called | similarity 0.42 |
CExpressionValueStack::Vector2Transform |
180259214 -> 18025d308 |
code, length, address, calling, called | similarity 0.24 |
D2D1::Matrix3x2F::SetProduct |
180045e34 -> 180080894 |
refcount, address, calling | similarity 1.0 |
CSharedSectionBase::ResolveAllocation |
180088bf0 -> 180098d48 |
refcount, address, calling | similarity 1.0 |
MilInstrumentationCheckHR_MaybeFailFast |
18008807c -> 1800c15e8 |
refcount, address, calling | similarity 1.0 |
CKeyframeAnimation::ProcessSetBindingBroken |
180034af0 -> 1800bd980 |
code, length, address, called | similarity 0.32 |
CExpressionValueStack::Normalize |
180257d08 -> 18025b398 |
code, length, address, calling, called | similarity 0.3 |
CExpressionValueStack::Log10 |
180256490 -> 180258ae4 |
code, length, address, calling, called | similarity 0.36 |
CExpressionValueStack::Pow |
18001b7f0 -> 18001cdf0 |
code, refcount, length, address, called | similarity 0.29 |
CExpressionValueStack::And |
180254b48 -> 1802568cc |
code, length, address, calling, called | similarity 0.27 |
CScrollPositionKeyframeAnimation::EnsureChainingConfigUpdated |
18025c880 -> 180261020 |
code, length, address, called | similarity 0.35 |
CConditionalExpression::AddStackValueToSum |
18021ff1c -> 180221a3c |
code, length, address, called | similarity 0.55 |
CExpressionValueStack::Acos |
180254a9c -> 1802567d0 |
code, length, address, calling, called | similarity 0.38 |
CExpressionValueStack::Atan |
180254cb0 -> 180256b4c |
code, length, address, calling, called | similarity 0.35 |
CExpressionValueStack::Multiply |
180072818 -> 1800c0aa8 |
code, refcount, length, address, called | similarity 0.18 |
CExpressionValue::operator= |
180015688 -> 180016350 |
refcount, address, calling | similarity 1.0 |
CPrimitiveGroup::ProcessAddPrimitives |
1800a9dac -> 1800e200c |
code, refcount, length, address, called | similarity 0.64 |
CExpressionValueStack::Or |
1802580b4 -> 18025b888 |
code, length, address, calling, called | similarity 0.27 |
CExpressionValueStack::Not |
180257e08 -> 18025b4f0 |
code, length, address, calling, called | similarity 0.36 |
CExpressionValueStack::Vector3TransformNormal |
180259880 -> 18025dcd4 |
code, length, address, calling, called | similarity 0.28 |
CExpressionValueStack::Quaternion |
1802585c4 -> 18025be60 |
code, length, address, calling, called | similarity 0.19 |
CExpression::CalculateValueWorker |
180071850 -> 1800be5a0 |
code, refcount, length, address, called | similarity 0.02 |
CExpressionValueStack::Matrix4x4FromRotationX |
180256f4c -> 180259d74 |
code, length, address, calling, called | similarity 0.24 |
API-MS-WIN-CORE-HANDLE-L1-1-0.DLL::CloseHandle |
EXTERNAL:0000008e |
refcount, calling | similarity 1.0 |
CExpressionValueStack::Matrix3x2 |
1800dc588 -> 1800c2024 |
code, refcount, length, address, called | similarity 0.56 |
CExpressionValueStack::Modulus |
180257c20 -> 18025b200 |
code, length, address, calling, called | similarity 0.3 |
CExpressionValueStack::Slerp |
180258bf4 -> 18025c8e4 |
code, length, address, calling, called | similarity 0.23 |
CExpressionValueStack::Floor |
180255754 -> 180257b14 |
code, length, address, calling, called | similarity 0.35 |
CPropertySet::operator_new |
18010db60 -> 1800390ac |
code, refcount, length, address | similarity 0.67 |
CExpressionValueStack::ColorRgb |
1800eff78 -> 1800f32a4 |
code, refcount, length, address, called | similarity 0.2 |
CExpressionValueStack::Matrix4x4FromScale |
18025730c -> 18025a494 |
code, length, address, calling, called | similarity 0.06 |
CExpressionValueStack::Tan |
180258d80 -> 18025cbb8 |
code, length, address, calling, called | similarity 0.36 |
API-MS-WIN-CORE-SYNCH-L1-1-0.DLL::CreateEventW |
EXTERNAL:00000067 |
refcount, calling | similarity 1.0 |
CLineGeometry::operator_new |
1800ffe54 -> 1801bc52c |
code, fullname, refcount, length, address, parent | similarity 0.67 |
CPrimitiveGroup::ResolveSharedMemoryBufferOld |
1800a7148 -> 180112950 |
name, fullname, refcount, length, sig, address | similarity 1.0 |
FUN_18012109a |
1801195c4 -> 18012109a |
code, name, fullname, length, sig, address | similarity 0.97 |
CExpressionValue::CExpressionValue |
1802750e0 -> 1800c26b4 |
code, name, fullname, refcount, length, sig, address, calling, called, parent | similarity 0.14 |
Root Cause Analysis
Root Cause Analysis — CVE-2024-30051
Summary
| Field | Value |
|---|---|
| CVE | CVE-2024-30051 |
| Binary | dwmcore.dll (Desktop Window Manager Core Library) |
| Component | CCommandBuffer::Initialize — D2D shared buffer handling |
| Bug Class | Heap-Based Buffer Overflow (CWE-122) via Integer Division Truncation |
| Impact | Elevation of Privilege → SYSTEM Integrity |
| CVSS 3.1 | 7.8 (AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H) |
| Exploited ITW | Yes (discovered April 2024 by Kaspersky, QiAnXin, others) |
| Patch | May 2024 Patch Tuesday (KB5037771 Win11 23H2) |
Vulnerability Overview
A heap-based buffer overflow exists in CCommandBuffer::Initialize in dwmcore.dll
due to a size miscalculation caused by integer division truncation. The function
obtains a buffer_size from CD2DSharedBuffer::GetBufferSize, then:
- Allocates memory using
(buffer_size / 0x90) * 0x90— rounding DOWN - Copies data using the original
buffer_size— WITHOUT rounding
When buffer_size is not a multiple of 0x90, the allocation is smaller than the
copy length, causing a heap overflow of up to 0x8F bytes with attacker-controlled
content. A local attacker can exploit this to achieve code execution as the DWM
user with SYSTEM integrity privileges.
Root Cause — Integer Division Truncation
The Vulnerable Code (pre-patch)
In CCommandBuffer::Initialize:
// Both calls return the same value
ULONG buffer_size = CD2DSharedBuffer::GetBufferSize(sharedBuf);
ULONG buffer_size2 = CD2DSharedBuffer::GetBufferSize(sharedBuf);
// Allocation: rounds DOWN to nearest 0x90 multiple
ULONG size_new = (buffer_size / 0x90) * 0x90;
PVOID dest = operator new(size_new);
// Copy: uses ORIGINAL size (not rounded)
memcpy(dest, src, buffer_size2); // BUG: buffer_size2 > size_new
The Math
| buffer_size | size_new = (buf/0x90)*0x90 | Overflow = buf - size_new |
|---|---|---|
| 0x90 | 0x90 | 0 (no overflow) |
| 0x91 | 0x90 | 1 byte |
| 0xFF | 0x90 | 0x6F bytes |
| 0x11F | 0x90 | 0x8F bytes |
| 0x120 | 0x120 | 0 (no overflow) |
| 0x23F | 0x1B0 | 0x8F bytes |
The maximum overflow per 0x90 block is 0x8F bytes (143 bytes), occurring when
buffer_size % 0x90 == 0x8F.
Call Flow to Reach the Vulnerable Function
User-mode application
→ D2D API interaction with DWM compositor
→ CPrimitiveGroup::Create / CPrimitiveGroup::CreatePrimitive
→ CCommandBuffer::Initialize *** VULNERABLE ***
→ CD2DSharedBuffer::GetBufferSize → returns buffer_size
→ operator new((buffer_size / 0x90) * 0x90) → UNDERSIZED ALLOCATION
→ memcpy(dest, src, buffer_size) → HEAP OVERFLOW
Attacker Control
The buffer_size is derived from a D2D shared buffer whose size the attacker
controls from user-mode. The content being copied (src) is also from the shared
buffer, giving the attacker full control over both the overflow length and data.
Exploitation Path (ITW)
The in-the-wild exploit achieves EoP to SYSTEM integrity:
- Heap spray: Allocate many D2D shared buffers in the DWM process to create predictable heap layout
- Setup adjacent objects: Place exploitable kernel/DWM objects adjacent to the vulnerable allocation
- Trigger overflow: Create a shared buffer with
size % 0x90 != 0and triggerCCommandBuffer::Initialize— the memcpy overwrites adjacent heap objects - Corrupt adjacent object: Overwrite function pointers or metadata in the adjacent object to redirect execution
- Code execution: DWM process loads attacker-crafted DLL from a controlled path, achieving code execution as DWM user with SYSTEM integrity
Post-Exploitation
The DWM user has SYSTEM integrity level but is NOT in the Administrators group, so some operations are restricted. However, SYSTEM integrity grants significant privileges including access to most system resources.
Patch Analysis
The patch in CCommandBuffer::Initialize (dwmcore.dll 10.0.22621.3593) adds:
// Post-patch: use rounded size for BOTH allocation and copy
ULONG buffer_size = CD2DSharedBuffer::GetBufferSize(sharedBuf);
ULONG size_rounded = (buffer_size / 0x90) * 0x90;
// Validate size
if (size_rounded == 0 || size_rounded > MAX_ALLOWED) {
return E_INVALIDARG;
}
PVOID dest = operator new(size_rounded);
memcpy(dest, src, size_rounded); // FIXED: uses rounded size for copy too
The patched version adds significant validation blocks (visible in BinDiff as many new basic blocks) to ensure the allocation size and copy size match.
Reachability
- Attack vector: Local — requires code execution on the target
- Privileges required: Low — any user can interact with DWM
- User interaction: None
- Attack surface:
- D2D API calls that interact with DWM shared buffers
- Any application can trigger DWM compositor operations
- DWM is always running on desktop Windows systems
Detection
YARA — Vulnerable dwmcore.dll
rule CVE_2024_30051_Vulnerable_DWMCore
{
meta:
description = "Detects pre-patch dwmcore.dll with size mismatch in CCommandBuffer::Initialize"
cve = "CVE-2024-30051"
author = "OnlyFm252"
strings:
$func = "CCommandBuffer::Initialize"
$class = "CD2DSharedBuffer"
condition:
uint16(0) == 0x5A4D and
filesize > 2MB and filesize < 10MB and
$func and $class
}
Sigma — DWM Process Crash or Suspicious DLL Load
title: CVE-2024-30051 DWM Exploitation Indicators
id: f8a9b0c1-d2e3-4567-f012-345678abcdef
status: experimental
description: >
Detects potential exploitation of CVE-2024-30051 via DWM process crash
or suspicious DLL loading in dwm.exe context.
author: OnlyFm252
date: 2026/07/26
references:
- https://www.coresecurity.com/core-labs/articles/windows-dwm-core-library-elevation-privilege-vulnerability-cve-2024-30051
- https://msrc.microsoft.com/update-guide/vulnerability/CVE-2024-30051
logsource:
product: windows
category: image_load
detection:
selection_dwm:
Image|endswith: '\dwm.exe'
filter_known:
ImageLoaded|startswith:
- 'C:\Windows\System32\'
- 'C:\Windows\WinSxS\'
condition: selection_dwm and not filter_known
level: high
tags:
- attack.privilege_escalation
- attack.t1068
- cve.2024.30051
Sysmon Configuration
<Sysmon schemaversion="4.90">
<EventFiltering>
<!-- Event 7: Detect non-system DLL loads in dwm.exe -->
<ImageLoad onmatch="include">
<Image condition="end with">\dwm.exe</Image>
</ImageLoad>
<!-- Event 1: Detect processes spawned by dwm.exe (post-exploit) -->
<ProcessCreate onmatch="include">
<ParentImage condition="end with">\dwm.exe</ParentImage>
</ProcessCreate>
<!-- Event 10: Detect process access to dwm.exe (heap spray injection) -->
<ProcessAccess onmatch="include">
<TargetImage condition="end with">\dwm.exe</TargetImage>
<GrantedAccess condition="is">0x1F0FFF</GrantedAccess>
</ProcessAccess>
</EventFiltering>
</Sysmon>
References
Attack Path
Heap overflow in the DWM command buffer - the allocation rounds down, the copy does not
Derived from the patch delta: the checks added by the vendor identify which fields crossed a trust boundary unvalidated. Reachability and privilege are taken from the call chain in the RCA report.
Exploits & PoC
2 public PoCsUnverified third-party code
Public proof-of-concept repositories aggregated from PoC-in-GitHub. They are not reviewed and may be incomplete, non-functional, or malicious — inspect the code before running anything.
| Repository | Stars | Published | Description |
|---|---|---|---|
| fortra/CVE-2024-30051 | 124 | 2024-08-14 | |
| devianntsec/CVE-2024-30051 | 1 | 2026-03-25 | Master's Thesis research on CVE-2024-30051 (Windows DWM Heap Overflow). Features a high-reliability exploit with automated heap spray optimization, real-time logging, and empirical success-rate analys |
Detection Rules
Acknowledgments
Vlad Stolyarov and Benoit Sevens of Google Threat Analysis Group Bryce Abdo and Adam Brunner of Google Mandiant
Quan Jin
Mert Degirmenci