CVE-2024-40648

5.4 MEDIUM

📋 TL;DR

A vulnerability in matrix-rust-sdk's matrix-sdk-crypto crate allows a malicious homeserver to manipulate the UserIdentity::is_verified() method to incorrectly report a user identity as trusted. This could lead to sensitive operations being performed against untrusted identities. Only applications using this specific method for trust decisions are affected.

💻 Affected Systems

Products:
  • matrix-rust-sdk matrix-sdk-crypto crate
Versions: matrix-sdk-crypto crate versions before 0.7.2
Operating Systems: All platforms using Rust
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects applications that explicitly call UserIdentity::is_verified() method for security decisions.

⚠️ Manual Verification Required

This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.

Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).

🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. Consider updating to the latest version as a precaution

⚠️ Risk & Real-World Impact

🔴

Worst Case

Sensitive operations (like sharing encryption keys or private data) performed with malicious identities controlled by an attacker, leading to data compromise.

🟠

Likely Case

Limited impact since the method is not used internally in the crate and typical applications don't rely on it for critical trust decisions.

🟢

If Mitigated

No impact if applications don't use UserIdentity::is_verified() for security decisions or have upgraded to patched version.

🌐 Internet-Facing: LOW - Requires specific application usage patterns and malicious homeserver control.
🏢 Internal Only: LOW - Same requirements as internet-facing; primarily affects client-side trust decisions.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: NO
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Requires control of a malicious homeserver and application using the vulnerable method incorrectly.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: matrix-sdk-crypto 0.7.2

Vendor Advisory: https://github.com/matrix-org/matrix-rust-sdk/security/advisories/GHSA-4qg4-cvh2-crgg

Restart Required: Yes

Instructions:

1. Update Cargo.toml to require matrix-sdk-crypto >=0.7.2. 2. Run 'cargo update'. 3. Rebuild and redeploy application.

🔧 Temporary Workarounds

Avoid using is_verified() method

all

Do not use UserIdentity::is_verified() method for security decisions until patched

🧯 If You Can't Patch

  • Audit codebase for usage of UserIdentity::is_verified() and implement alternative trust verification
  • Implement additional verification layers for sensitive operations

🔍 How to Verify

Check if Vulnerable:

Check Cargo.lock or Cargo.toml for matrix-sdk-crypto version <0.7.2

Check Version:

grep -A2 -B2 'matrix-sdk-crypto' Cargo.toml && grep 'matrix-sdk-crypto' Cargo.lock

Verify Fix Applied:

Confirm matrix-sdk-crypto version >=0.7.2 in dependencies

📡 Detection & Monitoring

Log Indicators:

  • Unusual trust decisions based on is_verified() method
  • Sensitive operations performed with newly verified identities

Network Indicators:

  • Unexpected homeserver interactions when is_verified() is called

SIEM Query:

Not applicable - client-side library vulnerability

🔗 References

📤 Share & Export