capnp
Affected
- introduced
0.0.0-0, fixed0.24.0(semver)
Fixed versions
0.24.0
Fix
- Fixed version
0.24.0cargo update -p capnp --precise 0.24.0
Advisory
Also known as: GHSA-5w5r-mf82-595p
Unsound APIs of public constant::Reader and StructSchema
The safe API functions constant::Reader::get and StructSchema::new rely on PointerReader::get_root_unchecked, which can cause undefined behavior (UB) by constructing arbitrary words or schemas.
Reader::get
pub fn get(&self) -> Result<<T as Owned>::Reader<'static>> {
// ...
// UNSAFE: access `words` without validation
}
StructSchema::new
pub fn new(builder: RawBrandedStructSchema) -> StructSchema {
// ...
// UNSAFE: access encoded nodes without validation
}
This vulnerability allows safe Rust code to trigger UB, which violates Rust's safety guarantees.
The issue is resolved in version 0.24.0 by making constructor functions unsafe and mark the fields of struct as visible only in the crate.
Not rated by the source.
0.0.0-0, fixed 0.24.0 (semver)0.24.0
0.24.0cargo update -p capnp --precise 0.24.0Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: RustSec Advisory Database · CC0-1.0