Repository navigation
test(fuzz): hostile peer bytes never panic an adapter - #561
Merged
Merged
Conversation
Quest-Claim: 83110d476ac889d5
…str0m Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- rustls: seal only the content types a TLS 1.3 peer seals; rustls refuses type 0 and an inner ChangeCipherSpec, as aws-lc-rs does. - dimpl: compare the five mask bytes both providers fill; aws-lc-rs's ChaCha20 `encrypt_sn` zeroes the rest, and dimpl reads at most two. Deletes the finished quest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated
marked this pull request as ready for review
November 10, 2026 19:15
|
Your OpenCode Go account is out of credit. Top it up, then re-trigger Pullfrog. OpenCode Go's response
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 57 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
…dapters-hostile-input # Conflicts: # admin/testing # quest/m2/confidence/adapters-hostile-input.md # quest/m2/confidence/rustls-provider-panics.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Claims quest/m2/confidence/adapters-hostile-input.md.
Summary
Three fuzz targets, one per adapter, feed each one what a network peer controls. Each answer is compared with the upstream's own aws-lc-rs provider:
fuzz::rustls: TLS 1.2 and 1.3 records, QUIC packets and header protection, key shares for every group (hybrids and ML-KEM included, as server and as client), session tickets, and signature verification for every algorithm. It also runs whole handshakes between a rind client and a rind server (TLS 1.2 or 1.3, any suite and group, five key types, optional client auth), with the bytes of each flight edited in flight.fuzz::dimpl: DTLS 1.2 and 1.3 records, record-number masks, key shares, andverify_signatureon the peer's certificate. It also runs whole DTLS 1.2 and 1.3 handshakes between two rind endpoints, with each packet edited in flight.fuzz::str0m: AES-CM, AES-128-GCM and AES-256-GCM decryption, called in the shapes str0m'sunprotect_rtpandunprotect_rtcpuse, plus the HMAC-SHA1 that covers SRTP.A failed open must leave each byte of the caller's buffer either as the peer sent it or zero. A panic, a hang, or an answer that differs from aws-lc-rs's fails the run.
fuzz.ymlpicks the targets up fromcargo fuzz list, so they run nightly and replay on every tier.TESTING.md gets an Adapters section, and
admin/testingaccepts the targets it names.Public API and wire impact: none. This touches only the unpublished fuzz crate, docs and
admin/testing.Choices made without asking
AeadKeyoutside its key schedule, so TLS records are fuzzed directly under the 32-byte suites. The AES-128 suites share the same decrypters and are reached through QUIC's derived keys and the handshakes. Lengths only a direct trait caller could pass, such as a mis-sized key, are left out and the targets say so.str0mcalls the cipher traits the way that code does. Key derivation (srtp_aes_*_ecb_round) reads no peer bytes, so it is left out.RUSTC_BOOTSTRAP=1on the stable dev-shell toolchain, since the flake has no nightly. CI uses nightly as before.Interactions
default_provider()infallible in rind-dimpl and rind-str0m. Whichever PR merges second drops two.unwrap()calls infuzz/fuzzer/dimpl.rsandfuzz/fuzzer/str0m.rs.admin/testingnow checks main's Zeroing column alongside the adapters line.Fuzz runs
Built with
cargo fuzz build -Oand run locally:str0mfor 5 minutes (4.4M runs),dimplfor 5 (153k),rustlsfor 10 (292k). None panicked in an adapter. The first runs failed on harness checks that were stricter than the contract. They are narrowed now, and the review added the oversized case:IllegalTlsInnerPlaintext,IllegalMiddleboxChangeCipherSpec), and aws-lc-rs agreed, so the target now seals only Alert, Handshake, and ApplicationData.encrypt_snfor ChaCha20 differs after byte 5. rind returns the whole keystream block, as dimpl's rust_crypto provider does. dimpl's aws-lc-rs provider returns QUIC's 5-byte mask and zero after it. dimpl XORs at most two mask bytes over the sequence number, so the target compares the first five.PeerSentOversizedRecordinstead of opening.The quest file is deleted, and its links in the confidence README and the rustls panic-trace quest are gone.
Models
Size: M
Implementer: Claude Code, claude-opus-5-5, medium effort
Implementer: Claude Code, claude-opus-5-5, medium effort (iterate, M)
🤖 Generated with Claude Code
(Written by Claude Opus 5.5 with medium)
Review
Rewritten by
quest reviewafter each round.01a1c6d9-ff96-7e03-8a95-f4a60b9aa708, round 3The merge preserves the reviewed fuzz targets and correctly combines the adapter coverage checks with main’s testing updates, with no new findings.