Skip to content
Memory corruption Write-up Advanced

When 65,536 HTTP Headers Become Zero

A 16-bit counter tracking unknown HTTP/2 headers in Windows http.sys wraps to zero after 65,536 distinct headers, while the linked list still holds all entries. A downstream header-marshalling builder sizes its pool allocation from the wrapped counter but fills it by walking the full list, producing a roughly 1.5 MB sequential kernel pool overwrite.

medium.com

Published on medium.com

Microsoft classified CVE-2026–47291 as a critical, pre-authentication remote code execution vulnerability in the Windows HTTP Protocol Stack.

Anthony Cihan, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The producer links a new unknown-header node into the request list before incrementing and checking a 16-bit counter, so the wrap error leaves the counter at zero while the list holds 65,536 nodes, and the builder sizes its allocation from the counter but copies by traversing the list.

Impact

On the tested default IIS configuration the overflow was not reachable because the request-size limit, the absence of an active HKE consumer and producer error propagation each blocked the path; with those gates removed in a lab, the builder wrote past its allocation and faulted in a guard page, and the text does not claim a working remote exploit.

What the attacker needed

HTTP/2 enabled on the target; request-size limit raised above default; an active HKE consumer bound; producer error not aborting the request

The fix

Microsoft's patch adds a MaxHeadersCount limit derived from the maximum request size and rejects HTTP/2 requests whose decoded header count exceeds it plus four pseudo-headers, before the counter can wrap.

How it was found

  1. Establish a TLS connection and negotiate HTTP/2 via ALPN
  2. Send the HTTP/2 client preface and complete the SETTINGS exchange
  3. Build the four required pseudo-headers and generate 65,536 distinct unknown header names
  4. HPACK-encode the header block and split it across a HEADERS frame and CONTINUATION frames
  5. Send the request and decode any response, RST_STREAM or GOAWAY frame
  6. Probe whether the listener remains available

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Windows handles web traffic in a core kernel component called http.sys, which runs with the highest privileges. A small counter there could only count up to 65,535 headers, so one more made it read zero, yet the server still held all 65,536 headers in a list. A later routine reserved memory based on the zero count but then copied every entry from the list, writing far past the reserved buffer and corrupting kernel memory.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.