Skip to content

GHSA-4qg4-cvh2-crgg CVE-2024-40648 RUSTSEC-2024-0356

matrix-sdk-crypto's `UserIdentity::is_verified` not checking verification status of own user identity while performing the check

Medium crates.io
Severity
0.0 / 10
Medium · CVSS 4.0
Exploit chance (EPSS)
0.28%
Chance of exploitation in the next 30 days. Higher than 20.47% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-287 Improper Authentication
CWE-863 Incorrect Authorization
Fix
0.7.2
Upgrade matrix-sdk-crypto to this version or later

Description

The UserIdentity::is_verified() method in the matrix-sdk-crypto crate before version 0.7.2 doesn't take into account the verification status of the user's own identity while performing the check and may as a result return a value contrary to what is implied by its name and documentation.

Impact

If the method is used to decide whether to perform sensitive operations towards a user identity, a malicious homeserver could manipulate the outcome in order to make the identity appear trusted. This is not a typical usage of the method, which lowers the impact. The method itself is not used inside the matrix-sdk-crypto crate.

Patches

The 0.7.2 release of the matrix-sdk-crypto crate includes a fix.

Workarounds

None.

Affected versions

crates.io

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

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.7.2

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

Severity breakdown

CVSS 4.0 0.0

CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N

Attack vector
Network
Attack complexity
Low
Attack requirements
Present
Privileges required
None
User interaction
None
Confidentiality (vulnerable system)
Low
Integrity (vulnerable system)
Low
Availability (vulnerable system)
None
Confidentiality (subsequent systems)
None
Integrity (subsequent systems)
None
Availability (subsequent systems)
None

CVSS 3.1 4.8

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

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
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.

CWE-863: Incorrect Authorization

The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check.

How to prevent it
  • Architecture and Design: Divide the product into anonymous, normal, privileged, and administrative areas. Reduce the attack surface by carefully mapping roles with data and functionality. Use role-based access control (RBAC) [REF-229] to enforce the roles at the appropriate boundaries. Note that this approach may not protect against horizontal authorization, i.e., it will not protect a user from attacking others with the same role.
  • Architecture and Design: Ensure that access control checks are performed related to the business logic. These checks may be different than the access control checks that are applied to more generic resources such as files, connections, processes, memory, and database records. For example, a database may restrict access for medical records to a specific database user, but each record might only be intended to be accessible to the patient and the patient's doctor [REF-7].
  • Architecture and Design: Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, consider using authorization frameworks such as the JAAS Authorization Framework [REF-233] and the OWASP ESAPI Access Control feature [REF-45].
  • Architecture and Design: For web applications, make sure that the access control mechanism is enforced correctly at the server side on every page. Users should not be able to access any unauthorized functionality or information by simply requesting direct access to that page. One way to do this is to ensure that all pages containing sensitive information are not cached, and that all such pages restrict access to requests that are accompanied by an active and authenticated session token associated with a user who has the required permissions to access that page.
  • System Configuration, Installation: Use the access control capabilities of your operating system and server environment and define your access control lists accordingly. Use a "default deny" policy when defining these ACLs.

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-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-vp68-2wrm-69qm
matrix-sdk-crypto contains potential impersonation via room key forward responses
High 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