Microsoft Windows: http.sys use-after-free remote code execution (CVE-2021-31166)
A public proof-of-concept exploit for CVE-2021-31166, a use-after-free vulnerability in the Windows http.sys driver, demonstrates remote code execution via a malformed Accept-Encoding header.
CVE search metadata
CVE search record: CVE-2021-31166. Severity: critical. CVSS: 9.8. EPSS: 99.87%. KEV: no. Product: Windows 10 2004 (< 10.0.19041.982), Windows 10 20H2 (< 10.0.19042.982), Windows Server 2004 (< 10.0.19041.982), Windows Server 20H2 (< 10.0.19042.982). Brief: Microsoft Windows: http.sys use-after-free remote code execution (CVE-2021-31166). Brief link: https://feed.craftedsignal.io/briefs/2026-10-cve-2021-31166/
Triage facts
Revision 1- Applicability
- Windows 10 2004 (< 10.0.19041.982), Windows 10 20H2 (< 10.0.19042.982) +2
- Evidence
- Unknown
- Severity
- High
- Action
- Elevated
- Sources
- 3 public sources
- Freshness
- Revision 1Oct 27, 09:20 UTC
- Detection
- 1 rule
- Vulnerabilities
- 1 CVE
- Source quality
- B2Likely
CVE-2021-31166 is a critical use-after-free vulnerability located in the Windows http.sys driver, which handles HTTP requests. Successful exploitation allows an unauthenticated, remote attacker to execute arbitrary code on the target system. The vulnerability was initially patched in May 2021. Recent activity involves the publication of functional proof-of-concept code that utilizes a specifically crafted Accept-Encoding header to trigger the flaw.
Impact
Successful exploitation leads to full system compromise, providing the attacker with the same privileges as the http.sys driver (typically SYSTEM level). This impact is confirmed for unpatched versions of Windows 10 and Windows Server 2004/20H2.
Recommendation
- Perform an immediate inventory of Windows systems to identify any running instances of the affected Windows 10 or Server versions (2004/20H2) that remain unpatched.
- Ensure all systems are updated to the security patch level released in May 2021 or later.
- For internet-facing systems that cannot be patched immediately, deploy the provided WAF block logic to inspect and drop incoming HTTP requests containing the specific
Accept-Encoding: doar-e, ftw, imo, ,header string. - Implement the detection rule below to monitor for malicious header patterns in web server logs.
Immediate actions
Inventory Windows Server and workstation fleet for unpatched versions.
Mitigations
Deploy WAF rule using the provided byte match for header 'doar-e, ftw, imo, ,'.
CVE-2021-31166
Detection coverage 1
Detect CVE-2021-31166 Exploitation Attempt - Malformed Accept-Encoding Header
highDetects exploitation attempts for CVE-2021-31166 targeting the http.sys driver by identifying the known malformed Accept-Encoding header string used in public PoC.
Detection queries are available on the platform. Get full rules →