CVE-2022-39252: Matrix sdk crypto Matrix-sdk-crypto Contains Potential Impersonation Vulnerability
MODERATECVE-2022-39252 is a MODERATE (CVSS 6.5) matrix-sdk-crypto contains potential impersonation vulnerability (CWE-287: Improper Authentication) affecting Matrix sdk crypto libraries in the crates.io ecosystem. The issue involves matrix-sdk-crypto contains potential impersonation via room key forward responses. Remediation is available by upgrading affected packages to version 0.6.0.
CVE-2022-39252 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N).
How to Fix CVE-2022-39252
To remediate this vulnerability, upgrade all affected Matrix sdk crypto dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade matrix-sdk-crypto to 0.6.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for matrix-sdk-crypto
How to Check if You Are Affected
To determine whether your application is affected by CVE-2022-39252, inspect your project dependencies for Matrix sdk crypto:
inspect dependencies for matrix-sdk-crypto
Analyze the terminal output to locate any version of Matrix sdk crypto in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.6.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-287: Improper Authentication, where when an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct. In Matrix sdk crypto, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-39252 Affected Matrix sdk crypto Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
matrix-sdk-crypto
|
crates.io |
< 0.6.0
|
0.6.0
|
References
Frequently Asked Questions
What is CVE-2022-39252?
Which Matrix sdk crypto versions are affected?
What version fixes CVE-2022-39252?
Is matrix-sdk-crypto affected?
What is the CVSS score of CVE-2022-39252?
What CWE is associated with CVE-2022-39252?
How can I check crates.io dependencies for CVE-2022-39252?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-vp68-2wrm-69qm",
"modified" : "2022-09-30T22:51:57Z",
"published" : "2022-09-30T22:51:57Z",
"aliases" : [ "CVE-2022-39252" ],
"summary" : "matrix-sdk-crypto contains potential impersonation via room key forward responses",
"details" : "### Impact\n\nWhen 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.\n\nThis 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).\n\n### For more information\nIf you have any questions or comments about this advisory, e-mail us at [security@matrix.org](mailto:security@matrix.org).",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "matrix-sdk-crypto"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.6.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/matrix-org/matrix-rust-sdk/security/advisories/GHSA-vp68-2wrm-69qm"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-39252"
}, {
"type" : "WEB",
"url" : "https://github.com/matrix-org/matrix-rust-sdk/commit/093fb5d0aa21c0b5eaea6ec96b477f1075271cbb"
}, {
"type" : "WEB",
"url" : "https://github.com/matrix-org/matrix-rust-sdk/commit/41449d2cc360e347f5d4e1c154ec1e3185f11acd"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/matrix-org/matrix-rust-sdk"
}, {
"type" : "WEB",
"url" : "https://github.com/matrix-org/matrix-rust-sdk/releases/tag/matrix-sdk-0.6.0"
}, {
"type" : "WEB",
"url" : "https://rustsec.org/advisories/RUSTSEC-2022-0085.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-287" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-09-30T22:51:57Z",
"nvd_published_at" : "2022-09-29T15:15:00Z"
}
}