mirror of
https://github.com/jmcorgan/fips.git
synced 2026-07-30 19:46:15 +00:00
A malformed FilterAnnounce whose fill ratio produces an implausibly high false-positive rate is mostly useless for routing and, once merged into our outgoing filter via bitwise OR, propagates the saturated state to tree peers one hop per announce tick. A saturated filter also made estimated_count() return f64::INFINITY, which compute_mesh_size summed into its cached estimate. handle_filter_announce now rejects inbound FilterAnnounce whose derived FPR exceeds `node.bloom.max_inbound_fpr` (new config field, default 0.05 ≈ fill 0.549 at k=5). Rejection is silent on the wire, logs at WARN, and increments a new `bloom.fill_exceeded` counter. The peer's prior stored filter and filter_sequence are left unchanged so a single rejected announce does not wipe the peer's existing contribution to aggregation. After a successful outgoing FilterAnnounce send, a rate-limited WARN fires if our own filter's FPR exceeds the same cap, surfacing aggregation drift. Limited to once per 60 seconds via a new Node.last_self_warn field. BloomFilter::estimated_count() now takes max_fpr and returns Option<f64>. Returns None for saturated filters (regardless of cap) or when the filter's FPR exceeds max_fpr. Callers updated: debug logs render None as "—", the Debug impl uses f64::INFINITY as "no cap" and prints "saturated" instead of inf, control-socket JSON emits null, and compute_mesh_size propagates None into the already- Option<u64> estimated_mesh_size field.
11 KiB
11 KiB
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[Unreleased]
Added
- Linux release artifact workflow: builds x86_64 and aarch64 tarballs
and
.debpackages onv*tag push, with SHA-256 checksums - AUR publish workflow for tagged stable releases
Security
- Bloom filter poisoning defense. Reject inbound FilterAnnounce
messages whose false-positive rate exceeds a configurable cap
(
node.bloom.max_inbound_fpr, default 0.05). Previously a peer running a modified build could send an all-ones filter, causing (1) lookup attraction / black-hole routing for unknown targets, (2) aggregation contamination as the poisoned bits propagated one hop per announce tick via strict-OR merging, and (3) mesh-size estimate blowup tof64::INFINITY. Rejection is silent on the wire; rejected announces log at WARN and increment a newbloom.fill_exceededcounter. The peer's prior accepted filter and sequence number are preserved on rejection so a single bad announce cannot wipe a peer's contribution to aggregation. An independent self-plausibility WARN fires (rate-limited to once per 60s) if our own outgoing filter ever exceeds the cap, surfacing aggregation drift or ingress-check bypasses.BloomFilter::estimated_countnow returnsOption<f64>and returnsNonefor saturated filters, preventingf64::INFINITYfrom propagating into mesh-size estimates. The node-levelestimated_mesh_sizefield (alreadyOption<u64>) propagatesNonewhen any contributing filter is above cap.
Fixed
- Control socket path detection in fipsctl and fipstop now checks for
the
/run/fips/directory instead of the socket file inside it, so users not yet in thefipsgroup get a clear "Permission denied" error instead of a misleading "No such file" fallback to$XDG_RUNTIME_DIR(#30, reported by @Sebastix) - OpenWrt ipk build excluded BLE feature that requires D-Bus, which is unavailable on OpenWrt targets
- IPv6 routing policy rule added at TUN setup to protect
fd00::/8from interception by Tailscale's table 52 default route - Bloom filter routing no longer swallows traffic when no bloom
candidate is strictly closer than the current node.
find_next_hopnow falls through to greedy tree routing in that case instead of returningNoRoute, which previously caused dropped packets in topologies where the tree parent was closer but not a bloom candidate - Auto-connect peers now reconnect after a graceful
Disconnectnotification from the remote side.handle_disconnectpreviously removed the peer without scheduling a reconnect, orphaning the entry on a clean upstream shutdown; the other removal paths (link-dead, decrypt failure, peer restart) already scheduled reconnect (#60, reported by @SwapMarket) fipsctl connectnow rejects FIPS mesh (fd00::/8) addresses forudp,tcp, andethernettransports with a clear error message instead of echoing success while the daemon silently failed the bind withEAFNOSUPPORT(#61, reported by @SwapMarket)- Tighten TreeAnnounce ancestry validation to match the spanning tree specification. The receive path now verifies that the ancestry is structurally consistent with the signed parent declaration before mutating tree state.
[0.2.0] - 2026-03-22
Added
Operator Tooling
fipsctl connectanddisconnectcommands for runtime peer management via control socket, with hostname resolution from/etc/fips/hosts
IPv6 Adapter
- Pre-seed identity cache from configured peer npubs at startup, so TUN packets can be dispatched immediately without waiting for handshake completion (@v0l)
Mesh Peer Transports
- New Tor transport with SOCKS5 and directory-mode onion service for anonymous inbound and outbound peering
- DNS hostname support in peer addresses for UDP and TCP transports
- Non-blocking transport connect for connection-oriented transports (TCP, Tor)
Packaging and Deployment
- Reproducible build infrastructure: Rust toolchain pinning via
rust-toolchain.toml,SOURCE_DATE_EPOCHin CI and packaging scripts, deterministic archive timestamps - Top-level packaging Makefile for unified build across formats
- Kubernetes sidecar deployment example with Nostr relay demo
- Nostr release publishing in OpenWrt package workflow
- SHA-256 hash output in CI build and OpenWrt workflows
Testing and CI
- Maelstrom chaos scenario with dynamic topology mutation and ephemeral node identities via connect/disconnect commands
- Consolidated Docker test harness infrastructure
Changed
- Discovery protocol: replace flooding with bloom-filter-guided tree routing. Includes originator retry (T=0/T=5s/T=10s), exponential backoff after timeouts and bloom misses, and transit-side per-target rate limiting. Removed 257-byte visited bloom filter from LookupRequest wire format. This is a breaking change; nodes running versions prior to this release will not be compatible.
Fixed
- DNS responder returned NXDOMAIN for A queries on valid
.fipsnames, causing resolvers to give up without trying AAAA. Now returns NOERROR with empty answers for non-AAAA queries on resolvable names. (#9, reported by @alopatindev) - Stale end-to-end session left in session table after peer removal blocked session re-establishment on reconnect —
remove_active_peernow cleans upself.sessionsandself.pending_tun_packets. (#5, @v0l) schedule_reconnectreset exponential backoff to zero on each link-dead cycle instead of preserving accumulated retry count. (#5, @v0l)- FMP/FSP rekey dual-initiation race on high-latency links (Tor): both sides' timers fired simultaneously, both msg1s crossed in flight, each side's responder path destroyed the initiator state. Fixed with deterministic tie-breaker (smaller NodeAddr wins as initiator).
- Parent selection SRTT gate bypass:
evaluate_parentused default cost 1.0 for peers filtered out byhas_srtt(), defeating the MMP eligibility gate. Now skips unmeasured candidates when any peer has cost data. - FSP rekey cutover race: initiator cut over before responder received msg3, causing AEAD failures. Fixed by deferring initiator cutover by 2 seconds.
- MMP metric discontinuity after rekey: receiver state carried stale
counters across rekey, inflating reorder counts and jitter. Fixed via
reset_for_rekey(). - Auto-connect peers exhausted
max_retrieson initial connection failures and were permanently abandoned. Now retry indefinitely with exponential backoff capped at 300 seconds. - Control socket permissions: non-root users couldn't connect. Daemon now
chowns socket and directory to
root:fipsgroup at bind time. - Post-rekey jitter spikes: old-session frames arriving via the drain window produced 2,000–7,000ms jitter spikes that corrupted the EWMA estimator. Added a 15-second grace period after rekey cutover that suppresses jitter updates until drain-window frames have flushed. (#10)
- ICMPv6 Packet Too Big source was set to the local FIPS address, which Linux ignores (loopback PTB check). Now uses the original packet's destination so the kernel honors the PMTU update. (#16, @v0l)
- Reverse delivery ratio used lifetime cumulative counters instead of per-interval deltas, making ETX unresponsive to recent loss. (#14)
- MMP delta guards used
prev_rr > 0to detect first report, conflating it with a legitimate zero counter. Replaced withhas_prev_rr. (#14)
[0.1.0] - 2026-03-12
Added (Initial Release)
Session Layer (FSP)
- End-to-end encrypted datagram service between mesh nodes addressed by Nostr npub
- Noise XK sessions with mutual authentication, replay protection, and forward secrecy
- Automatic session rekeying with configurable time/message thresholds and drain window for in-flight packets
- Port multiplexing for multiple services over a single session
- Session-layer metrics: sender/receiver reports with RTT, jitter, delivery ratio, and burst loss tracking
- Passive RTT measurement via spin bit
IPv6 Adapter
- IPv6 adapter interface allowing tunneling TCP/IPv6 through FIPS mesh for traditional IP applications (TUN interface)
- DNS resolver allowing IP applications to reach nodes by npub.fips name
- Host-to-npub static mappings: resolve
hostname.fipsvia host map populated from peer config aliases and/etc/fips/hostsfile
Mesh Layer (FMP)
- Self-organized core mesh routing protocol with adaptive least cost forwarding
- Noise IK hop-by-hop link encryption with mutual authentication and replay protection between peer nodes
- Distributed spanning tree construction with cost-based parent selection and adaptive reconfiguration
- Destination route discovery via bloom filter-based directed search protocol
- Path MTU discovery with per-link MTU tracking and MtuExceeded error signaling
- Link-layer MMP: SRTT, jitter, one-way delay trends, packet loss, and ETX metrics
- Link-layer heartbeat with configurable liveness timeout for dead peer detection
- Epoch-based peer restart detection
- Automatic link rekeying with K-bit epoch coordination and drain window
- Static peer auto-reconnect with exponential backoff
- Multi-address peers with transport priority-based failover
- Msg1 rate limiting for handshake DoS protection
Mesh Peer Transports
- UDP overlay transport with inbound and static outbound peer configuration
- TCP overlay transport with listening port and static outbound peer support
- Ethernet/WiFi transport (MAC address based, no IP stack) with optional automatic peer discovery and auto-connect
Operator Tooling
- Ephemeral or persistent node identity with key file management
- Unix domain control socket for runtime observability
fipsctlCLI tool for control socket interaction and node management- Comprehensive node and transport statistics via control socket
fipstopTUI monitoring tool with real-time session, peer, and transport configuration and metrics display
Packaging and Deployment
- Debian/Ubuntu
.debpackaging via cargo-deb - Systemd service packaging with tarball installer
- OpenWRT package with opkg feed and init script
- Docker sidecar deployment for containerized services
- Build version metadata: git commit hash, dirty flag, and target triple
embedded in all binaries via
--version
Testing and CI
- Comprehensive unit and integration tests covering all protocol layers and transports
- Docker test harness with static and stochastic topologies
- Chaos testing with simulated severe network conditions: latency, packet loss, reordering, and peer churn
- CI with GitHub Actions: x86_64 and aarch64, integration test matrix, nextest JUnit reporting
- Local CI runner script (
testing/ci-local.sh)
Project
- Design documentation suite covering all protocol layers
- CHANGELOG.md following Keep a Changelog format
- Repository mirrored to ngit