CVE-2026-45640 — Windows Bluetooth Port Driver Elevation of Privilege Vulnerability
Executive Summary
Use after free in Windows Bluetooth Port Driver allows an authorized attacker to elevate privileges locally.
Overview
CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H/E:U/RL:O/RC:C
EPSS Score
Affected Products
| Product | KB Article | Severity | Impact | Restart Required |
|---|---|---|---|---|
| Windows 10 Version 21H2 for 32-bit Systems | 5094127 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 21H2 for ARM64-based Systems | 5094127 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 21H2 for x64-based Systems | 5094127 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 22H2 for 32-bit Systems | 5094127 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 22H2 for ARM64-based Systems | 5094127 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 10 Version 22H2 for x64-based Systems | 5094127 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 Version 23H2 for ARM64-based Systems | 5093998 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 Version 23H2 for x64-based Systems | 5093998 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 Version 24H2 for ARM64-based Systems | 5094126 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 Version 24H2 for x64-based Systems | 5094126 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 Version 25H2 for ARM64-based Systems | 5094126 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 Version 25H2 for x64-based Systems | 5094126 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 Version 26H1 for ARM64-based Systems | 5095051 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows 11 version 26H1 for x64-based Systems | 5095051 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows Server 2022 | 5094128 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows Server 2022 (Server Core installation) | 5094128 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows Server 2025 | 5094125 (Security Update) |
Important | Elevation of Privilege | Yes |
| Windows Server 2025 (Server Core installation) | 5094125 (Security Update) |
Important | Elevation of Privilege | Yes |
Patches
| Article | Type | Restart |
|---|---|---|
5094127 |
Security Update | Yes |
5093998 |
Security Update | Yes |
5094126 |
Security Update | Yes |
5095051 |
Security Update | Yes |
5094128 |
Security Update | Yes |
5094125 |
Security Update | Yes |
Patch Diff
Use-after-free / double-free race (CWE-416) in the Windows Bluetooth port driver bthport.sys, local EoP. HciLELegacyAdvertisingRequestCoordinator::MarkAllAdvertisingRequestAsNew iterates pending LE legacy advertising requests and re-sets each IRP's cancellation routine (ClearRequestCancellationRoutine then SetRequestCancellationRoutine). ClearRequestCancellationRoutine fails when the IRP's cancellation is already in progress (the cancel callback is already completing/freeing that IRP). PRE: on a Clear failure the code fell through to LAB_0 and set the per-request error flag (*(lVar1+8) |= 4), marking the IRP as MarkAll's own cleanup/error-handling target even though the cancel callback owns it - so a single IRP could be completed and freed on two paths at once (double free / UAF). IN-HOUSE ghidriff of bthport.sys 10.0.26100.8524 -> .8655 (Jun 9 2026, KB5094126) confirms the fix: MarkAllAdvertisingRequestAsNew is the only code-changed function; gated behind CFR flag Feature_697033018, a Clear failure now sets no error flag and exits (the cancel callback alone owns the IRP), and only the Clear-succeeded-but-Set-failed case sets the error flag for genuine cleanup. Removes the race between the cancellation callback and MarkAll. Note: our x64 24H2 diff shows flag Feature_697033018, differing from the circulated screenshots' Feature_965468474 (build/arch difference); we ship what our diff shows.
Root Cause Analysis
CVE-2026-45640 — Windows Bluetooth Port Driver bthport.sys Use-After-Free in HciLELegacyAdvertisingRequestCoordinator::MarkAllAdvertisingRequestAsNew
Summary
| Product | Windows — bthport.sys (Bluetooth Port Driver; LE legacy advertising request coordinator) |
| CVE ID | CVE-2026-45640 |
| Impact | Elevation of Privilege |
| MSRC severity | Important |
| CVSS | 7.0 / 6.1 — CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H/E:U/RL:O/RC:C |
| CWE | CWE-416: Use After Free (double-free / UAF race) |
| Delivery | Local — race against the IRP cancellation callback (AC:H reflects the timing window) |
| KB / Fixed build | KB5094126 — bthport.sys 10.0.26100.8655 (Win11 24H2 x64) |
| Patch Date | June 9, 2026 (2026-Jun) |
| Pre-patch binary | bthport.sys 10.0.26100.8524 — SHA256 107eac1b5892ded9e589ce4eed7950b51ca79299076a6bdb72a3de763d8e9810 |
| Post-patch binary | bthport.sys 10.0.26100.8655 — SHA256 0c71fbf4b3469b3f61acdd9e4b922a7d969fa618aae82c43bbb71e348e93a797 |
| Feature flag | Feature_697033018 — the fix is CFR-gated |
| Exploitability | Exploitation Less Likely; not publicly disclosed; not exploited (per MSRC) |
Product Description
bthport.sys is the Windows Bluetooth port driver. Its
HciLELegacyAdvertisingRequestCoordinator manages pending Bluetooth LE legacy
advertising requests, each backed by an IRP with a cancellation routine —
the function the I/O manager invokes when the IRP is cancelled, to complete and
clean up (and free) the request. Because the driver runs in kernel and the
advertising surface is reachable by a local, low-privileged caller, a
lifetime bug in its IRP handling is a local elevation vector.
Vulnerability Summary
MarkAllAdvertisingRequestAsNew iterates the pending advertising requests and
re-sets each request’s IRP cancellation routine: it first calls
ClearRequestCancellationRoutine (to detach the current routine), then
SetRequestCancellationRoutine (to install the new one). ClearRequestCancellationRoutine
fails when the IRP’s cancellation is already in progress — i.e. the
cancellation callback is already completing/freeing that same IRP.
Pre-patch, a Clear failure still fell through to the error path and set the
per-request error flag (| 4), marking the IRP as a target for
MarkAllAdvertisingRequestAsNew’s own error-handling/cleanup — even though the
cancellation callback was concurrently processing (and about to free) that IRP:
// MarkAllAdvertisingRequestAsNew (10.0.26100.8524) — PRE-PATCH, from our diff
this_00 = this;
bVar2 = ClearRequestCancellationRoutine(this, irp);
if (bVar2) { // Clear succeeded
bVar2 = SetRequestCancellationRoutine(this_00, irp, in_R8);
if (!bVar2) goto LAB_0; // Set failed -> error flag
}
else { // *** Clear FAILED (cancel already in progress) ***
LAB_0:
*(uint *)(lVar1 + 8) |= 4; // *** error flag set anyway -> IRP double-owned ***
}
local_res8 = local_res8 & -(ulonglong)((*(byte *)(lVar1 + 8) & 4) != 0); // mark for error handling
A single IRP can therefore be completed and freed on two paths at once — the
in-flight cancellation callback and MarkAllAdvertisingRequestAsNew’s error
handling — a double free / use-after-free (CWE-416).
Prerequisites and Constraints
- Local, low-privileged (
PR:L,AV:L). The attacker drives LE advertising request churn and races IRP cancellation. AC:H: the bug is a race — it triggers only in the narrow window whereClearRequestCancellationRoutinefails because the cancellation callback is already processing the same IRP.- Success yields a kernel double-free / UAF and, via heap grooming, elevation.
Vulnerability Details
Root Cause
MarkAllAdvertisingRequestAsNew treated a ClearRequestCancellationRoutine
failure as an ordinary error and set the request’s error flag, claiming the IRP
for its own cleanup. But a Clear failure specifically means the IRP is already
owned by the cancellation callback, which will complete and free it. Both paths
then act on the same IRP — the race that produces the double free / UAF.
The patch (confirmed — diff, .8524 → .8655)
Gated behind Feature_697033018, the coordinator changes the failure handling so
that a Clear failure is not treated as an error to be handled here:
// MarkAllAdvertisingRequestAsNew (10.0.26100.8655) — PATCHED, feature-enabled branch
iVar4 = Feature_697033018__private_IsEnabledDeviceUsageNoInline();
if (iVar4 == 0) {
/* ...original (feature-disabled) behaviour still ships... */
}
else { // *** patched path ***
pHVar5 = this;
bVar3 = ClearRequestCancellationRoutine(this, irp);
if (bVar3) { // Clear succeeded
bVar3 = SetRequestCancellationRoutine(pHVar5, irp, in_R8);
if (bVar3) goto LAB_1; // Set succeeded -> OK, no error flag
*(uint *)(lVar2 + 8) |= 4; // *** only Clear-OK + Set-FAIL sets the error flag ***
}
// *** Clear FAILED -> do NOTHING, no error flag -> exit; the cancel callback owns the IRP ***
}
Now:
Clearfails → the function sets no error flag and exits, so the IRP that is already being cancelled is completed/freed only by the cancellation callback.Clearsucceeds butSetfails → the IRP is genuinely orphaned (no cancellation routine installed), so the error flag is set and this function cleans it up.
This removes the race in which the cancellation callback and
MarkAllAdvertisingRequestAsNew could both complete and free the same IRP.
Patch Completeness Assessment
CFR-gated behind Feature_697033018. The corrected handling runs only when
the flag is enabled; the original (racy) iVar4 == 0 branch still ships in
.8655. Patch state is not determined by file version alone — the runtime-gated
pattern seen across this corpus. Verify Feature_697033018 is enabled to confirm
the fixed path is live.
Detection Guidance
Behavioural. Local processes driving rapid LE advertising register/cancel
churn to force ClearRequestCancellationRoutine failures during
MarkAllAdvertisingRequestAsNew.
Crash signature. Kernel double-free / pool-corruption bugchecks
(BAD_POOL_CALLER / UAF) in bthport!...MarkAllAdvertisingRequestAsNew /
...OnPendingAdvertisementRequestCancelThunk under advertising cancellation.
Config. The fix is CFR-gated — confirm Feature_697033018 is enabled so the
non-racy handling is active.
References
- MSRC advisory — CVE-2026-45640 (Windows Bluetooth Port Driver Elevation of Privilege), released 2026-06-09, KB5094126.
- Full binary diff:
/data/patch_diffs/bthport_sys-cve-2026-45640-ghidriff.md - Related
bthport.sysbug: CVE-2022-35820 (BthCreateKeyEx).
Attack Path
MarkAllAdvertisingRequestAsNew error-flags an IRP whose cancellation is already in flight, so both paths free it
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
Detection Rules
Acknowledgments
hazard