Skip to main content
Vulnerability Database/CVE-2026-45056

CVE-2026-45056: matrix-sdk-crypto Auth Bypass Vulnerability

CVE-2026-45056 is an authentication bypass flaw in matrix-sdk-crypto that allows attackers to forge encrypted events when colluding with homeserver operators. This post explains its impact, affected versions, and mitigation steps.

Published:

CVE-2026-45056 Overview

CVE-2026-45056 affects matrix-sdk-crypto, a no-network-IO Rust implementation of the state machine that handles end-to-end encryption for Matrix clients. Versions from 0.12.0 through 0.16.x fail to verify the user ID when decrypting an Olm-encrypted event that contains the sender_device_keys property. An attacker who colludes with a malicious homeserver operator can exploit this gap to forge encrypted to-device events. The flaw is tracked under [CWE-290: Authentication Bypass by Spoofing] and was fixed in matrix-sdk-crypto 0.17.0.

Critical Impact

Attackers colluding with a homeserver operator can forge to-device events that appear to originate from a trusted Matrix user, breaking end-to-end authenticity guarantees.

Affected Products

  • matrix-sdk-crypto crate versions 0.12.0 through 0.16.x
  • Matrix Rust SDK releases prior to matrix-sdk-0.16.1
  • Matrix clients built on the affected matrix-sdk-crypto versions

Discovery Timeline

  • 2026-09-11 - CVE-2026-45056 published to NVD
  • 2026-09-14 - Last updated in NVD database

Technical Details for CVE-2026-45056

Vulnerability Analysis

The matrix-sdk-crypto crate implements the Olm and Megolm cryptographic ratchets used by Matrix clients for end-to-end encryption. When decrypting an Olm-encrypted to-device event, the SDK inspects the optional sender_device_keys property to bind the sender's device identity to the ciphertext. In affected versions, the decryption path validates the device key material but omits a comparison between the user ID embedded in sender_device_keys and the user ID asserted for the event. This missing check allows an attacker who controls the homeserver to substitute keys belonging to a different user while the receiving client still treats the message as authentic. The result is a forged to-device event that impersonates an arbitrary Matrix user, undermining sender authentication guarantees. Exploitation requires collusion with the homeserver operator, which limits the attacker population but is realistic for hostile or compromised servers.

Root Cause

The root cause is an incomplete identity verification step in the Olm decryption logic. The crate accepted sender_device_keys without cross-checking the enclosed user ID against the claimed sender, satisfying the pattern described by [CWE-290]. See the GitHub Security Advisory GHSA-wfq4-36m3-9g42 for the maintainer analysis.

Attack Vector

An attacker who operates or has compromised a Matrix homeserver crafts an Olm-encrypted to-device payload containing a sender_device_keys block referencing a victim device owned by a different user. The homeserver delivers the event to the targeted client, which decrypts and accepts it as originating from the impersonated user. This enables spoofed key verification requests, forged room key distributions, and other trust-anchor manipulations. The vulnerability cannot be triggered by an unprivileged network attacker without homeserver cooperation. Technical detail is available in the Matrix Rust SDK pull request 6553.

No public exploit code has been released for CVE-2026-45056. Refer to the RustSec Advisory RUSTSEC-2026-0159 for advisory metadata.

Detect Identity Attacks the Moment Authentication Fails

Singularity™ Identity surfaces credential misuse, lateral movement, and privilege escalation in real time, so you can contain the breach before it spreads.

Stop Identity Attacks

Detection Methods for CVE-2026-45056

Indicators of Compromise

  • To-device events whose sender_device_keys.user_id field does not match the event's asserted sender value.
  • Unexpected key verification requests or room key shares arriving from devices the user has not previously interacted with.
  • Client logs showing successful Olm decryption of to-device events with mismatched user identifiers.

Detection Strategies

  • Inventory application dependencies to identify projects pinning matrix-sdk-crypto between 0.12.0 and 0.16.x using cargo tree or SBOM tooling.
  • Enable cargo audit against the RustSec database to flag RUSTSEC-2026-0159 in CI pipelines.
  • Instrument Matrix clients to log any to-device event where sender_device_keys is present and inspect for user ID mismatches during triage.

Monitoring Recommendations

  • Monitor homeserver federation logs for anomalous to-device traffic patterns targeting encryption-sensitive users.
  • Alert on unexpected changes to device verification state or newly cross-signed devices without user interaction.
  • Track releases of Matrix client dependencies in package management telemetry to detect vulnerable builds reaching production.

How to Mitigate CVE-2026-45056

Immediate Actions Required

  • Upgrade matrix-sdk-crypto to version 0.17.0 or later, and consuming Matrix SDK components to matrix-sdk-0.16.1 or later.
  • Rebuild and redistribute any client applications, bots, or bridges that embed the affected crate versions.
  • Review recent key verification and to-device activity in high-value Matrix accounts for evidence of impersonation.

Patch Information

The fix landed in matrix-sdk-crypto 0.17.0 via the change described in Matrix Rust SDK pull request 6553 and is included in the matrix-sdk 0.16.1 release notes. The patch adds an explicit comparison between the user ID inside sender_device_keys and the claimed sender, rejecting mismatched events before they influence key state.

Workarounds

  • No workarounds exist per the maintainer advisory; upgrading the crate is the only supported remediation.
  • Where immediate upgrade is not possible, restrict client federation to trusted homeservers to reduce exposure to hostile server operators.

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.