CVE-2021-40824:
Logic error in Matrix SDK for Android
5.9
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.47007%
CWE
Published
5/24/2022
Updated
8/18/2023
KEV Status
No
Technology
Java
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
org.matrix.android:matrix-android-sdk2 | maven | < 1.2.2 | 1.2.2 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from improper device identity verification during encryption key sharing. The patches show critical changes in how device authentication is handled:
- MXMegolmEncryption.shareKeyWithDevices was modified to use full deviceInfo instead of separate user/device IDs when checking cryptoStore
- SharedWithHelper and IMXCryptoStore interfaces were updated to require device identity keys in session tracking
- Database queries in RealmCryptoStore now join with device identity keys
- The migration adds deviceIdentityKey field to shared session records These changes indicate the original code paths used only user ID and device ID for authentication, allowing impersonation by malicious servers controlling those identifiers. The vulnerable functions would appear in profilers during key sharing operations when processing untrusted device claims.