Alisher 5142fe9bf0
security: bind a fetched KeyPackage to the requested signer on the group add path (#202)
On the group add path, a KeyPackage fetched from the registry for a requested
signer id is validated but never checked to belong to that signer: the member id
is read from the package's own credential. A registry that returns an attacker's
(validly self-signed) package for a victim's id therefore inserts the attacker's
leaf under the victim's identity — a confidentiality break and sender-attribution
spoof. validate() is not meant to enforce this; the application (AS) layer is.

Bind the validated leaf's signature_key (hex) to the requested signer id in both
GroupV1::key_package_for_signer and GroupV2::add_member, rejecting a mismatch.
Bind to the key, not the credential bytes: an impostor can copy an id into a
credential but cannot sign a leaf with the victim's key.

Courtesy patch from the downstream Peers fork; coordinated via the libchat
security advisory. Reported by @x0net.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-11 08:29:54 -07:00
..
2026-03-24 18:21:00 -07:00

Core

Crates in this directory will one day be separated into a separate shared repository.

They could be moved now, but it's desirable to have a monorepo setup at this time.

These crates MUST not depend on any code outside of this folder.