Skip to content

Test infra: chaos / CVE attack suite + scheduler-seed nightly #43

Closed

Description

@EdmondDantes

Final slice of the test-infra expansion (after #39 CI, #41 conformance). No Gherkin generator — for a pure HTTP server, chaos = concrete attack frame-sequences (each CVE is deterministic) + scheduler fuzzing + parser fuzzing. We already have the right primitives; this slice wires them into a security-focused suite.

Already in place (reused, not rebuilt)

  • libFuzzer harnesses — fuzz/fuzz_http1_parser, fuzz_h2_session, fuzz_multipart + h2o corpora. In CI (fuzz-smoke, fuzz-embedded).
  • H2TestClient (tests/phpt/server/h2/_h2_client.inc) — raw H2 frame crafting (HEADERS/DATA/RST/SETTINGS/WINDOW_UPDATE/readFrame/collectResponse).
  • Attack/negative .phpt — HTTP smuggling (CL-TE, dup-CL), obs-fold, admission-reject (h1+h2), peer-reset (h2/007,008).
  • TRUE_ASYNC_SCHED=random:N — scheduler-interleaving fuzz knob.
  • h2spec nightly (Conformance suites: h2spec + testssl + h2load nightly (slice 2 of #41) #42) — RFC negative cases.

Plan (no framework — hand-written, debuggable)

  1. Extend H2TestClient with the frame senders the CVEs need: CONTINUATION, PING, raw arbitrary frame, and small flood helpers.
  2. CVE / attack chaos .phpt under tests/chaos/ (each asserts the server survives + emits the right GOAWAY/RST + telemetry, and the next request still works):
    • CVE-2023-44487 rapid reset — open-then-RST burst.
    • CVE-2024-27316 CONTINUATION flood.
    • HPACK bomb — zip-bomb-like dynamic-table.
    • nghttp2 family (CVE-2019-9511..9518): PING flood, 0-length headers leak, data dribble, settings flood.
  3. Nightly chaos.yml — run the full phpt suite under a TRUE_ASYNC_SCHED=random:N seed matrix (scheduler chaos, zero new test code) + an extended-budget libFuzzer pass.
  4. Topics h2_framing (random HEADERS/DATA/CONTINUATION/RST/SETTINGS ordering) and h1_pipeline (N requests, random sizes / keep-alive / mid-stream close) as chaos .phpt.
  5. Transport chaos — EvilPeer (pure-PHP declarative toxics, PR-CI) + optional Toxiproxy nightly (chaos-io.yml, opt-in via --SKIPIF-- probe).
  6. HTTP Garden corpus replay — feed its request-smuggling corpus into the libFuzzer http1 corpus (differential against llhttp + H1↔H2 normalization).

Acceptance

  • H2TestClient gains CONTINUATION / PING / raw-frame senders
  • tests/chaos/ CVE suite: rapid reset, CONTINUATION flood, HPACK bomb, PING flood (each: server survives + correct GOAWAY/telemetry + next request OK)
  • Nightly chaos.yml: phpt suite × TRUE_ASYNC_SCHED seed matrix + extended libFuzzer budget
  • h2_framing + h1_pipeline chaos scenarios
  • Transport chaos: EvilPeer (PR-CI) + Toxiproxy nightly
  • HTTP Garden corpus folded into the http1 fuzz corpus

Explicitly dropped

  • Gherkin .feature → .phpt generator (the ext/async fuzzy-tests model). Justified there by the combinatorial coroutine×channel interleaving space; for HTTP attack sequences a hand-written .phpt is clearer and more debuggable.

Prior slices

Activity

  1. changed the title [-]Test infra: chaos/fuzz harness (ext/async fuzzy-tests model)[/-] [+]Test infra: chaos / CVE attack suite + scheduler-seed nightly[/+] on May 29, 2026
  2. self-assigned this
    on May 29, 2026
  3. added this to the Next milestone on May 29, 2026
  4. EdmondDantes commented on May 29, 2026

    @EdmondDantes
    ContributorAuthor

    scheduler-chaos findings (informational, to triage)

    First run of the TRUE_ASYNC_SCHED=random:N matrix surfaced 5 phpt failing on every seed (1/7/42/1337) — consistent ordering-sensitivity, not random races:

    • core/020-builtin-worker-pool, core/021-bootloader, core/044-worker-pool-bound-handler, static/004-static-workers — the [true-async-server] worker thread exited cleanly stderr log lands (via run-tests 2>&1) at a nondeterministic position; under the fuzz scheduler it precedes got_responses, which the %A-at-end EXPECT doesn't cover. Worth confirming whether a worker genuinely exits early under reordered scheduling (potential real fuzz-exposed worker-pool ordering bug) vs benign log noise.
    • compression/060-h1-request-malformed — concurrent malformed-body responses arrive in scheduler-dependent order; the --EXPECT-- assumes a fixed order.

    Job is informational (warnings + artifact, non-gating) until these are made scheduler-order-independent or the worker-exit is confirmed benign. Then flip to gating.

  5. added a commit that references this issue on May 29, 2026
  6. added a commit that references this issue on May 29, 2026
  7. EdmondDantes commented on May 29, 2026

    @EdmondDantes
    ContributorAuthor

    Remaining test-infra follow-ups consolidated into #48; real RFC validation gaps into #47.

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