All DDoS Definitions
We use this to reply to you. Privacy policy
DDoS Testing Definition

HPACK Bomb

One 16 kB HTTP/2 header block can decompress to 64 MB of headers. That asymmetry is the whole of the HPACK bomb, a denial-of-service attack on HTTP/2 header compression reported in 2016, and it is why a DDoS test checks the decoded-size limit at every hop that terminates HTTP/2. CVE-2016-6581 is one recorded instance; the weakness belongs to any decoder that builds the header list before it measures it.

HPACK bomb: small on the wire, huge once decoded Header block 16 kB on the wire every byte: index 62 HPACK dynamic table one per connection, capped at 4,096 bytes entry 62: one header of nearly 4 kB sent once, referenced by every later block Decoded header list 64 MB a ratio of 4,096 or better, held in memory Limit enforced while decoding SETTINGS_MAX_HEADER_LIST_SIZE checked on the running total request refused, memory stays flat Limit checked after decoding the full list is built first, then measured the 64 MB is already spent In a test: find the decoded-size limit at every hop that terminates HTTP/2 and watch memory just before the refusal: a spike means the check runs too late BlackNeuron™
HPACK bomb: one header block inserts a large entry into the connection's HPACK dynamic table, the following bytes each reference that entry by index, and the decoder expands a 16 kB block into 64 MB of headers in server memory unless a maximum decoded header list size stops it first

How an HPACK bomb works

HPACK, the header compression format HTTP/2 uses, keeps a dynamic table per connection. A sender can add a header field to that table once and then refer to it in later header blocks by a short index, often a single byte. That is what makes repeated headers cheap on the wire.

The table is bounded; the output is not. The dynamic table's size is capped by a setting (4,096 bytes by default), so the decoder's table never grows large. What the cap does not limit is how many times an entry may be referenced. An entry of nearly 4 kB, referenced again and again by one-byte indexes, turns each byte of the block into about 4 kB of decoded headers.

That is where the ratio comes from. One byte in, about 4,096 bytes out, so the ratio is 4,096 or better. A 16 kB block, the default maximum HTTP/2 frame size, decodes to 64 MB.

The entry is paid for once. The dynamic table lives for the whole connection, so the large entry is sent a single time and every later request on that connection can reference it.

Why it matters under attack

A few header blocks can exhaust memory. At 64 MB per block, a few blocks decoded at once can exhaust a server's memory, and each is held for as long as its request is being handled. That takes no botnet and almost no bandwidth.

The usual counters do not see it. Request rate is low and bytes on the wire are small. A dashboard watching either sees a quiet connection while resident memory climbs. Like the HTTP/2 CONTINUATION flood, it attacks header handling rather than request volume; the CONTINUATION flood never finishes a header block, while the HPACK bomb sends a complete one that is simply enormous once decoded.

The protocol's limit is only advice. SETTINGS_MAX_HEADER_LIST_SIZE lets a server tell clients the largest decoded header list it will accept. The attacker is free to ignore it, so it protects only if the decoder itself enforces the limit while decoding, and stops the moment the running total passes it. A decoder that builds the full list and checks its size afterwards has already spent the memory.

The hop that decodes is the hop that pays. An edge that terminates HTTP/2 decompresses the headers before it can apply a single rule. Whether it is protected depends on that component's HTTP/2 library, not on the WAF policy above it, as with HTTP/2 Rapid Reset.

HPACK bomb: one header block, a decoded list 4,096 times larger Header block 16 kB on the wire 16 kB on the wire HPACK decoder one byte becomes 4 kB 64 MB decoded header list Server memory the dynamic table stays small; the decoded list does not, unless its size is capped while decoding BlackNeuron™
Animated HPACK bomb: a 16 kB header block reaches the HPACK decoder, which expands each one-byte index into a stored table entry and writes a 64 MB decoded header list into server memory

What a DDoS test measures

A test sends header blocks whose decoded size grows in steps, over a small number of connections, to each component that terminates HTTP/2. It never needs volume. It reads four things at each hop:

  • The limit. The decoded header list size at which the hop refuses the request, and whether that figure was chosen or is a library default.
  • The response. Whether the hop resets the stream, closes the connection, or answers 431 Request Header Fields Too Large, and whether the next request on the same connection still works.
  • The memory. Resident memory per connection just under the limit, multiplied by the connection count the hop allows. That product, not the per-request limit, is the real exposure.
  • The timing of the check. Memory that spikes before the refusal means the limit is checked after decoding, not during it.

A clean result is a refusal at a deliberate limit, with flat memory, at the first hop that decodes. How header-layer vectors like this sit among the other request-layer attacks a test exercises is covered in application-layer DDoS testing.

We use this to reply to you. Privacy policy