Skip to content

v0.4.0 — bound PoW grants (nginx 1.31.7 / 1.30.6)

Choose a tag to compare

@github-actions github-actions released this 18 Oct 06:27
· 25 commits to main since this release

Protocol v2 closes reusable-challenge and cross-context clearance sharing holes, with bounded state shared across nginx workers.

Changes

  • Bind JS challenges to the canonical P-256 client key, client address policy, exact User-Agent and issuing policy/scope. Redemption requires a signature proving possession of that key.
  • Redeem JS and no-JS grants once, atomically across workers. A different valid nonce cannot reuse a spent challenge. One fixed 2 MiB shared zone per nginx instance holds up to 32,768 entries; live entries are never evicted and capacity exhaustion fails closed.
  • Bind clearances to the same client context and authenticated assurance. Easier PoW or no-JS clearances cannot satisfy a stronger PoW policy. Address binding defaults to IPv4 /32 and IPv6 /128; new pow_gate_ipv4_prefix, pow_gate_ipv6_prefix and pow_gate_policy directives control the policy.
  • Limit verification bodies to 8 KiB while streaming, including unknown-length HTTP/2 and HTTP/3 bodies. Bound FCrDNS resolver threads, queued work and cached verdicts. Keep verifier and replay-zone references tied to the active nginx configuration cycle so failed reloads do not affect respawned workers.
  • Add HTTP/3 tests over real TLS/QUIC alongside HTTP/1.1 and HTTP/2: concurrent streams and separate connections across four workers, key/context/policy binding, request proofs, no-JS reuse, and rejection of oversized bodies before stream completion.
  • Build both pinned nginx channels: mainline 1.31.7 and stable 1.30.6, for glibc/musl on amd64/arm64. The updater tracks each channel independently.

Upgrade

Breaking change: protocol-v1 clients and cookies are rejected. Deploy the module and embedded solver together with a full nginx process/container restart; existing visitors will solve again. Install the .so atomically rather than overwriting a mapped library. Custom challenge pages with hardcoded solver URLs need cache versioning or a cache purge.

Ordinary subsequent configuration reloads preserve the shared replay state. A full restart creates a fresh issuer and invalidates older tokens. Independent proxy instances currently have independent issuers and require sticky routing; the Redis cluster backend is a design proposal, not an implemented feature.

Navigation cookies remain bearer credentials within their allowed address/UA context. PoW does not impose a request-rate budget. The complete regular-traffic limits example starts in dry-run mode and needs tuning before enforcement.

Validation and performance

63 core tests, two updater regression tests, native builds and HTTP/1.1, HTTP/2, HTTP/3 and reload suites passed on both nginx versions. The HTTP/3 races reached all four workers with exactly one successful redemption; 8,192-byte verification bodies passed and 8,193 bytes was rejected before FIN without consuming the challenge.

The local bound-cookie comparison measured 51.4k versus 59.4k requests/second for v0.3.0, with p50 latency of 142 versus 123 microseconds: approximately 13.5% lower throughput for the additional context authentication. These short loopback measurements are not production capacity estimates. See the security review and performance methodology.

The full CI matrix also passed on both nginx channels, glibc/musl and amd64/arm64, including HTTP/3 end-to-end tests and failed-reload regression tests.

Artifacts

Choose the exact nginx version, libc and architecture used by your runtime.

Module nginx libc arch
ngx_http_pow_gate_module-0.4.0-nginx1.31.7-glibc-amd64.so mainline 1.31.7 glibc amd64
ngx_http_pow_gate_module-0.4.0-nginx1.31.7-glibc-arm64.so mainline 1.31.7 glibc arm64
ngx_http_pow_gate_module-0.4.0-nginx1.31.7-musl-amd64.so mainline 1.31.7 musl amd64
ngx_http_pow_gate_module-0.4.0-nginx1.31.7-musl-arm64.so mainline 1.31.7 musl arm64
ngx_http_pow_gate_module-0.4.0-nginx1.30.6-glibc-amd64.so stable 1.30.6 glibc amd64
ngx_http_pow_gate_module-0.4.0-nginx1.30.6-glibc-arm64.so stable 1.30.6 glibc arm64
ngx_http_pow_gate_module-0.4.0-nginx1.30.6-musl-amd64.so stable 1.30.6 musl amd64
ngx_http_pow_gate_module-0.4.0-nginx1.30.6-musl-arm64.so stable 1.30.6 musl arm64

Each .so includes a .sig signature and .pem signing certificate. SHA256SUMS covers all eight modules. Release builds are published only when two independent builds of every module are byte-identical; the workflow also attaches GitHub build-provenance attestations.

Verify

Download your module, its .sig and .pem, and SHA256SUMS, then run:

module=ngx_http_pow_gate_module-0.4.0-nginx1.31.7-glibc-amd64.so
sha256sum -c --ignore-missing SHA256SUMS
gh attestation verify "$module" --repo teian/ngx_http_pow_gate
cosign verify-blob \
  --certificate "$module.pem" \
  --signature "$module.sig" \
  --certificate-identity 'https://github.com/teian/ngx_http_pow_gate/.github/workflows/release.yml@refs/tags/v0.4.0' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com \
  "$module"