Skip to content

GHSA-vp68-2wrm-69qm CVE-2022-39252 RUSTSEC-2022-0085

matrix-sdk-crypto contains potential impersonation via room key forward responses

High crates.io
Severity
6.5 / 10
High · CVSS 3.1
Exploit chance (EPSS)
0.63%
Chance of exploitation in the next 30 days. Higher than 50.23% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-287 Improper Authentication
Fix
0.6.0
Upgrade matrix-sdk-crypto to this version or later

Description

Impact

When matrix-rust-sdk before 0.6 requests a room key from our devices, it correctly accepts key forwards only if they are a response to a previous request. However, it doesn't check that the device that responded matches the device the key was requested from.

This allows a malicious homeserver to insert room keys of questionable validity into the key store in some situations, potentially assisting in an impersonation attack. Note that even if key injection succeeds in this way, all forwarded keys have the imported flag set, which is used as an indicator that such keys have lesser authentication properties (and should be marked as such in clients, e.g. with a grey shield besides the message).

For more information

If you have any questions or comments about this advisory, e-mail us at security@matrix.org.

Affected versions

crates.io

PackageVulnerableFixed in
matrix-sdk-crypto
< 0.6.0
0.6.0
matrix-sdk-crypto
>= 0.0.0-0, < 0.6.0
0.6.0

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

matrix-sdk-crypto crates.io → 0.6.0

cargo
cargo update -p matrix-sdk-crypto --precise 0.6.0

Severity breakdown

CVSS 3.1 6.5

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
None

Weakness

CWE-287: Improper Authentication

When an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct.

How to prevent it
  • Architecture and Design: Use an authentication framework or library such as the OWASP ESAPI Authentication feature.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
RUSTSEC-2026-0318
Sending custom to-device messages may panics
Not rated yet Also affects matrix-sdk-crypto
GHSA-wfq4-36m3-9g42
Matrix Rust SDK: Sender-binding gaps in to-device and room-key attribution
Medium Also affects matrix-sdk-crypto
GHSA-x958-rvg6-956w
matrix-sdk-crypto vulnerable to sender of encrypted events being spoofed by homeserver administrator
Medium Also affects matrix-sdk-crypto
GHSA-4qg4-cvh2-crgg
matrix-sdk-crypto's `UserIdentity::is_verified` not checking verification status of own user identity while performing the check
Medium Also affects matrix-sdk-crypto
GHSA-9ggc-845v-gcgv
matrix-sdk-crypto contains a log exposure of private key of the server-side key backup
Medium Also affects matrix-sdk-crypto
GHSA-r5vf-wf4h-82gg
matrix-sdk-crypto missing facility to signal rotation of a verified cryptographic identity
Medium Also affects matrix-sdk-crypto
GHSA-f9x3-7vq9-cph6
Laravel TokenGuard authentication bypass through non-string API credentials
Critical Same weakness, CWE-287
GHSA-r4xp-prcw-77qf
better-auth: OAuth Proxy lets an attacker sign in as another user
Critical Same weakness, CWE-287
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor