Email me

Rust advisories / capnp

Vulnerability CriticalRUSTSEC-2025-0143 · capnp

RUSTSEC-2025-0143: Unsound APIs of public `constant::Reader` and `StructSchema`

Short answerA security vulnerability in the capnp crate: Unsound APIs of public `constant::Reader` and `StructSchema`. GitHub rates it Critical. Fixed in 0.24.0: update to a fixed version.

Cratecapnp
TypeVulnerability (memory-corruption)
Affected versionsBefore 0.24.0.
Fixed in0.24.0
SeverityCritical (GitHub rating)
Published2025-12-24
Last changed2026-01-29
Also known asGHSA-5w5r-mf82-595p
Affected functionscapnp::constant::Reader::get, capnp::schema::StructSchema::new

What to do

  1. See which version you have: cargo tree -i capnp (it also shows which of your dependencies pulls it in).
  2. Update within your version requirement: cargo update -p capnp. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for example capnp = "0.24.0") or update the dependency that pulls it in.
  3. Check again with cargo audit, or paste your Cargo.lock into our Cargo.toml checker.

Details from the advisory

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.

References

From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.

Other advisories for capnp

Full security history of capnp

Up next

Same cratecapnp: security historyEvery advisory for this crate, and whether it is safe to use today.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ