mirror of
https://github.com/logos-messaging/libchat.git
synced 2026-08-12 10:03:13 +00:00
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>