Skip to content

About

Safe, non-destructive remote check for CVE-2026-123007 (nginx HTTP/2 flow control)

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

h2flowcheck

English | 日本語 | 简体中文

A safe remote check for CVE-2026-123007, the memory-corruption bug in nginx's HTTP/2 flow control.

  • Behavioral. It tests what the server does, so it works when the version is hidden or a fix was backported.
  • Harmless. It does not crash workers or corrupt state, and contains no exploit code.
  • One command. No configuration; one target per run.
Affected nginx 1.9.5 – 1.31.8 with HTTP/2 enabled
Fixed in nginx 1.31.9 (mainline), 1.30.7 (stable)
Advisory nginx security advisories

Only test systems you own or are authorized to test.

Install

You need Go 1.23 or newer.

go install github.com/bytevet/h2flowcheck@latest

The binary lands in $(go env GOPATH)/bin. If that directory is not on your PATH, run it as $(go env GOPATH)/bin/h2flowcheck.

To try it without installing:

go run github.com/bytevet/h2flowcheck@latest https://example.com/

Use

h2flowcheck https://example.com/
Target:   https://example.com/
Verdict:  VULNERABLE (CVE-2026-123007)
Reason:   the server accepted a connection WINDOW_UPDATE of 2^31-1 while it still held unsent DATA; a fixed nginx rejects it with FLOW_CONTROL_ERROR
Server:   nginx/1.31.8 - version is in the affected range 1.9.5-1.31.8
Evidence:
  baseline fill=0    pings + 0       data bytes  marker_ack=true  data_before_marker=1       data_after_marker=0
  control  fill=6000 pings + 0       data bytes  marker_ack=true  data_before_marker=0       data_after_marker=1
  oracle   fill=6000 pings + 0       data bytes  marker_ack=true  data_before_marker=0       data_after_marker=1

More examples:

h2flowcheck example.com:8443                      # https:// is assumed
h2flowcheck https://example.com/static/app.js     # test with a specific resource
h2flowcheck --insecure https://10.0.0.5/          # self-signed certificate
h2flowcheck http://10.0.0.5:8080/                 # cleartext HTTP/2 (prior knowledge)
h2flowcheck --json https://example.com/ | jq .verdict

Verdicts and exit codes

Verdict Exit Meaning
not_vulnerable 0 The server rejected the test frame the way a fixed nginx does.
vulnerable 1 The server accepted a frame that only a vulnerable nginx accepts.
inconclusive 2 The test could not be carried out reliably. Nothing is claimed either way.
not_applicable 3 The endpoint does not speak HTTP/2, so the bug is not reachable there.
(error) 4 Bad arguments, or the target could not be reached.

Use it in a script:

h2flowcheck --json https://example.com/ > report.json
case $? in
  0) echo "ok" ;;
  1) echo "VULNERABLE - upgrade nginx" ;;
  *) echo "needs a closer look" ;;
esac

Options

Flag Default Meaning
--path URL path, or / Resource to request. It must return a body.
--insecure off Skip TLS certificate verification.
--json off Print the report as JSON.
-v off Log each connection's result to stderr.
--timeout 15s Time limit for each network phase.
--settle 2s How long reads stay paused after the test frames are sent. Raise it on slow links.
--max-fill 9000 Most PING frames used to hold server output back.
--max-data 2097152 Most response bytes used to hold output back when PINGs are not enough. 0 disables it.
--rcvbuf 4096 Requested TCP receive buffer in bytes.
--version Print the version and exit.

When the result is inconclusive

inconclusive means the probe refused to guess. The Reason line says why. The usual fixes:

Reason mentions Try
"could not hold the server's output back" Point at a static file of 16 KB or more: h2flowcheck https://host/assets/app.js. This gives the probe more data to work with when a load balancer or proxy sits in front.
"timed out while using up the connection window" The resource returns little or no body, or the link is slow. Use a static file and a longer limit: --timeout 45s.
"responses carry no body" The path is a redirect or empty response. Choose another with --path.

When the behavior cannot be tested and the Server header shows a version in the affected range, the report adds a note saying the server is likely vulnerable by version alone.

How it works

A vulnerable nginx forgets about response data that is queued but not yet written to the network when it checks whether a client's WINDOW_UPDATE is too large. A fixed nginx counts it.

The probe puts the server in exactly that state — send window at zero, one byte queued — and sends one WINDOW_UPDATE of 2^31-1:

  • a vulnerable server accepts it and carries on;
  • a fixed server closes the connection with FLOW_CONTROL_ERROR.

A baseline and a control connection, which differ from the test connection by a single frame, confirm that the server really was in that state. If they cannot, the verdict is inconclusive and the test frame is never sent.

The Server header is reported as supporting evidence only. It never decides the verdict.

Full details: docs/how-it-works.md.

Is it really harmless?

  • The server's window counter ends at exactly 2^31-1, the largest legal value. Memory corruption needs it pushed past 2^63: about four billion more increments, which the public exploit does with roughly 60 GB of traffic. The probe sends one.
  • After a vulnerable server accepts the frame, the probe reads out everything that server had queued before it closes, so no cleanup path sees an unusual state.
  • Load is small: a handful of connections, at most 9,000 PING frames each (nginx's own limit is 10,000), and from under 1 MB up to a few megabytes of downloads.
  • A fixed server logs one info-level line per run: client violated connection flow control.

Every release is tested against real vulnerable and fixed nginx builds, including 50 back-to-back probes during normal traffic, with checks that no worker process died. See the test lab.

Limits

  • You are testing whatever terminates HTTP/2. Behind a CDN, WAF or HTTP load balancer, that is the intermediary, not your origin nginx. Test the origin directly where you can.
  • TCP-level proxies need a larger resource. Behind a layer-4 load balancer, use a static file of 16 KB or more (see above).
  • Dynamic pages are weaker targets. Responses without Content-Length limit the probe to PING fill.
  • One target per run. Loop in your shell for more.
  • Non-unix platforms cannot shrink the receive buffer, which makes inconclusive more likely.

Remediation

Upgrade to nginx 1.31.9 or 1.30.7 or later, or to your distribution's patched package. If you cannot upgrade at once, turning HTTP/2 off (http2 off;) removes the affected code path.

Development

git clone https://github.com/bytevet/h2flowcheck
cd h2flowcheck
go build .            # build
QUICK=1 lab/run.sh    # full test lab in Docker, about 10 minutes

The lab starts real vulnerable and fixed nginx containers on an isolated Docker network. See CONTRIBUTING.md.

Credits

The vulnerability was analyzed publicly by Rapid7; this tool was written from the nginx source change between 1.31.8 and 1.31.9 and shares no code with any exploit.

License

MIT

About

Safe, non-destructive remote check for CVE-2026-123007 (nginx HTTP/2 flow control)

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages