Tor directory data is decompressed by C code #254

Open
opened 2026-10-02 19:03:40 -04:00 by Salastil · 0 comments
Owner

From a memory-safety audit of nobilis on 2 October 2026: its own code has two unsafe blocks (both sound libc calls in main.rs), so what follows is about the code it depends on. Advisories were checked against the OSV/RustSec database for every crate in Cargo.lock, and each one traced to whether it is actually compiled in.

arti is built with its compression feature (Cargo.toml), which decompresses directory documents from Tor relays with zstd and xz - both C (zstd-sys 1.5.7, liblzma-sys). That data comes from the Tor network, not from a party moho trusts.

Both are mature and heavily fuzzed, and the documents are signed - but signatures are checked after decompression, so the decompressor sees unauthenticated input. Options:

  • drop the compression feature: directories download uncompressed (more bandwidth on a cold bootstrap, nothing else), and two C libraries leave the build;
  • or keep it and track both libraries' versions.

Related, while there: the build carries two crypto providers, ring (rustls, nobilis) and aws-lc-rs (pulled in through arti's rustls) - both partly C and assembly. Settling on one halves that surface.

From a memory-safety audit of nobilis on 2 October 2026: its own code has two `unsafe` blocks (both sound libc calls in `main.rs`), so what follows is about the code it depends on. Advisories were checked against the OSV/RustSec database for every crate in `Cargo.lock`, and each one traced to whether it is actually compiled in. arti is built with its `compression` feature (`Cargo.toml`), which decompresses directory documents from Tor relays with **zstd** and **xz** - both C (`zstd-sys` 1.5.7, `liblzma-sys`). That data comes from the Tor network, not from a party moho trusts. Both are mature and heavily fuzzed, and the documents are signed - but signatures are checked after decompression, so the decompressor sees unauthenticated input. Options: - drop the `compression` feature: directories download uncompressed (more bandwidth on a cold bootstrap, nothing else), and two C libraries leave the build; - or keep it and track both libraries' versions. Related, while there: the build carries two crypto providers, `ring` (rustls, nobilis) and `aws-lc-rs` (pulled in through arti's rustls) - both partly C and assembly. Settling on one halves that surface.
Salastil added this to the v1.0 milestone 2026-10-02 19:03:40 -04:00
Salastil added the buglow priorityCVE labels 2026-10-02 19:03:40 -04:00
Salastil removed this from the v1.0 milestone 2026-10-03 21:28:17 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Salastil/moho#254