(CVE-2025-49660) Windows Event Tracing Reference Count Overflow Leading to Use-After-Free and Elevation of Privilege
好的,我现在需要帮用户总结这篇文章的内容,控制在100个字以内。首先,我得仔细阅读文章,理解其主要内容。 文章标题是关于一个安全咨询,发布日期是2025年7月8日,作者是Chen Le Qi。文章主要讨论了Windows 11中的一个漏洞,CVE编号是CVE-2025-49660。漏洞的CVSS3.1评分为7.8,属于高危级别。 漏洞影响的是Windows事件跟踪(ETW)组件。问题在于ETW中的引用计数器没有溢出检查,导致潜在的整数溢出和释放后使用(use-after-free)漏洞。攻击者可以利用这个漏洞提升权限到SYSTEM级别。 技术细节部分提到,当设置Trait时,引用计数器是一个32位整数,没有检查溢出情况。当计数器溢出后,再次递减时会错误地释放内存,导致Use After Free漏洞。每个RegEntry对象需要一个句柄,攻击者可以通过多个进程快速积累大量引用计数。 文章还提到类似的问题之前被Project Zero报告过,并建议修复措施是在所有引用计数函数中添加溢出检查。 最后是信用部分和时间线,说明了漏洞的披露和修复时间。 总结时需要涵盖:漏洞名称、影响版本、评分、攻击方式、技术原因、修复建议以及影响范围。要简洁明了,控制在100字以内。 可能的结构:Windows 11中的ETW组件存在高危漏洞(CVE-2025-49660),因引用计数器溢出问题导致Use After Free漏洞。攻击者可利用此漏洞提升权限至SYSTEM级。建议修复方法包括添加整数溢出检查。 </think> Windows 11中的ETW组件存在高危漏洞(CVE-2025-49660),因引用计数器溢出问题导致Use After Free漏洞。攻击者可利用此漏洞提升权限至SYSTEM级。建议修复方法包括添加整数溢出检查。 2025-7-8 00:0:0 Author: starlabs.sg(查看原文) 阅读量:4 收藏

Advisory July 8, 2025 By Chen Le Qi 3 min read

CVE: CVE-2025-49660

Affected Versions: Windows 11

CVSS3.1: 7.8 (High) — CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Summary

Product Windows Event Tracing (ETW)
Vendor Microsoft
Severity High — a local attacker may exploit this to elevate privileges to SYSTEM
Affected Versions Windows 11
Tested Versions Windows 11 23H2 (Build 22631.4660)
CVE Identifier CVE-2025-49660
CVE Description Insufficient checks in Event Tracing for Windows (ETW) in Microsoft Windows 11 may allow an unprivileged attacker to execute code as SYSTEM
CWE Classification(s) CWE-190: Integer Overflow or Wraparound; CWE-416: Use After Free

CVSS3.1 Scoring System

Base Score: 7.8 (High) Vector String: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Metric Value
Attack Vector (AV) Local
Attack Complexity (AC) Low
Privileges Required (PR) Low
User Interaction (UI) None
Scope (S) Unchanged
Confidentiality (C) High
Integrity (I) High
Availability (A) High

Product Background

Event Tracing for Windows (ETW) is a high-performance kernel-level tracing facility built into Windows. It provides user-mode applications and kernel-mode drivers with a mechanism to raise and log events, and is widely used for diagnostics, performance monitoring, and security tooling. ETW is implemented in ntoskrnl.exe and exposed to userspace through syscalls including NtTraceControl().

Technical Details

In ETW, Providers are responsible for emitting trace events. Internally, a provider is represented by a single _ETW_GUID_ENTRY object and one or more _ETW_REG_ENTRY objects — a new _ETW_REG_ENTRY is created for each call to EventRegister(). While the usermode API caps registrations at 0x800, there is no such limit when invoking NtTraceControl() directly with function code 0xF.

Traits can be set on a RegEntry object via EventSetInformation() or directly via NtTraceControl() with function code 0x1E, handled by EtwpSetProviderTraitsCommon(), which inserts the trait as a node into the global red-black tree EtwpProviderTraitsUmTree. Each node has the following layout:

struct _ETW_TRAIT_NODE
{
    _RTL_BALANCED_NODE Node;
    DWORD              RefCount;
    BYTE               X[1];  // Actual trait data
};

When inserting a trait, EtwpSetProviderTraitsCommon() checks whether an identical trait already exists in the tree. If so, it reuses the existing node and increments its reference count:

while ( 1 )
{
    res = TraitsCompare(TraitsBufKernel, curNode);
    if ( res <= 0 )
    {
        if ( res >= 0 )
        {
            ++curNode->RefCount;   /* no overflow check */
            FromExisting = 1;
            traitsBufKernel = curNode;
            goto BindToRegEntry;
        }

The reference counter is a 32-bit integer and there is no overflow check — unlike other ETW reference counting functions such as EtwpReferenceGuidEntry(). When the counter wraps from 0xFFFFFFFF back to 0, the next decrement in EtwpReleaseProviderTraitsReference() will treat the counter as 1 and prematurely free the trait node while other RegEntry objects still hold references to it:

TraitEntry = (cstmEtwTraitBufKernel *)_InterlockedExchange64(
                 (volatile __int64 *)&RegHandle->Traits, 0LL);
if ( TraitEntry )
{
    ExAcquireFastMutex(lock);
    if ( TraitEntry->RefCount-- == 1 )
    {
        RtlRbRemoveNode(Tree, (unsigned __int64)TraitEntry);
    }
    else
    {
        TraitEntry = 0LL;
    }
    ExReleaseFastMutex(lock);
    if ( TraitEntry )
        ExFreePoolWithTag(TraitEntry, 0);   /* use-after-free */
}

Closing a handle to a RegEntry triggers the decrement, making this a reliable and controllable primitive. Each RegEntry consumes a handle, so approximately 0x1000000 references can be accumulated per process. Wrapping the counter fully requires approximately 256 processes, achievable in under 30 minutes on a system with sufficient RAM.

A similar reference count overflow in ETW was previously reported by Project Zero (issue 42451732).

The recommended mitigation is to introduce integer overflow checks in all reference counting functions, consistent with the existing guard in EtwpReferenceGuidEntry().

Credit

Chen Le Qi of STAR Labs SG Pte. Ltd.

Timeline


文章来源: https://starlabs.sg/advisories/25/25-49660/
如有侵权请联系:admin#unsafe.sh