Skip to content

Test infra: external conformance suites + chaos/fuzz harness #41

Closed

Description

@EdmondDantes

Follow-up to #39. The Windows/macOS CI slice shipped in #40 (merged); this issue tracks the two remaining slices.

1. External conformance test suites

Wire into a separate nightly workflow (does not gate PRs):

  • h2spec (summerwind/h2spec) — RFC 7540 + RFC 7541, ~150 cases. Run against a worker on :8443 (TLS) and :8080 (h2c). JSON artifact.
  • testssl.sh — TLS cipher suites, ROBOT/DROWN/Heartbleed/Logjam. JSON artifact.
  • tlsfuzzer — TLS 1.0–1.3 RFC conformance + fuzz, vector scripts (ROBOT/padding/HRR).
  • h2load — already used by hand; pin a minimal smoke in CI (RPS regression alarm — trend only, not a hard gate).

Bring the server up via a minimal HttpArena/entry.php profile, the same way tests/e2e/ does.

2. Chaos / fuzz harness

Fully modeled on php-src/ext/async/fuzzy-tests/. We already have tests/fuzz/ (libFuzzer-style), but that's different — the chaos harness sits above the protocol, not at the parser.

Architecture (from ext/async/fuzzy-tests/README.md)

  • Gherkin .feature → generator → _generated/<topic>/*.phpt
  • Two fuzz-seed axes: CHAOS_GEN_SEED (value fuzz) and TRUE_ASYNC_SCHED=random:N (scheduler fuzz)
  • Mutation blocks: One of: / Any of: for scenario combinations
  • Freeze: a caught fail → moved into _frozen/ with both seeds pinned, committed as a regression
  • Chaos event log: on fail print a reproducible record (toxic params + I/O trace)

Topics (HTTP-server-specific)

Topic What we fuzz
h1_pipeline pipeline of N requests, random sizes / keep-alive / mid-stream Connection: close
h2_framing random ordering of HEADERS/DATA/CONTINUATION/RST/SETTINGS
h2_rapid_reset CVE-2023-44487 — open-then-RST stream, vary cadence
h2_continuation_flood CVE-2024-27316
hpack dynamic-table edge cases, never-indexed, huffman
tls_handshake abort mid-ClientHello/EE/Finished, renegotiation
streaming_body large bodies, slow chunks, mid-stream EOF
static_cache concurrent GET on a single entry, eviction, OOM
concurrency worker × pool sizing × coroutine cancel (our domain)

Transport chaos (third axis)

From nightly-io-chaos.yml — Toxiproxy (Shopify) as the external transport-fault injector: bandwidth throttling, latency+jitter, TCP segment slicing, byte-counted truncation, abrupt mid-stream close. Opt-in nightly job on :8474; a --SKIPIF-- probe skips wherever Toxiproxy isn't answering.

EvilPeer (no external deps)

Pure-PHP misbehaving peer (_peers/EvilPeer.php from ext/async) — toxics driven by a declarative table, seeded by CHAOS_GEN_SEED. Covers the same surface as Toxiproxy, no binary needed — runs in PR CI.

CVE playlist (ready-made PoCs)

Adapt public exploits into .feature scenarios:

  • CVE-2023-44487 Rapid Reset
  • CVE-2024-27316 CONTINUATION flood
  • CVE-2019-9511..9518 (nghttp2 family: Data Dribble, Ping Flood, 0-Length Headers Leak, etc.)
  • HPACK bomb (zip-bomb-like dynamic-table)
  • HTTP request smuggling differentials from HTTP Garden (arxiv 2405.17737) — corpus replay against our llhttp + H1↔H2 header normalization

Acceptance

  • Nightly conformance.yml: h2spec passes (or whitelists known fails), testssl.sh JSON artifact
  • tests/chaos/ with the ext/async/fuzzy-tests layout (_harness/, _generated/, _frozen/, _peers/)
  • At least 3 topics covered by .feature scenarios: h2_framing, h2_rapid_reset, h1_pipeline
  • Nightly chaos-io.yml with Toxiproxy for transport chaos
  • freeze.php works: nightly fail → manual freeze → commit to _frozen/ → stable regression

Activity

  1. self-assigned this
    on May 29, 2026
  2. added this to the Next2 milestone on May 29, 2026
  3. added a commit that references this issue on May 29, 2026
  4. EdmondDantes commented on May 29, 2026

    @EdmondDantes
    ContributorAuthor

    Slice 2 (conformance) shipped in #42 (merged):

    • h2spec nightly — 146 tests, 0 failed
    • testssl.sh — 0 HIGH/CRITICAL
    • h2load robustness smoke — 0 errored

    Remaining: tlsfuzzer (deferred) + slice 3 chaos/fuzz harness. Continuing with slice 3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions