Cap'n Proto has Undefined Behavior in constant::Reader and StructSchema
Critical severity
GitHub Reviewed
Published
Jan 28, 2026
to the GitHub Advisory Database
Description
Published to the GitHub Advisory Database
Jan 28, 2026
Reviewed
Jan 28, 2026
The safe API functions
constant::Reader::getandStructSchema::newrely onPointerReader::get_root_unchecked, which can cause undefined behavior (UB) by constructing arbitrary words or schemas.Reader::getStructSchema::newThis vulnerability allows safe Rust code to trigger UB, which violates Rust's safety guarantees.
The issue is resolved in version
0.24.0by making constructor functions unsafe and mark the fields of struct as visible only in the crate.References