Subject
quinn-proto 0.11.14 is the sans-I/O state machine for the QUIC transport protocol (RFC 9000). It implements packet parsing and encoding, the connection state machine (handshake through close), stream multiplexing with flow control, congestion control (New Reno and BBR), path migration, MTU discovery, retry and validation token handling, and QUIC datagram frames. Cryptographic operations are fully delegated to pluggable backends: rustls (backed by ring or aws-lc-rs), with raw interfaces (crypto::PacketKey, crypto::HeaderKey, crypto::HandshakeTokenKey) available for alternative implementations. The crate has no I/O; callers supply timestamps, network events, and buffers and receive outgoing datagrams and application events in return. It targets RFC 9000 (QUIC) and RFC 9001 (QUIC-TLS).
Methodology
The published crate contents were compared against the upstream Git repository at the commit recorded in .cargo_vcs_info.json using diff -rq. All unsafe blocks were located with grep -rEn '\bunsafe\s*(\{|fn|impl|trait)'. The following source files were read in full: src/lib.rs, src/varint.rs, src/packet.rs, src/frame.rs, src/token.rs, src/constant_time.rs, src/endpoint.rs (first 600 lines), src/connection/paths.rs (first 200 lines), src/connection/send_buffer.rs, and src/connection/streams/state.rs (stream limit sections). Additional sections of src/connection/mod.rs were read around the anti-amplification logic (lines 580-590, 1110-1140, 3250-3270). The frame parser (frame::Iter and scan_ack_blocks) was read in full. The fuzz target directory in the VCS root was confirmed. The dependency list from Cargo.toml was reviewed against the extracted dependencies.json. Source surveys were run for network access, filesystem access, process execution, environment variable access, FFI, and concurrency patterns.
Results
The diff -rq comparison shows only the expected Cargo.toml normalisation difference; all source files are byte-for-byte identical between the published crate and VCS. No binary artifacts are present, justifying has-binaries. There is no build.rs and the library is not a proc macro, so has-build-exec and has-install-exec are false. The crate ships no install hooks, so has-install-exec is false. 250 #[test] annotations were found in src/, justifying has-unit-tests. The crate has no integration test directory, so has-integration-tests is false, and no property tests were found, so has-property-tests is false. Fuzz targets (packet.rs, params.rs, streamid.rs, streams.rs) exist in the VCS root at fuzz/fuzz_targets/, justifying has-fuzz-tests.
The codebase contains exactly five unsafe blocks, all calling VarInt::from_u64_unchecked. The VarInt type requires its inner value to be less than 2^62. The call sites are: converting a StreamId to VarInt (invariant holds because stream IDs are limited to MAX_STREAM_COUNT = 1 << 60); two calls in send_buffer.rs sizing a retransmit offset and the unsent pointer (stream offsets are flow-controlled and bounded well within the VarInt range); and one in connection/mod.rs for a CRYPTO frame offset (bounded by TLS record sizes). The invariants are sound but none of the call sites carries a // SAFETY: comment, producing one low-severity finding (FINDING-1). The unsafe is confined to a single function and represents minimal surface. This justifies uses-unsafe, unsafe-safe, unsafe-minimal; the absence of safety comments justifies unsafe-documented. The crate does not submit unsafe blocks to Miri or sanitizers as part of its CI, so unsafe-tested is false.
The anti-amplification limit is implemented in PathData::anti_amplification_blocked, which returns true when the path is not validated and total_recvd * 3 < total_sent + bytes_to_send. The check is applied before each batch of outgoing datagrams. total_recvd is updated with saturating_add after each incoming datagram. This correctly enforces RFC 9000 §8.1. The crate implements the QUIC protocol (impl-protocol) and does not implement cryptography (impl-crypto), interpreters (impl-interpreter), JIT (impl-jit), standalone data structures (impl-datastructure), or standalone algorithms (impl-algorithm). Concurrency primitives are not implemented; the Arc usage is for shared configuration only (impl-concurrency).
Retry and validation tokens are AEAD-encrypted with per-token HkDF-derived keys and include an expiry check and source-address binding; replay prevention is delegated to the pluggable TokenLog interface (with a bloom-filter implementation available as BloomTokenLog). This justifies uses-crypto and crypto-safe. The crate uses no JIT (uses-jit) or interpreter (uses-interpreter).
The frame parser (frame::Iter) validates all length fields before slicing. ACK block decoding uses checked_sub throughout scan_ack_blocks to prevent underflow on malformed input. Empty payloads are rejected. Stream limit enforcement (validate_receive_id) correctly applies max_remote bounds and returns STREAM_LIMIT_ERROR for out-of-bounds peer stream IDs. The frame parser and packet header decoder implement a parser (impl-parser), justifying parser-impl-safe and parser-impl-tested. The packet header encoding test in src/packet.rs validates round-trip against a known byte sequence, providing a reference vector check. Spec conformance against the full RFC 9000 test suite was not evaluated in this audit, so parser-impl-correct and protocol-impl-correct were not asserted. The protocol implementation is covered by 250 unit tests and four fuzz targets (protocol-impl-tested).
The codebase uses no network sockets (uses-network), no filesystem operations (uses-filesystem), no process execution (uses-exec), and no environment variables (uses-environment). The Arc usage for shared configuration objects qualifies as concurrency usage (uses-concurrency); Endpoint and Connection use &mut self APIs. The API design inherently documents the single-driver concurrency contract, justifying concurrency-safe and concurrency-documented. No obfuscated code, base64 blobs, or suspicious network endpoints were found, justifying is-benign.
One low-severity finding was identified (FINDING-1): the five unsafe blocks lack // SAFETY: comments. No correctness, security, or other safety findings were identified.
Conclusion
The audit found one low-severity quality finding (FINDING-1): missing // SAFETY: comments on all five unsafe call sites. The unsafe blocks themselves are sound: all five call VarInt::from_u64_unchecked with values that are structurally bounded well within the 2^62 limit. The anti-amplification logic, retry/validation token handling, frame parser, and stream-count enforcement were reviewed and appear correct. Crypto operations are delegated to rustls and validated via the crypto::PacketKey/HeaderKey traits. The crate ships four fuzz targets covering packet parsing, transport parameters, stream IDs, and streams, providing meaningful coverage of the untrusted-input surface.