Skip to content

HTTP/3: fully fix dirty-list use-after-free (unlink conn on free) #62

Closed

Description

@EdmondDantes

Follow-up to the arm_timer NULL-guard merged in #61 (#59), which mitigates but does not fully eliminate the Phase-1 dirty-list UAF.

Residual

http3_connection_free does not unlink the connection from the listener's dirty list (dirty_head / conn->dirty_next / conn->in_dirty). If a conn is freed while still marked dirty, it dangles on the list. The arm_timer guard catches the common manifestation (OPENSSL_cleanse zeroes ngtcp2_conn → NULL → guard skips), but if the freed slot is reallocated to a new live conn (ngtcp2_conn != NULL) before the next http3_listener_flush_dirty, the guard passes and the walk operates on the wrong conn — a narrow but real UAF window.

Fix

  • Add http3_listener_unmark_flush(l, conn) — unlink conn from dirty_head (walk dirty_next) if in_dirty, clear the flags.
  • Call it in http3_connection_free before teardown.
  • Keep the arm_timer guard as defense-in-depth.

Verify: sustained c=64 crash-stress (the regime that surfaced the original crash) + phpt 25/25.

Activity

  1. self-assigned this
    on May 31, 2026
  2. added a commit that references this issue on May 31, 2026
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

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions