{"answers":{"affected":"It affects 4 products.","exploited":"Yes. Attackers have exploited CVE-2021-31166 in the wild since at least 6 Apr 2022.","fix":"No fix has been published for CVE-2021-31166 yet. Limit exposure of the affected software until one is available. US federal agencies must fix it by 27 Apr 2022.","what":"CVE-2021-31166 is a critical use after free vulnerability in Microsoft Windows 10 20h2, published on 11 May 2021. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2021-31166 and fix it if it is affected.\n\nWhat it is: CVE-2021-31166 is a critical use after free vulnerability in Microsoft Windows 10 20h2, published on 11 May 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: Yes. Attackers have exploited CVE-2021-31166 in the wild since at least 6 Apr 2022.\n\nAffected product: Microsoft Windows 10 20h2. No package-level version data is available, so check the vendor advisory linked from the reference page.\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2021-31166/ (Markdown: https://insights.sbomify.com/CVE-2021-31166/index.md)","id":"CVE-2021-31166","markdown":"https://insights.sbomify.com/CVE-2021-31166/index.md","name":"CVE-2021-31166","record":{"aliases":["GHSA-3mj9-c62w-jw5w"],"analysis":{"component_type":"operating_system","fix_type":"patch","impacts":["code_execution"],"network_reachable":"yes","non_default_config":false,"product_category":"Windows HTTP stack","requires_auth":"none","summary":"Remote attackers can execute arbitrary code via the Windows HTTP Protocol Stack, requiring immediate patching for Windows 10 and Server.","user_interaction":"not_required","vuln_class":"use_after_free"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"microsoft","cpe":[{"product":"windows_10_2004","vendor":"microsoft"},{"product":"windows_10_20h2","vendor":"microsoft"},{"product":"windows_server_2004","vendor":"microsoft"},{"product":"windows_server_20h2","vendor":"microsoft"}],"cvss":{"score":9.8,"severity":"critical","source":"cna","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","version":"3.1"},"cwes":[{"id":"CWE-416","name":"Use After Free"}],"description":"HTTP Protocol Stack Remote Code Execution Vulnerability","ecosystems":[],"exploits":{"exploitdb":0,"first_seen":"2021-05-11","github_poc":12,"max_poc_stars":823,"metasploit":1,"nuclei":0,"refs":[{"date":"2021-05-16T16:15:56Z","kind":"github_poc","ref":"https://github.com/0vercl0k/CVE-2021-31166","stars":823,"title":"Proof of concept for CVE-2021-31166, a remote HTTP.sys use-after-free triggered remotely."},{"date":"2021-09-27T05:56:45Z","kind":"github_poc","ref":"https://github.com/ZZ-SOCMAP/CVE-2021-31166","stars":19,"title":"Windows HTTP协议栈远程代码执行漏洞 CVE-2021-31166"},{"date":"2021-05-17T23:54:12Z","kind":"github_poc","ref":"https://github.com/corelight/CVE-2021-31166","stars":12,"title":"HTTP Protocol Stack CVE-2021-31166"},{"date":"2021-05-17T11:12:45Z","kind":"github_poc","ref":"https://github.com/zha0gongz1/CVE-2021-31166","stars":8,"title":"PoC for CVE-2021-31166, a remote HTTP.sys use-after-free triggered remotely. Although it was defined as remote command execution, it can only cause the system to crash."},{"date":"2022-11-22T09:10:36Z","kind":"github_poc","ref":"https://github.com/0xmaximus/Home-Demolisher","stars":8,"title":"PoC for CVE-2021-31166 and CVE-2022-21907"},{"date":"2021-07-03T14:54:59Z","kind":"github_poc","ref":"https://github.com/y0g3sh-99/CVE-2021-31166-Exploit","stars":7,"title":"Exploit for MS Http Protocol Stack RCE vulnerability (CVE-2021-31166)"},{"date":"2022-03-07T18:56:52Z","kind":"github_poc","ref":"https://github.com/mauricelambert/CVE-2021-31166","stars":6,"title":"CVE-2021-31166: exploitation with Powershell, Python, Ruby, NMAP and Metasploit."},{"date":"2021-05-19T07:50:40Z","kind":"github_poc","ref":"https://github.com/zecopro/CVE-2021-31166","stars":5,"title":"simple bash script for exploit CVE-2021-31166"}],"tier":"exploited"},"has_fix":null,"headline":"Microsoft HTTP Protocol Stack Remote Code Execution","id":"CVE-2021-31166","indexable":true,"kev":{"dateAdded":"2022-04-06","dueDate":"2022-04-27","knownRansomwareCampaignUse":"Unknown","product":"HTTP Protocol Stack","requiredAction":"Apply updates per vendor instructions.","vendorProject":"Microsoft","vulnerabilityName":"Microsoft HTTP Protocol Stack Remote Code Execution Vulnerability"},"kind":"cve","links":{"ecosystem":null,"product":"microsoft:windows_10_20h2","products":["microsoft:windows_10_20h2","microsoft:windows_server_20h2"],"type":"use_after_free","year":"2021"},"n_packages":0,"n_references":2,"next":{"headline":"Windows Container Manager Service Elevation of Privilege Vulnerability","id":"CVE-2021-31167"},"packages":[],"prev":{"headline":"Windows Container Manager Service Elevation of Privilege Vulnerability","id":"CVE-2021-31165"},"products":["Windows 10 Version 2004","Windows 10 Version 20H2","Windows Server version 2004","Windows Server version 20H2"],"published":"2021-05-11","related":[{"cvss_score":7.8,"headline":"Microsoft Win32k Privilege Escalation","id":"CVE-2021-41357","kev_date_added":"2022-04-25","published":"2021-10-13"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"open","licence":"CC0 1.0","name":"CISA KEV"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"},{"class":"open","licence":"CC0","name":"PoC-in-GitHub"}],"ssvc":{"automatable":"yes","exploitation":"active","technical_impact":"total"},"state":"PUBLISHED","updated":"2025-10-21","vendors":["Microsoft"]},"summary":"Remote attackers can execute arbitrary code via the Windows HTTP Protocol Stack, requiring immediate patching for Windows 10 and Server.","url":"https://insights.sbomify.com/CVE-2021-31166/"}