Security mailing lists by PureSourceCode

GHSA-5w5r-mf82-595p

CRITICAL

Cap'n Proto has Undefined Behavior in 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.

Published
24 Dec 2025
Last modified
3 Feb 2026
Weakness
CWE-758
Also known as
RUSTSEC-2025-0143
Sources
OSVJSONOSV RUSTSEC-2025-0143JSON

Scores

SourceScored byVersionScoreVector / decision
OSV GitHub CVSS 4.0 CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Affected

SourceVendor / ecosystemProduct / packageAffected versionsFixed in
OSV crates.io capnp < 0.24.0 0.24.0
OSV crates.io capnp >= 0.0.0-0, < 0.24.0 0.24.0

References

History

  • 25 Nov 2026 20:14 UTC · OSV: first stored (published 24 Dec 2025)
  • 25 Nov 2026 20:14 UTC · OSV: first stored (published 28 Jan 2026)
An unhandled error has occurred. Reload ×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.