CriticalCVE-2021-31166

    HTTP Protocol Stack Remote Code Execution Vulnerability (CVE-2021-31166)

    Published In CISA KEV since Sources: SingCERT, CVE.org

    What is affected, what to do

    The vulnerability CVE-2021-31166 allows for remote code execution (RCE) in Microsoft's HTTP Protocol Stack, specifically within the http.sys module. An attacker can exploit this vulnerability to gain full control of the affected system without authentication. It is actively exploited in the wild, as evidenced by its inclusion in the CISA KEV catalog in April 2022. Affected products include specific versions of Windows 10 and Windows Server 2024. Immediate patching to the latest version is crucial to ensure security.

    The vulnerability is being actively exploited; treat it as a priority. Update Microsoft Windows 10 Version 2004 to version 10.0.19041.982, Microsoft Windows Server version 2004 to version 10.0.19041.982, Microsoft Windows 10 Version 20H2 to version 10.0.19042.982. Immediate actions, mitigation and detection rules are in the runbook below.

    Affected
    • Microsoft Windows 10 Version 2004 lt 10.0.0..10.0.19041.982
    • Microsoft Windows Server version 2004 lt 10.0.0..10.0.19041.982
    • Microsoft Windows 10 Version 20H2 lt 10.0.0..10.0.19042.982
    • Microsoft Windows Server version 20H2 lt 10.0.0..10.0.19042.982
    Fixed in
    • Microsoft Windows 10 Version 2004 10.0.19041.982
    • Microsoft Windows Server version 2004 10.0.19041.982
    • Microsoft Windows 10 Version 20H2 10.0.19042.982
    • Microsoft Windows Server version 20H2 10.0.19042.982

    Not sure whether and how you are affected? Ask a question about this vulnerability

    Metrics

    9.8

    Priority

    XIEM Effective CVSS: highest available CVSS rating from NVD and vendor data.

    Source: NVD, CVSS v3

    9.8

    CVSS v3

    Severity Critical on the scale from 0 to 10.

    Source: SingCERT, CVE.org

    99.87 %

    EPSS score

    High — model estimates ≥ 50% chance of real-world exploitation within 30 days.

    Source: FIRST EPSS, percentile 99.96

    Show all metrics
    Severity
    Critical
    Priority (0–325)

    The priority score is a consolidated metric that condenses several individual signals into a single, action-guiding ranking: technical severity (CVSS), exploitation likelihood (EPSS), known-exploited status (KEV) and the context of the affected asset. The aim is to answer the only truly important question in vulnerability management: what first?

    Read in glossary
    228.94 Methodology
    Exploit maturity

    An exploit is code or a technique that specifically uses a concrete vulnerability to force unintended behaviour — such as executing code or escalating privileges. It is the tool that turns a theoretical flaw into a practical attack.

    Read in glossary
    actively exploitedSource: ANSSI / CERT-FR How we classify
    XIEM Effective CVSS

    XIEM® is the tiered managed-security operating model from NEOSEC and a registered trademark of NEOSEC GmbH. It extends classic SIEM — the central collection, normalisation and correlation of security-relevant events — with endpoint forensics, network visibility and deception technology, and consolidates them into three building tiers: Sentry, Orchestrate and Command.

    Read in glossary
    9.8 Methodology
    CVSS v3

    CVSS is the globally established, open standard for assessing the technical severity of a vulnerability on a scale from 0 to 10. It describes how easily a flaw can be exploited and what damage it can cause — but not how likely its actual exploitation is. CVSS and the complementary EPSS deliberately answer different questions.

    Read in glossary
    9.8
    EPSS score

    The EPSS score is the absolute model output for an individual vulnerability: the estimated probability of real-world exploitation within the next 30 days, expressed as a value between 0 and 1 (i.e. 0 % to 100 %). A score of 0.42 means „the model estimates a 42 % chance of real-world exploitation within 30 days“.

    Read in glossary
    99.87 %
    High — model estimates ≥ 50% chance of real-world exploitation within 30 days.
    EPSS percentile

    The EPSS percentile is the relative position of a vulnerability within all EPSS-scored CVEs, expressed as a value between 0 and 1. A percentile of 0.90 means „this CVE has a higher EPSS score than 90 % of all other scored CVEs“. Unlike the EPSS score, it is not a probability — but a positioning within a ranking.

    Read in glossary
    99.96
    Critical — this CVE ranks in the top fifth of all CVEs scored today (rank ≥ 80%).
    KEV status

    The KEV catalogue is a list maintained by the US authority CISA of vulnerabilities for which active exploitation in the wild has been confirmed. It answers not the question „how severe?“ but „is it already being attacked?“ — thereby sharply prioritising patching.

    Read in glossary
    Actively exploited
    Published
    In CISA KEV since

    The KEV catalogue is a list maintained by the US authority CISA of vulnerabilities for which active exploitation in the wild has been confirmed. It answers not the question „how severe?“ but „is it already being attacked?“ — thereby sharply prioritising patching.

    Read in glossary
    CISA assessment (SSVC)
    Exploitation: active · automatable · Technical impact: total
    Source: CISA Vulnrichment, as of 7 February 2025
    CWE

    CWE is a catalogue of typical weakness types in software and hardware — such as flawed input validation, unsafe memory handling or poor authentication. Where a CVE names a concrete vulnerability in a concrete product, a CWE describes the underlying class of defect.

    Read in glossary
    CWE-416

    Response and mitigation

    Why act now?

    Prioritisation rationale

    This is a kernel-mode flaw in http.sys. It is reachable over the network without authentication or user interaction, and Microsoft explicitly called it wormable. A public proof-of-concept has existed since May 2021 that blue-screens a host with a single crafted request, which places the CVE among those most likely to be exploited. Expect opportunistic mass scanning. CISA does not flag known ransomware use. Only the now-unsupported 2004/20H2 releases are affected, so the vulnerable estate is usually small but easily forgotten: kiosks, OT-adjacent engineering workstations, Server Core container hosts. Treat internet-exposed instances as critical with immediate action, and internal hosts with reachable WinRM or IIS as high. For KRITIS operators, an availability outage alone can be a reportable incident under NIS2.

    1. Runbook step 1

      Immediate response (0-24 h)

      • Inventory affected hosts: Find every Windows 10 version 2004/20H2 and Windows Server version 2004/20H2 (SAC, usually Server Core) host running a build below 10.0.19041.982 or 10.0.19042.982. Check with Get-ComputerInfo | Select OsBuildNumber or winver. Older releases such as 1809 and Server 2019 are not in the affected-products list.
      • Patch: Apply the May 2021 cumulative security update, or any later cumulative update that brings the build to 19041.982 / 19042.982 or higher. Look up the KB number in Microsoft's advisory for CVE-2021-31166. A reboot is mandatory because http.sys is a kernel driver.
      • Check lifecycle status: Both affected releases are past end of servicing. Plan an in-place upgrade to a supported release rather than stopping at the May 2021 level, which would leave later http.sys bugs unpatched.
      • Handle exposed listeners first: Prioritise every HTTP.sys listener reachable from the internet or untrusted zones. Typical ones are IIS (80/443), WinRM (5985/5986), WSDAPI (5357), Web Deploy and custom HttpListener services. Block inbound access at the perimeter until the host is patched.
      • Enumerate listeners per host: Run netsh http show servicestate on each host. It lists every process that has registered URLs with http.sys, including on workstations where nobody expects a web server.
    2. Runbook step 2

      Mitigation layers

      • Vendor workaround: Microsoft has published no official registry workaround for this CVE. Patching or upgrading is the only full fix; everything below only reduces risk.
      • Network segmentation: Restrict inbound TCP 80/443/5985/5986/5357 on unpatched hosts to defined management subnets, using host firewall rules pushed by GPO. Block HTTP.sys ports between client VLANs to stop worm-style lateral spread.
      • Reverse proxy / WAF: Front exposed IIS with a proxy that does not use http.sys (nginx, HAProxy, F5). Drop requests whose Accept-Encoding header contains empty tokens, such as , , or a trailing comma. ModSecurity idea: SecRule REQUEST_HEADERS:Accept-Encoding "@rx ,\s*(,|$)" "id:3116601,deny,status:400".
      • IPS signature: Use a Suricata/Snort rule shape such as alert http any any -> $HOME_NET any (msg:"CVE-2021-31166 malformed Accept-Encoding"; http.header; content:"Accept-Encoding|3a|"; pcre:"/Accept-Encoding\x3a[^\r\n]*,\s*(,|\r)/i"; sid:9031166; rev:1;). On commercial IPS, enable the vendor's signatures for this CVE.
      • Reduce attack surface: Disable services that register HTTP.sys listeners where they aren't needed. Examples are WinRM on workstations (Disable-PSRemoting, then set the WinRM service to Disabled) and unused IIS roles. Fewer reachable listeners means fewer entry points until patching is complete.
    3. Runbook step 3

      Detection rules

      • Unexpected crashes (Windows System log): Watch for Event ID 1001 (BugCheck / WER-SystemErrorReporting), Event ID 41 (Kernel-Power) and Event ID 6008 on hosts with HTTP.sys listeners. Clusters of these events point to DoS exploitation with the public PoC. KQL: Event | where EventLog=="System" and EventID in (41,1001,6008) | summarize count() by Computer, bin(TimeGenerated,1h).
      • Crash dump triage: Search MEMORY.DMP and minidumps for stacks containing HTTP!UlpParseContentCoding or HTTP!UlAcceptEncodingHeaderHandler. A match is a high-confidence indicator of an attempt against this CVE.
      • HTTPERR / proxy logs: Review %SystemRoot%\System32\LogFiles\HTTPERR\ for aborted connections immediately before a reboot. In proxy or WAF logs, search for Accept-Encoding values with empty tokens. SPL: index=proxy http_accept_encoding="*,*" | regex http_accept_encoding=",\s*(,|$)".
      • Network telemetry: In Zeek http.log or Suricata http events, flag requests with anomalous Accept-Encoding values that get no response (empty status_code, connection reset). Also hunt for sweeps of 5985/5986/5357 originating from client subnets.
      • Post-exploitation (if RCE is achieved): Use Sysmon EID 1 or EDR telemetry to watch for processes spawned with SYSTEM context under System (PID 4). Also look for new services (Event ID 7045) and driver loads (Sysmon EID 6) shortly after a crash or reboot.

    Detection rules

    No NEOSEC detection rule is available for this vulnerability yet.

    Classification under NIS2 and CRA

    Rule-based classification from exploitation status and severity. It does not replace a case-by-case assessment.

    NIS2

    NIS2 is EU Directive (EU) 2022/2555 to raise the level of cybersecurity across the Union. It substantially broadens obligations compared with the first NIS directive: more sectors, mandatory risk management, staged reporting duties and personal accountability of senior management.

    Read in glossary
    Actively exploited: treat the vulnerability as a priority in vulnerability handling under Art. 21(2)(e) NIS2. If it is exploited in your environment, check the reporting obligation under Art. 23 (early warning within 24 hours).
    CRA

    The CRA is EU Regulation (EU) 2024/2847 setting horizontal cybersecurity requirements for „products with digital elements“ — from industrial controllers and software to connected consumer devices. For the first time manufacturers must ensure security across the entire product lifecycle, handle vulnerabilities and provide security updates.

    Read in glossary
    Since 11.09.2026, manufacturers of affected products with digital elements must report actively exploited vulnerabilities under Art. 14 CRA, with an early warning within 24 hours via ENISA's single reporting platform.
    ISO/IEC 27001

    ISO/IEC 27001 is the internationally leading standard for an information security management system (ISMS). It describes a risk-based, process-oriented framework to systematically plan, implement, review and improve information security.

    Read in glossary
    Control A.8.8, management of technical vulnerabilities: assess relevance to your systems, plan remediation and keep evidence.

    Description

    HTTP Protocol Stack Remote Code Execution Vulnerability

    Source: CSA/SingCERT, NVD (NIST), cvelistv5, CISA KEV Catalog, CVE.org (MITRE)

    Vendors and products

    Affected operating systems

    Affected operating systems
    WindowsMicrosoftWindows 10 Version 200410.0.19041.982
    WindowsMicrosoftWindows 10 Version 20H210.0.19042.982
    WindowsMicrosoftWindows Server version 200410.0.19041.982
    WindowsMicrosoftWindows Server version 20H210.0.19042.982
    Windowsmicrosoftwindows_10_180910.0.19041.982
    Windowsmicrosoftwindows_10_2004—
    Windowsmicrosoftwindows_10_20H210.0.19042.982
    Windowsmicrosoftwindows_10_20h2—
    Windowsmicrosoftwindows_server_200410.0.19041.982
    Windowsmicrosoftwindows_server_2004—
    Windowsmicrosoftwindows_server_20H210.0.19042.982
    Windowsmicrosoftwindows_server_20h2—

    Weakness classes (CWE)

    • CWE-416Use After Free

      Variant

      The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer.

      Entry at MITRE CWE-416

    Public exploit references

    Publicly reported proof-of-concepts, exploit modules and detection templates for this vulnerability. NEOSEC links to the original sources only and does not provide any exploit code.

    Public exploit references
    CISA KEV CatalogCISA Known Exploited Vulnerability (opens in a new tab)cisa.govactively exploited
    ANSSI / CERT-FRLicence Ouverte 2.0, as of CERTFR-2021-ALE-009 – [MàJ] Vulnérabilité dans Microsoft Windows (clôturée 2021-06-10) (opens in a new tab)cert.cyber.gouv.fractively exploited
    Packet StormMicrosoft HTTP Protocol Stack Remote Code Execution (opens in a new tab)packetstormsecurity.comPoC (publicly reported)reported, not verified—

    References & sources

    • portal.msrc.microsoft.comen-US/security-guidance/advisory/CVE-2021-31166x_refsource_MISC, Patch, Vendor advisory
    • packetstormsecurity.comfiles/162722/Microsoft-HTTP-Protocol-Stack-Remote-Code-Executio…x_refsource_MISC, Third-party advisory, Vulnerability database
    • cisa.govknown-exploited-vulnerabilities-catalog?field_cve=CVE-2021-31166government-resource, US government resource
    • cert.cyber.gouv.frANSSI / CERT-FR: CERTFR-2021-ALE-009 – [MàJ] Vulnérabilité dans Microsoft Windows (clôturée 2021-06-10)cert-fr
    Embed badge

    Show the severity and KEV status of this vulnerability on your site – with a link back here. The image is updated hourly.

    Badge preview for CVE-2021-31166
    <a href="https://intel.neosec.eu/en/cve/CVE-2021-31166"><img src="https://intel.neosec.eu/badge/cve/CVE-2021-31166.svg?lang=en" alt="CVE-2021-31166 – NEOSEC Intel" height="20"></a>