The bug class goes, the callers stay.

A large share of serious vulnerabilities in C libraries are memory-safety bugs: out-of-bounds reads and writes, use-after-free, null dereferences, integer overflows feeding allocations. Rust removes that class by construction, but rewriting every consumer is not realistic. So we build clean-room Rust implementations that export the original library’s C ABI, and existing binaries link against them without source changes.

Open source, with the status stated plainly.

Functional

cjson-rs

Replaces cJSON · MIT

A clean-room Rust JSON parser with a drop-in libcjson C ABI. Existing C and C++ consumers relink and keep working.

  • 78 of 78 cJSON.h functions implemented
  • 100% pass on the public-API subset of upstream’s test suite
  • forbid(unsafe_code) core; Miri-clean FFI shim
  • Fuzzed with libFuzzer and AddressSanitizer, ~4.5M iterations, no crashes
github.com/Gordion-Solutions/cjson-rs
Early development

expat-rs

Replaces libexpat · MIT

A clean-room XML 1.0 parser built from the W3C specification, aiming for libexpat’s conformance without its memory-safety bugs. libexpat sits under CPython, Apache httpd, D-Bus and fontconfig.

  • Tokeniser, well-formedness checker and bounded entity expansion shipped
  • Billion-laughs and quadratic-blowup defences, with tests
  • W3C conformance: 94% acceptance on well-formed input; 51% of the full suite while DTDs, namespaces and encoding detection are built
  • C ABI shim on the roadmap
github.com/Gordion-Solutions/expat-rs
Released · v0.2

Floyd

MC/DC coverage for Rust · Apache-2.0

An open-source MC/DC engine for Rust. It recovers decisions from compiler MIR and reports which conditions the test suite independently exercises, under masking MC/DC.

  • cargo install cargo-floyd, then cargo floyd test
  • Text, JSON and JUnit output for CI
  • Declines shapes it does not recognise rather than guessing
  • Ground-truth corpus pinned in the repository
github.com/Gordion-Solutions/Floyd

Other C libraries by request. If a C dependency sits on your attack surface and you would rather replace it than keep patching it, tell us which one.

Floyd: proving the tests test the logic.

Rewriting in Rust removes a class of bugs. It does not prove the new code behaves. Safety-critical standards ask for evidence that every condition in every decision has been shown to affect the outcome on its own: modified condition/decision coverage.

MC/DC is the structural coverage criterion for ISO 26262 ASIL D in automotive and DO-178C Level A in avionics. Rust has lacked an open tool for it. Floyd is that tool: open source for adoption, with a commercial qualification offering built on top for teams that need tool-qualification evidence.

$ cargo floyd test
Tests discovered: 4
Conditions:       channel_a_ok, channel_b_ok, master_enable

Per-condition MC/DC status:
  ✓ master_enable: EXERCISED
  ✓ channel_a_ok:  EXERCISED
  ✓ channel_b_ok:  EXERCISED

MC/DC coverage: 3 of 3 conditions exercised (100%)

Assess, convert, verify, hand over.

  1. Assess

    Map the C dependency, its consumers and its CVE history. Decide whether a drop-in replacement, a safe wrapper or a staged rewrite is the right call. Sometimes the answer is to leave it.

  2. Convert

    Clean-room Rust implementation behind the existing C ABI, so consumers relink rather than rewrite. Unsafe code confined to a thin, audited FFI layer.

  3. Verify

    Upstream test suites, specification conformance suites, differential fuzzing against the original, Miri on the FFI boundary, and MC/DC coverage with Floyd where the standard requires it.

  4. Hand over

    Your team owns the code, the tests and the evidence. Documentation written for the engineers who maintain it and the assessors who audit it.

A C library you would rather not keep patching?

Tell us what it is and where it runs. We will tell you whether replacing it is worth it.

Start a conversation