Kludex / Kludex/zttp

HTTP/3 client does not authenticate server certificates

Open
#144 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Zig
Stars
55
Forks
2
Avg merge
9h 52m
Merged PRs (30d)
69

Description

The HTTP/3/QUIC TLS 1.3 client completes the handshake but performs no server authentication. In `src/core/quic/tls/client.zig` `onServerFlight()` extracts the public key from the first certificate and verifies the `CertificateVerify` signature with that same key - there is no check that the certificate:

- chains to a trusted root / is signed by a trusted issuer,
- is within its validity period,
- has appropriate key usage / basic constraints,
- has a SAN (or CN) matching `server_name` (which today feeds SNI only).

As a result any active on-path attacker can present a self-signed certificate and complete the handshake as the target server, then read and modify HTTP/3 traffic. This is a MITM gap for the client over untrusted networks.

Found in a security review. The transport is documented as experimental, but the missing client authentication was not disclosed; a docs warning is going up as an interim measure (see the docs PR).

The real fix is a feature: accept a trust store / CA bundle (and optionally a verifier callback) in the client config, and perform X.509 chain validation + hostname (SAN) verification in `onServerFlight` before trusting the extracted key. Tracking that work here.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in src/core/quic/tls/client.zig, especially onServerFlight(), and trace how the client config and server_name are used during the handshake. Define how a trust store or CA bundle and optional verifier callback should be supplied, then ensure certificate-chain, validity, key-usage, basic-constraints, and hostname checks occur before trusting the extracted key.

Written by the indexing model from the issue text.

Assessment

Tech stack
zig
Domain
networking, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.