CVE-2022-21849 — Windows Internet Key Exchange (IKE) Protocol Extensions Remote Code Execution Vulnerability
Executive Summary
None
Overview
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/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 for 32-bit Systems | 5009585 (Security Update) |
Important | Remote Code Execution | Yes |
| Windows 10 for x64-based Systems | 5009585 (Security Update) |
Important | Remote Code Execution | Yes |
| Windows 10 Version 1607 for 32-bit Systems | 5009546 (Security Update) |
Important | Remote Code Execution | Yes |
| Windows 10 Version 1607 for x64-based Systems | 5009546 (Security Update) |
Important | Remote Code Execution | Yes |
| Windows 10 Version 1809 for 32-bit Systems | 5009557 (Security Update) |
Important | Remote Code Execution | Yes |
| Windows 10 Version 1809 for ARM64-based Systems | 5009557 (Security Update) |
Important | Remote Code Execution | Yes |
| Windows 10 Version 1809 for x64-based Systems | 5009557 (Security Update) |
Important | Remote Code Execution | Yes |
| Windows 10 Version 1909 for 32-bit Systems | 5009545 (Security Update) |
Important | Remote Code Execution | Yes |
| Windows 10 Version 1909 for ARM64-based Systems | 5009545 (Security Update) |
Important | Remote Code Execution | Yes |
| Windows 10 Version 1909 for x64-based Systems | 5009545 (Security Update) |
Important | Remote Code Execution | Yes |
| Windows 10 Version 20H2 for 32-bit Systems | 5009543 (Security Update) |
Important | Remote Code Execution | Yes |
| Windows 10 Version 20H2 for ARM64-based Systems | 5009543 (Security Update) |
Important | Remote Code Execution | Yes |
| Windows 10 Version 21H1 for 32-bit Systems | 5009543 (Security Update) |
Important | Remote Code Execution | Yes |
| Windows 10 Version 21H1 for ARM64-based Systems | 5009543 (Security Update) |
Important | Remote Code Execution | Yes |
| Windows 10 Version 21H1 for x64-based Systems | 5009543 (Security Update) |
Important | Remote Code Execution | Yes |
| Windows 10 Version 21H2 for 32-bit Systems | 5009543 (Security Update) |
Important | Remote Code Execution | Yes |
| Windows 10 Version 21H2 for ARM64-based Systems | 5009543 (Security Update) |
Important | Remote Code Execution | Yes |
| Windows 10 Version 21H2 for x64-based Systems | 5009543 (Security Update) |
Important | Remote Code Execution | Yes |
| Windows 11 version 21H2 for ARM64-based Systems | 5009566 (Security Update) |
Important | Remote Code Execution | Yes |
| Windows 11 version 21H2 for x64-based Systems | 5009566 (Security Update) |
Important | Remote Code Execution | Yes |
| Windows Server 2016 | 5009546 (Security Update) |
Important | Remote Code Execution | Yes |
| Windows Server 2016 (Server Core installation) | 5009546 (Security Update) |
Important | Remote Code Execution | Yes |
| Windows Server 2019 | 5009557 (Security Update) |
Important | Remote Code Execution | Yes |
| Windows Server 2019 (Server Core installation) | 5009557 (Security Update) |
Important | Remote Code Execution | Yes |
| Windows Server 2022 | 5009555 (Security Update) |
Important | Remote Code Execution | Yes |
| Windows Server 2022 (Server Core installation) | 5009555 (Security Update) |
Important | Remote Code Execution | Yes |
| Windows Server, version 20H2 (Server Core Installation) | 5009543 (Security Update) |
Important | Remote Code Execution | Yes |
Patches
| Article | Type | Restart |
|---|---|---|
5009585 |
Security Update | Yes |
5009546 |
Security Update | Yes |
5009557 |
Security Update | Yes |
5009545 |
Security Update | Yes |
5009543 |
Security Update | Yes |
5009566 |
Security Update | Yes |
5009555 |
Security Update | Yes |
Patch Diff
Stack buffer overflow in Windows IKEv2 extension (ikeext.dll). IkeLookupVendorId handles vendorID 0x1000 by allocating v11-16 bytes from input, but IkeHandleSecurityRealmVendorId calls WfpBytesToString which copies data into an 80-byte stack buffer without length checking. Reachable via UDP/500 IKEv2 VendorID payload. Patch added length clamping.
| Function | Address | Change | Note |
|---|---|---|---|
IkeLookupVendorId |
|
modified | Added length validation before allocating vendorID payload buffer |
IkeHandleSecurityRealmVendorId |
|
modified | Added length clamping before WfpBytesToString call to prevent stack buffer overflow |
Root Cause Analysis
CVE-2022-21849 — Windows IKEv2 Extension ikeext.dll Stack Buffer Overflow
Summary
| Product | Microsoft Windows — ikeext.dll (IKE and AuthIP IPsec Keying Modules) |
|---|---|
| Vendor | Microsoft Corporation |
| Severity | CVSS v3.1 9.8 (Critical) |
| CVE Title | Windows IKE Extension Remote Code Execution Vulnerability |
| CWE | CWE-121 (Stack-based Buffer Overflow) |
| Affected Versions | Windows 10/11 and Server with IPsec/IKEv2 enabled |
| Impact | Remote — unauthenticated attacker sends crafted VendorID payload → RCE |
| Exploited ITW | No |
| Patch Date | January 2022 Patch Tuesday |
Root Cause
During IKEv2 negotiation, peers exchange Vendor ID payloads to advertise
supported extensions. ikeext!IkeLookupVendorId handles vendorID 0x1000,
which corresponds to “MSFT IPsec Security Realm Id”:
-
IkeLookupVendorIdreads the vendorID payload length and allocatesv11 - 16bytes for the data (subtracting the vendorID header overhead). -
The code then calls
IkeHandleSecurityRealmVendorIdwhich invokesWfpBytesToStringto convert the raw bytes to a string. -
WfpBytesToStringcopies the data into a fixed 80-byte stack bufferv35without checking the input length — stack buffer overflow.
A vendorID payload longer than 80 bytes (plus header) overflows the stack buffer, overwriting the return address and enabling remote code execution.
The patch (verified in ghidriff diff, 318 → 434)
The diff confirms vendorID handling was hardened:
-
IkeLookupVendorId(63% match) — added length validation before processing the vendorID payload. A new strings_Ignoring_the_vendor,_received_Swas added and is referenced here, indicating oversized vendorIDs are now logged and ignored rather than passed to the vulnerable string-conversion path. -
IkeHandlePayloadMMVendorId(99% match) — near-identical; the overflow path was blocked upstream inIkeLookupVendorId.
The fix blocks vendorID payloads whose data length exceeds the expected bounds
before WfpBytesToString is ever called.
Diff: ghidriff/CVE-2022-21849/output/ikeext-10.0.22000.318.dll-ikeext-10.0.22000.434.dll.ghidriff.md
Reaching the bug — network path
Fully remote, no authentication required:
Attacker (any IP)
│
▼
UDP/500 → target Windows host
│
▼
ikeext!IkeLookupVendorId
│ VendorID payload with vendorID == 0x1000
│ Data length > 80 bytes
▼
ikeext!IkeHandleSecurityRealmVendorId
│
▼
ikeext!WfpBytesToString
│
▼
strcpy(dest=v35[80], src=attacker_data) ← stack overflow
| Element | Value |
|---|---|
| Protocol | UDP/500 (IKEv2) |
| Vulnerable functions | ikeext!IkeLookupVendorId, ikeext!IkeHandleSecurityRealmVendorId, ikeext!WfpBytesToString |
| Vendor ID | 0x1000 (“MSFT IPsec Security Realm Id”) |
| Buffer | 80-byte stack buffer v35 |
| Privileges | none (unauthenticated, remote) |
| Prerequisites | Windows host with IPsec/IKEv2 service running |
Detection engineering
- Network IDS: Alert on IKEv2 VendorID payload with vendorID
0x1000and data length > 80 bytes. This is abnormal — the legitimate MSFT Security Realm ID is typically small. - Windows Event Log: IKEv2 negotiation failures in
Microsoft-Windows-IKE/Operational. - Crash forensics: Stack corruption / bugcheck in
ikeext!WfpBytesToStringorikeext!IkeHandleSecurityRealmVendorIdwith a long vendorID payload on the stack.
References
Attack Path
Pre-auth stack buffer overflow from an IKEv2 VendorID payload on UDP/500
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.