rtci 0.21.1+brainwires.1
Released 2026-11-13.
From CHANGELOG.md of rtci at its release tag.
First Brainwires fork release on upstream 0.21. It merges webrtc-rs/rtc master through 0fbcaa74 (v0.21.1 plus later fixes; the upstream entries follow under "Upstream changes merged") and adds the fork's own hardening. FORK.md lists everything the fork carries over upstream.
Security
- DTLS: handshake fragment reassembly is iterative and bounded (at most 256 fragments per message and 32 buffered messages), so a peer can no longer overflow the stack or grow the buffer without limit. The queue of records awaiting decryption (64) and the handshake cache (64) are bounded.
- DTLS: the default WebRTC cipher suites are AEAD only (AES-128-GCM, ChaCha20-Poly1305). The AES-256-CBC-SHA suites are no longer offered by default. To opt back in, list them explicitly:
rust use dtls::cipher_suite::CipherSuiteId; let setting_engine = SettingEngineBuilder::new() .with_dtls_cipher_suites(vec![ CipherSuiteId::Tls_Ecdhe_Ecdsa_With_Aes_128_Gcm_Sha256, CipherSuiteId::Tls_Ecdhe_Ecdsa_With_Aes_256_Cbc_Sha, CipherSuiteId::Tls_Ecdhe_Rsa_With_Aes_256_Cbc_Sha, ]) .build(); - SRTP/SRTCP: per-SSRC state is created only once a packet authenticates.
- SRTCP (AES-CM/HMAC profiles): a packet with the E flag clear was returned as plaintext without checking its authentication tag, so anyone could inject RTCP (BYE, REMB, ...) with no keys. The tag is now verified first, whatever the E flag says (RFC 3711 §3.4). The AEAD profiles were not affected.
- DTLS: a ChangeCipherSpec is acted on only for the handshake's 0 to 1 epoch transition, before the handshake completes. A spoofed one after the handshake used to move the peer's epoch on, after which every genuine record was dropped as old (a keyless denial of service), and each claimed epoch added a replay detector.
- ICE: once a pair is selected, non-STUN datagrams from any address but its remote are dropped. Role conflicts are handled only for requests that pass MESSAGE-INTEGRITY. Consent freshness is judged on authenticated STUN only. Remote candidates (256) and pending mDNS queries (32) are capped.
- SCTP: FORWARD-TSN processing no longer steps one TSN at a time (a cumulative TSN 2^31 ahead spun for billions of iterations); a SACK acknowledging never-sent DATA is ignored; DATA more than 65535 TSNs past the cumulative TSN, or on a stream id past the negotiated count, is dropped.
- TURN client: STUN messages and ChannelData are accepted only from the configured servers.
- TURN client: a response to an authenticated request (Allocate after the 401 exchange, Refresh, CreatePermission, ChannelBind; success or error) must carry a MESSAGE-INTEGRITY made with the long-term key the request was signed with. One that does not is dropped and the transaction keeps retransmitting. Only 401 and 438 error responses, which servers send unsigned, may lack it (RFC 8489 §9.2.4). A forged LIFETIME=0 Refresh response no longer releases an allocation.
- DCEP: the stack's internal message types 0x00 (threshold) and 0x01 (close) are refused by type when they arrive from the peer, before their body is read.
- ICE: mDNS answers are taken only from the mDNS socket (the one bound to port 5353), not from any datagram whose source port is 5353, which let a sender point a
.localcandidate at an address of its choosing. mDNS-resolved candidates count against the 256-candidate cap. - Data channels: an in-band channel the peer opens on a stream id of this side's parity (even for the DTLS client, odd for the server, RFC 8832 §6) is refused and its stream reset, so the peer cannot take an id this side may assign. Negotiated channels are unaffected.
- Depacketizers: AV1 reassembly across packets is bounded at 4 MiB and appends in place (it copied the whole buffer for every packet, quadratic in the fragment count). VP9 reference indices describe the current packet only (they accumulated, so a long-lived depacketizer failed every flexible-mode packet after the second), and a scalability structure replaces the previous picture-group description instead of appending to it.
- RTP: the header extension block is always consumed whole, so a one-byte block containing ID 15 no longer leaves its remainder at the front of the payload, and an item longer than its block is an error instead of swallowing payload bytes.
Header::marshal_size()now matches the wire, which the SRTP keystream offset depends on; a header that claimed more than the packet made SRTP's AEAD cipher panic splitting it (found by thecontext_decryptfuzz target). - RTCP: Slice Loss Indication is payload-specific feedback (PT 206, RFC 4585 §6.3.2); it was marshalled as, and only parsed from, PT 205, so a received SLI never parsed.
- Media writers: the IVF writer's frame buffer is bounded at 16 MiB and the H.265 writer's FU reassembly at 4 MiB; an H.265 fragment with no start fragment is skipped.
- Malformed peer input is an error instead of a panic: DTLS handshake message_seq exhaustion and a ChangeCipherSpec at the last epoch; SCTP error causes longer than their ABORT/ERROR chunk (reachable on an association's first packet) and TSN arithmetic at the u32 wrap (a peer initial TSN of 0, FORWARD-TSN to u32::MAX, fragmented messages across the wrap, reconfig sequence numbers); a DCEP threshold message without its body (also found by the
data_channel_handle_dcepfuzz target); ICE candidates with a component outside 1..=256 (they underflowed the priority); a remote numeric mid ofisize::MAX(the next local offer overflowed); RTCP FIR / transport-cc length multiplication inu16; the sample builder's drop counters and the OGG writer's granule position on wrapping or reordered timestamps. - NACK responder: each packet is resent at most once per 20 ms however often it is NACKed, and the retransmission queue is bounded.
- Depacketizers: H.264 FU-A reassembly needs a start fragment and is bounded at 4 MiB; a one-byte AV1 OBU claiming an extension header is rejected instead of panicking.
- SDP: the sha-256
a=fingerprintis used when a section lists several (it used to take the first and could reject a valid peer); DTLS verification skips non-sha-256 entries. - Fuzzing CI fails on crashes again (
set -o pipefail), runs with debug assertions and overflow checks, and gains stateful SCTP targets (checksum-fixed packet parsing, a server endpoint and association driven by datagram sequences). - Dependency audit: a new
auditworkflow runscargo generate-lockfileandcargo deny check advisorieson every pull request, twice: on the library's graph (normal and build dependencies, all features), where nothing is ignored, and on the whole workspace. The interop dev-dependency moves fromwebrtc0.14 to 0.17.3, the last release of that independent implementation, whose DTLS usesp2560.14 (crypto-bigint0.7.11, past RUSTSEC-2026-0387) and nobincode(RUSTSEC-2025-0141). The examples' signaling,rtc-signaland thertc-iceping-pong example move fromhyper0.14 tohyper1 (HTTP/1 only), soh20.3 (RUSTSEC-2026-0258) is gone. None of these reached the library's own dependency graph. - Fuzzing: stateful targets that drive the real state machines, deterministically (seeded randomness, a fixed key exchange and certificate, the clock passed in, no sockets): a DTLS handshake to an in-memory peer with records injected before, during and after it — plaintext or encrypted under the peer's keys, so they reach the fragment buffer, the handshake cache, epoch handling and GCM / CCM / ChaCha20 / CBC decryption (
rtc-dtls,conn_handle_records); SRTP/SRTCP decryption with fixed keys, of raw packets and of packets the sender protected (rtc-srtp,context_decrypt); an ICE agent fed authenticated binding requests and responses and non-STUN datagrams in the Checking, Connected and Failed states and across restarts (rtc-ice,agent_handle_inbound); a TURN client fed server responses, Data indications and ChannelData (rtc-turn,client_handle_inbound); the data-channel handler fed DCEP and user messages (rtc,data_channel_handle_dcep); and the H.264, H.265, VP8, VP9, AV1 and Opus depacketizers fed payload sequences (rtc-rtp,depacketize_sequence). All run in the fuzz workflow and OSS-Fuzz.
Fork features kept across the sync
- TWCC GCC interceptor with
GccHandle(beside upstream's GCC), the adaptive jitter buffer (AdaptiveJitterBuffer*),rtc-interceptor-deriveandInterceptor::with, DTLS restart on ICE restart (now only when the remote fingerprint or DTLS role changes), RRID association for RTX simulcast, rejected m-lines in answers,RTCConfigurationserde, RTP marshal bounds checks, TURN accessors and the TCP TURN example (now with TURN stream framing).
Upstream removals not taken
- ULPFEC stays in the default codecs;
write_rtpkeeps its payload-type fallback and passes un-negotiated header extensions through; a Relay policy without a TURN URL is accepted with a warning; theopenssl/vendored-openssl/pemfeatures andRTCCertificate::from_key_pairare kept.
Breaking changes (upstream replacements taken, no shims)
| Removed | Use instead |
|---|---|
dtls::crypto::CryptoPrivateKeyKind and CryptoPrivateKey::{kind, serialized_der} | CryptoPrivateKey::signing_key (Arc<dyn crypto::SigningKey>); export with SigningKey::to_pkcs8_der() |
KeyingMaterialExporter trait | the inherent dtls::state::State::export_keying_material |
srtp extract_session_keys_from_dtls | set_session_keys_from_keying_material |
MessageIntegrity::default() (an empty key) | MessageIntegrity::new_short_term_integrity_with_provider / new_long_term_integrity_with_provider / new_raw_integrity_with_provider |
FnTimeGen / the packetizer's time_gen | pass the time: new_packetizer(now, …), packetize(now, …) |
rtc_interceptor::Packet as the chain's message type | AttributedPacket { attributes, packet: Packet } (TaggedPacket now carries it; match on msg.message.packet) |
SettingEngine::set_* setters | SettingEngineBuilder::new().with_*(…).build() (every former setter has a with_*) |
Fixed
test_ice_restart_by_rtc_interopis no longer ignored and passes, withtest_ice_restart_interop: the DTLS session is kept across an ICE restart that changes nothing DTLS depends on.- The release workflow finds
cliff.toml. The GCC docs cite draft-ietf-rmcat-gcc-02, not RFC 8698.