Skip to main content
Mallory
CriticalExploited in the wildCISA KEVPublic exploitVulnerability

CVE-2021-31166: Windows HTTP Protocol Stack Remote Code Execution

Published May 11, 2021 · Updated today
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 days2 mentions · peak 1 in a dayToday
CVSS9.8Critical · v3.1
EPSS99.9%100th percentile
CISA KEVYesAdded Apr 6, 2022
In the wildActivePer CISA KEV
Vendor
Microsoft Corporation
IdentifiersCVE-2021-31166CWE-416 · Use After Free

CVE-2021-31166 is a critical remote code execution vulnerability in the Windows HTTP Protocol Stack affecting Windows 10 and Windows Server releases 2004 and 20H2, including Server Core installations. Improper handling of specially crafted incoming packets by the kernel-mode HTTP driver allows an unauthenticated remote attacker to execute code with SYSTEM privileges. Exposed services can include IIS and other applications using the Windows HTTP Protocol Stack, including Windows Remote Management. The vulnerability has a CVSS score of 9.8 and is considered potentially wormable.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Analyst brief

Impact, mitigation & remediation

What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation can result in complete system compromise through remote code execution with SYSTEM privileges, or denial of service through system instability or crashes. Its unauthenticated, potentially wormable nature could enable automated propagation between reachable vulnerable systems. Public proof-of-concept code increases the risk to unpatched installations, but does not establish that reliable remote code execution or widespread exploitation has occurred.

Mitigation

If you can’t patch tonight, do this now.

Pending patch deployment, restrict access from untrusted networks to services using the Windows HTTP Protocol Stack, including applicable IIS and Windows Remote Management listeners. Disable unnecessary exposed listeners and use network segmentation to reduce reachability between vulnerable systems. These exposure-reduction measures do not correct the underlying vulnerability.

Remediation

Patch, then assume compromise.

Install the applicable Microsoft cumulative security update released on May 11, 2021, or a subsequent cumulative update containing the fix, on every affected Windows 10 and Windows Server system. Include Server Core installations and systems exposing non-IIS services that use the Windows HTTP Protocol Stack.

Public exploits

Exploits

5 exploits validated by Mallory's analysis. Hidden: 3 rejected by Mallory's analysis as not a working exploit.

View more in app →
http_sys_accept_encoding_dos_cve_2021_31166.rbThis repository contains a single Metasploit auxiliary module that exploits CVE-2021-31166, a use-after-free vulnerability in the Windows HTTP Protocol Stack (http.sys) affecting IIS servers. The module is written in Ruby and leverages the Metasploit framework's HTTP client and DoS auxiliary mixins. The exploit works by sending a specially crafted HTTP GET request with a malformed Accept-Encoding header to the target IIS server. If the server is vulnerable, this causes a Blue Screen of Death (BSOD) and a subsequent reboot, resulting in a denial of service. The module allows the user to specify the target URI (default is '/'). The code includes logic to check if the server is alive before and after sending the payload, and reports on the success of the attack. The repository is operational and provides a working denial-of-service exploit for the specified vulnerability.Disclosed May 11, 2021 · Framework: metasploit · ruby · networkWeaponizedcve-2021-31166-pocThis standalone repository contains two Python utilities, an MIT license, and a README. The primary script, cve_2021_31166_check.py, implements an active CVE-2021-31166 crash attempt rather than merely checking a version or banner. Its visible code defines the public malformed Accept-Encoding trigger and ten alternate representations intended to vary its signature. The documented workflow establishes an HTTP baseline, sends trigger requests, monitors TCP availability with ICMP corroboration, and optionally exports JSON evidence. Repeat, fuzz, and burst parameters are referenced, although substantial portions of the implementation are truncated in the supplied material. The exploit targets HTTP.sys content-coding parsing in http!UlpParseContentCoding. Its objective is a Windows kernel crash; despite the CVE's RCE designation, this repository does not provide an RCE chain. Liveness loss is only consistent with a bugcheck, not proof: filtering, listener failure, or unrelated outages can produce similar observations. The fully visible companion, httpsys_fingerprint.py, sends a normal HEAD request, permits additional headers with CR/LF checks, and recognizes Microsoft-HTTPAPI or IIS Server banners. It cannot distinguish patched from vulnerable systems. Both utilities connect directly through standard TCP sockets, optionally using TLS; no fixed command-and-control or exfiltration destination is visible. The source includes the fingerprinting User-Agent httpsys-fingerprint/1.0 and the main tool's Mozilla/5.0 (Windows NT 10.0; Win64; x64) constant. There are notable documentation and control-flow caveats. The README names cve_2021_31166_exploit.py, which is absent from the supplied file listing. In the visible main routine, the diagnostics-only return requires an explicit --diagnose without --exploit; the branch that merely prints a diagnostics-only message does not itself prevent the subsequent exploit-function call. Consequently, the claimed safe default cannot be assumed from this excerpt. Repository URL, revision, and archive size were not supplied; empty strings and zero represent unavailable metadata, not measured values.testerxma · Disclosed Oct 24, 2026 · python · networkOperationalCVE-2021-31166This repository contains a proof-of-concept exploit for CVE-2021-31166, a remote use-after-free vulnerability in Microsoft's HTTP.sys driver. The main exploit file, 'cve-2021-31166.py', is a short Python script that sends a specially crafted HTTP GET request with a malformed 'Accept-Encoding' header to a specified target. The exploit is designed to trigger a crash (bugcheck) in vulnerable Windows systems running HTTP.sys, as described in the README. The repository includes a detailed README explaining the vulnerability, affected Windows versions (Windows 10/Server 2004/20H2), and references to further technical details. The exploit does not provide remote code execution or a shell, but demonstrates the ability to crash the target system, confirming the presence of the vulnerability. No hardcoded IPs or domains are present; the target is specified by the user at runtime.0vercl0k · Disclosed May 16, 2021 · python · networkPoCCVE-2021-31166This repository contains a proof-of-concept (PoC) exploit for CVE-2021-31166, a use-after-free vulnerability in Microsoft's HTTP.sys driver. The main file, 'CVE-2021-31166.py', is a Python script that sends a specially crafted HTTP GET request with a malformed 'Accept-Encoding' header to a specified target. The exploit is designed to trigger a crash (denial of service) in the HTTP.sys service on vulnerable Windows 10 and Windows Server 2004/20H2 systems. The README.md provides background on the vulnerability, affected versions, and references. The exploit does not provide code execution or shell access; its primary capability is to demonstrate the vulnerability by causing a service crash. The only fingerprintable endpoint is the HTTP service on the target system, specified by the user at runtime.zha0gongz1 · Disclosed May 17, 2021 · python · networkPoCCVE-2021-31166This repository provides proof-of-concept (POC) exploit code for CVE-2021-31166, a critical remote code execution vulnerability in the Windows HTTP protocol stack (HTTP.sys). The repository contains two main exploit scripts: 'CVE-2021-31166.py' (Python) and 'main.go' (Go), both implementing similar logic. The exploit works by sending a specially crafted HTTP GET request with a malformed 'Accept-Encoding' header to a target Windows system. If the target is vulnerable, this can trigger a use-after-free condition in HTTP.sys, leading to a denial of service (system crash/blue screen). The scripts include logic to check the target's availability before and after the exploit attempt, and to confirm if the system has crashed and restarted. The README provides detailed information about the vulnerability, affected Windows versions, and references. No weaponized or post-exploitation payload is included; the code is strictly a POC for triggering the vulnerability and observing the result.ZZ-SOCMAP · Disclosed Sep 27, 2021 · python · go · networkPoC
Exposure surface

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
Microsoft CorporationWindows 10 1809operating_system
Microsoft CorporationWindows 10 2004operating_system
Microsoft CorporationWindows 10 20h2operating_system
Microsoft CorporationWindows Server 2004operating_system
Microsoft CorporationWindows Server 20h2operating_system
FAQ

Frequently asked questions

Is CVE-2021-31166 exploited in the wild?
Yes. As of Dec 3, 2026, Mallory has reports of exploitation in the wild, and CISA added it to KEV on Apr 6, 2022.
Is there a public exploit for CVE-2021-31166?
Yes. Mallory tracks 5 public exploits or proofs of concept for CVE-2021-31166, the earliest disclosed May 11, 2021.
Is there a patch for CVE-2021-31166?
Install the applicable Microsoft cumulative security update released on May 11, 2021, or a subsequent cumulative update containing the fix, on every affected Windows 10 and Windows Server system. Include Server Core installations and systems exposing non-IIS services that use the Windows HTTP Protocol Stack.
What products are affected by CVE-2021-31166?
Microsoft Corporation Windows 10 1809, Microsoft Corporation Windows 10 2004, Microsoft Corporation Windows 10 20h2, Microsoft Corporation Windows Server 2004, and Microsoft Corporation Windows Server 20h2.
How severe is CVE-2021-31166?
CVE-2021-31166 has a CVSS v3.1 score of 9.8 (Critical) and an EPSS score of 99.9% (100th percentile) as of Dec 3, 2026.
Activity feed

Recent activity

5 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.

View more in app →
Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Mallory platform

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, and which detections to deploy tonight.
Exposure mappingQuery your assets running an affected version, and investigate the blast radius.
Threat actor evidenceEvery report linking this CVE to a named adversary.
Associated malwareMalware families linked to this CVE, with evidence and IOCs.
Detection signatures4YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activityCommunity discussion across Reddit, Mastodon, and other social sources.