CVE-2022-39252: CWE-322: Key Exchange without Entity Authentication in matrix-org matrix-rust-sdk
matrix-rust-sdk is an implementation of a Matrix client-server library in Rust, and matrix-sdk-crypto is the Matrix encryption library. Prior to version 0.6, when a user requests a room key from their devices, the software correctly remembers the request. When the user receives a forwarded room key, the software accepts it without checking who the room key came from. This allows homeservers to try to insert room keys of questionable validity, potentially mounting an impersonation attack. Version 0.6 fixes this issue.
AI Analysis
Technical Summary
CVE-2022-39252 is a vulnerability identified in the matrix-rust-sdk, a Rust implementation of the Matrix client-server library, specifically affecting versions prior to 0.6. The matrix-sdk-crypto component handles encryption for Matrix communications. The vulnerability arises during the handling of room key requests and forwarding. When a user requests a room key from their devices, the software correctly tracks the request. However, upon receiving a forwarded room key, the affected versions accept the key without verifying the identity of the sender. This lack of entity authentication in the key exchange process (CWE-322) allows a malicious or compromised homeserver to inject room keys of questionable validity. Consequently, this can enable impersonation attacks where an attacker could masquerade as another user by supplying fraudulent encryption keys, potentially decrypting or manipulating encrypted communications. The flaw is rooted in improper authentication (CWE-287) during the key acceptance phase, undermining the integrity and confidentiality guarantees of the Matrix protocol. The issue was addressed in version 0.6 of matrix-rust-sdk by implementing proper verification of the source of forwarded room keys, thereby preventing unauthorized key injection. No known exploits have been reported in the wild as of the publication date, but the vulnerability presents a significant risk to secure messaging environments relying on the affected versions.
Potential Impact
For European organizations using Matrix-based communication platforms that incorporate the matrix-rust-sdk versions prior to 0.6, this vulnerability poses a risk to the confidentiality and integrity of encrypted communications. Attackers controlling or compromising a homeserver could inject fraudulent room keys, enabling them to impersonate users or decrypt sensitive messages. This undermines trust in secure messaging, potentially exposing private conversations, intellectual property, or sensitive operational information. Sectors such as government, finance, healthcare, and critical infrastructure, which increasingly adopt secure collaboration tools, could face espionage or data leakage risks. Additionally, the impersonation capability could facilitate social engineering or phishing attacks within organizations. While the vulnerability does not directly affect availability, the erosion of encryption trust could lead to broader security incidents or regulatory compliance issues under GDPR and other European data protection frameworks.
Mitigation Recommendations
European organizations should ensure that all deployments of matrix-rust-sdk are updated to version 0.6 or later, where the vulnerability is fixed. For environments where immediate upgrading is not feasible, organizations should implement strict controls on homeserver trust relationships, limiting key forwarding to only fully trusted servers. Network segmentation and monitoring of Matrix traffic for anomalous key forwarding behavior can help detect potential exploitation attempts. Additionally, organizations should audit their Matrix client and server configurations to verify that cryptographic verification mechanisms are enabled and functioning correctly. Incorporating endpoint security measures to detect unauthorized key injections and educating users about the risks of impersonation attacks can further reduce exposure. Finally, organizations should maintain an inventory of Matrix-based communication tools and their versions to promptly identify and remediate vulnerable instances.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Norway, Denmark
CVE-2022-39252: CWE-322: Key Exchange without Entity Authentication in matrix-org matrix-rust-sdk
Description
matrix-rust-sdk is an implementation of a Matrix client-server library in Rust, and matrix-sdk-crypto is the Matrix encryption library. Prior to version 0.6, when a user requests a room key from their devices, the software correctly remembers the request. When the user receives a forwarded room key, the software accepts it without checking who the room key came from. This allows homeservers to try to insert room keys of questionable validity, potentially mounting an impersonation attack. Version 0.6 fixes this issue.
AI-Powered Analysis
Technical Analysis
CVE-2022-39252 is a vulnerability identified in the matrix-rust-sdk, a Rust implementation of the Matrix client-server library, specifically affecting versions prior to 0.6. The matrix-sdk-crypto component handles encryption for Matrix communications. The vulnerability arises during the handling of room key requests and forwarding. When a user requests a room key from their devices, the software correctly tracks the request. However, upon receiving a forwarded room key, the affected versions accept the key without verifying the identity of the sender. This lack of entity authentication in the key exchange process (CWE-322) allows a malicious or compromised homeserver to inject room keys of questionable validity. Consequently, this can enable impersonation attacks where an attacker could masquerade as another user by supplying fraudulent encryption keys, potentially decrypting or manipulating encrypted communications. The flaw is rooted in improper authentication (CWE-287) during the key acceptance phase, undermining the integrity and confidentiality guarantees of the Matrix protocol. The issue was addressed in version 0.6 of matrix-rust-sdk by implementing proper verification of the source of forwarded room keys, thereby preventing unauthorized key injection. No known exploits have been reported in the wild as of the publication date, but the vulnerability presents a significant risk to secure messaging environments relying on the affected versions.
Potential Impact
For European organizations using Matrix-based communication platforms that incorporate the matrix-rust-sdk versions prior to 0.6, this vulnerability poses a risk to the confidentiality and integrity of encrypted communications. Attackers controlling or compromising a homeserver could inject fraudulent room keys, enabling them to impersonate users or decrypt sensitive messages. This undermines trust in secure messaging, potentially exposing private conversations, intellectual property, or sensitive operational information. Sectors such as government, finance, healthcare, and critical infrastructure, which increasingly adopt secure collaboration tools, could face espionage or data leakage risks. Additionally, the impersonation capability could facilitate social engineering or phishing attacks within organizations. While the vulnerability does not directly affect availability, the erosion of encryption trust could lead to broader security incidents or regulatory compliance issues under GDPR and other European data protection frameworks.
Mitigation Recommendations
European organizations should ensure that all deployments of matrix-rust-sdk are updated to version 0.6 or later, where the vulnerability is fixed. For environments where immediate upgrading is not feasible, organizations should implement strict controls on homeserver trust relationships, limiting key forwarding to only fully trusted servers. Network segmentation and monitoring of Matrix traffic for anomalous key forwarding behavior can help detect potential exploitation attempts. Additionally, organizations should audit their Matrix client and server configurations to verify that cryptographic verification mechanisms are enabled and functioning correctly. Incorporating endpoint security measures to detect unauthorized key injections and educating users about the risks of impersonation attacks can further reduce exposure. Finally, organizations should maintain an inventory of Matrix-based communication tools and their versions to promptly identify and remediate vulnerable instances.
Affected Countries
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2022-09-02T00:00:00.000Z
- Cisa Enriched
- true
Threat ID: 682d9845c4522896dcbf463c
Added to database: 5/21/2025, 9:09:25 AM
Last enriched: 6/22/2025, 4:20:34 PM
Last updated: 2/7/2026, 1:46:39 PM
Views: 42
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Related Threats
Organizations Urged to Replace Discontinued Edge Devices
MediumCVE-2026-2085: Command Injection in D-Link DWR-M921
HighCVE-2026-2084: OS Command Injection in D-Link DIR-823X
HighCVE-2026-2083: SQL Injection in code-projects Social Networking Site
MediumCVE-2026-2082: OS Command Injection in D-Link DIR-823X
MediumActions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.