Skip to content

Security: VeaaC/rapidproto

Security

SECURITY.md

Security Policy

Threat model

RapidProto is a decode-only Protobuf library. Its security boundary is the serialized message bytes passed to a generated decoder: those bytes are treated as untrusted. The schema (.proto) is assumed to be trusted: you compile your own schemas, having already passed protoc.

The core guarantee: a generated decoder (arena or streaming) and the runtime must never crash, read or write out of bounds, recurse without bound, or otherwise exhibit undefined behavior on any input bytes, whether well-formed or malformed - malformed input fails with a wire error. The wire reader is fully validating: varint overflow, truncation, length overruns, reserved wire types, and group nesting are all detected and depth-capped.

In scope

  • A crash, hang, out-of-bounds access, unbounded memory or recursion, or any other undefined behavior triggered by feeding untrusted bytes to a generated decoder or the runtime.
  • A way to make a decoder exceed its documented limits (e.g. the nesting-depth cap) unsafely.

Note on memory bounds: the arena model materializes the decoded tree, which can legitimately be larger than the wire bytes; Arena::set_capacity_limit() is the lever that bounds it (a decode that would exceed the cap fails cleanly with OutOfMemory, or ErrorKind::ArenaExhausted in Rust). A way to allocate unboundedly past a configured cap is in scope; unbounded growth with no cap configured is working as documented.

Out of scope

  • Incorrect decoded values for input that was not produced by a conformant Protobuf encoder. RapidProto validates wire structure, not field value semantics; field values are not range-checked (that is the schema's job, which the library trusts). Out-of-range enum values and the like decode without error by design.
  • Issues that require a malicious .proto schema; schemas are trusted input.
  • The benchmarks, tests, and examples.

How this is tested

Memory safety on untrusted input is exercised by libFuzzer harnesses over the wire reader and both decode models, run under AddressSanitizer + UndefinedBehaviorSanitizer (./check.sh deep, which CI runs on every pull request). A fourth harness covers the schema front-end under the same sanitizers: a malformed schema must diagnose, not crash. On the Rust side, a libFuzzer harness runs over generated arena decoders under AddressSanitizer, and the runtime's and the generated code's tests also run under Miri. Rust CI runs both on every pull request.

Reporting a vulnerability

Please report security issues privately via GitHub's private vulnerability reporting: the repository's Security tab → Report a vulnerability. Please do not open a public issue for a suspected vulnerability.

This is an early-stage (0.x) project maintained on a best-effort basis. Only the latest released version is supported.

There aren't any published security advisories