Repository navigation
Security and Trust
Both libraries process untrusted input from the command line, the environment, the network and the peer: TLS records, QUIC packets and frames, HTTP/3 and QPACK, capsules, streams and datagrams. This page states the trust model, what the automated scans cover, and the invariants a change must preserve.
Report vulnerabilities privately through the GitHub security advisory form. Do not open a public issue for a vulnerability. SECURITY.md in the repository states the supported versions and what to include in a report.
| Policy | Swift | C99 CLI | Behaviour |
|---|---|---|---|
| System trust (default) | trustPolicy: .systemTrust |
--trust system |
The certificate chain is validated against the platform trust store and the name is checked against the authority the client was configured with. In Swift that is the configuration's authority rather than the address dialled (WT-261), so a DNS-named certificate reached by address validates, and a name the certificate does not carry is still refused. |
| Development bypass | trustPolicy: .localDevelopmentSelfSigned |
--trust local-development |
Validation is skipped. Refused before connecting when the host is not localhost, 127.0.0.1 or ::1. |
| Pinned certificate |
WebTransportQUICPeerTrustPolicy (library) |
not a CLI value (the tools pass no pin) | A SHA-256 fingerprint pin. In C99 this is WT_TLS_TRUST_PINNED_CERTIFICATE in tls/trust.h. |
The development bypass must be selected explicitly. It is tied to a loopback name by the trust layer itself, so the configuration check and the handshake cannot disagree about the rule. In Swift the accepted names are exactly localhost, 127.0.0.1 and ::1; the C99 parser accepts an address beginning with those strings and refuses anything else with the development bypass is refused for a non-loopback address.
WebTransportServerIdentity supplies the listener's certificate: .developmentSelfSigned, .pkcs12(data:passphrase:), or .certificateChain(chainDER:privateKeyDER:keyKind:). A C99 server describes its identity with --trust system plus its configuration in the runtime API.
- The default development certificate is an ephemeral self-signed certificate for the loopback names, regenerated per construction. It is refused on any non-loopback bind address: a self-signed certificate cannot be validated by any peer for a routable name, so binding one publicly would produce a server that works locally and fails for every real client.
- Undersized RSA keys (below 2048 bits) are rejected.
- Certificate generation fails rather than degrading if the CSPRNG fails.
- A server carries no trust policy for the peer: this draft has no client authentication, and a policy there would be a promise the library cannot keep.
The libraries do not implement application user authentication. Server admission enforces CONNECT authority and path, optional origin, supported subprotocols, required HTTP/3 and WebTransport settings, binding policy, and (in Swift) a concurrent-connection cap and an optional accept-rate limit. WebTransportTransportLimits bounds what a peer can make a server commit before authenticating anything. Refusal happens before the handshake is driven; the rate limit is separate from the concurrency cap on purpose, because a peer that connects and disconnects rapidly never raises the concurrent count while still forcing unbounded handshake work.
Applications remain responsible for their own identity and authorization.
Never commit or emit through public logs and errors:
- credentials, private keys or production certificates;
- TLS secrets or QUIC packet-protection material;
- packet captures containing sensitive data;
- packet bytes or application datagram payloads;
- QUIC connection identifiers or raw WebTransport session identifiers;
- peer-controlled close reason text.
The Swift API provides opt-in sanitized events (WebTransportLogger, WebTransportLogEvent) and redacted public error text (WebTransportErrorSurface.publicDescription(for:)); peer-controlled text in operator output is escaped through WebTransportLogText.escaped(_:). In C99, log.h is a callback surface with no formatted output, because the plan forbids peer data in logs and a printf-shaped surface makes that a rule to remember at every call site. Preserve these guarantees when adding observability.
Interop tools write generated proof material under .build/ or C99/out/; never commit it.
Every pull request and every push to main runs two blocking scans (.github/workflows/security-scan.yml), each with its tool pinned to a version and its download checksummed, so a moved release tag cannot silently change the scanner. A tool that cannot be installed fails its job with the reason printed; nothing passes silently when a scanner is absent.
| Scan | Scope | Waivers |
|---|---|---|
| gitleaks 8.30.1 | Secrets over the full commit history (the checkout uses fetch-depth: 0; a shallow clone would scan one commit and call the history clean). |
Two audited false-positive classes are allowlisted by path and value in .gitleaks.toml: the test-only trust fixtures under C99/tests/vectors/trust/, and one Swift enum label in a test. Anything else fails the job. |
| trivy 0.74.0 | Vulnerable dependencies, secrets, and container/IaC configuration in the tree (.trivy.yaml). vuln and secret are absolute. |
Accepted misconfig findings are listed per file in .trivyignore.yaml: DS-0002 (no non-root USER) and DS-0026 (no HEALTHCHECK) on the six interop TEST Dockerfiles. Those containers run only on a private bridge network, are never published and never shipped, and the exception is scoped by path, so a new Dockerfile is still checked. |
The C99 library links the platform's OpenSSL 3.x (find_package(OpenSSL 3.0 REQUIRED) in C99/CMakeLists.txt). It does not vendor OpenSSL and does not pin it in a lockfile, so a filesystem scan has nothing to inventory and cannot report a CVE against it. The control for that dependency is the platform: the build takes OpenSSL from the operating system's package repositories, so security fixes arrive through the distributor's package updates. Vendoring or pinning OpenSSL must arrive together with a scan that can see it.
The Swift package's dependencies are the Apple frameworks it declares; there are no third-party Swift dependencies.
| Area | Primary concern |
|---|---|
WebTransportNetworkRuntime |
Trust policy, endpoints, timeouts, concurrency, identity resolution and lifecycle. |
WebTransportHTTP3Core |
Peer-controlled parsing, limits, session policy and flow control. |
WebTransportQUICCore |
Wire parsing, transport parameters, packet/frame state and bounds. |
WebTransportTLSCore |
Certificate verification, handshake readiness, keys and exporter state. |
WebTransportCryptoApple |
QUIC key derivation and packet protection. |
WebTransportUDPApple |
Low-level binding and the loopback-only invariant. |
CLI entry points, Swift/*.sh
|
Endpoint and trust arguments, external tools, artifacts and environment input. |
C99/src/{quic,tls,http3,webtransport,api}/ |
The same concerns in the C99 tree; C99/scripts/check-static-analysis.sh and check-cppcheck.sh are the automated second opinion. |
- Keep parser, buffer, stream, datagram and flow-control limits explicit.
- Fail deterministically on malformed input and invalid state transitions.
- Keep real network sessions packet-only unless the architecture deliberately changes.
- Never introduce interactive certificate or keychain prompts.
- Keep development trust modes explicit and loopback-only, and keep the development server certificate refused on non-loopback binds.
- Keep public errors and logs free of peer payloads, secrets and sensitive identifiers.
- Never close an HTTP/3 critical stream. A peer that observes a FIN or STOP_SENDING on the control, QPACK encoder or QPACK decoder stream closes the connection with
H3_CLOSED_CRITICAL_STREAM. - Do not turn a peer-controlled parse failure into a fallback. A malformed input a peer asserted is a protocol violation, not an absent one.
- Add negative tests for rejected trust, malformed input, exhaustion, replay and lifecycle races when those paths change.
- Fuzz any new parser that consumes peer bytes.
Releasing is governed by RELEASE.md and described for operators in Release and Interoperability. The security-relevant rules are that identity is single-sourced and enforced by a failing gate, that the secret and CVE scans must be green on the released revision, and that a check that cannot run is reported not checked rather than assumed.