GitHub Advisoryadvisory · crates.io
GHSA-275g-g844-73jh Matrix Rust SDK vulnerable to SQL Injection through its EventCache implementation
MEDIUM
Official page ↗
- Aliases
- CVE-2025-53549
- Ecosystem
- crates.io
- Packages
- matrix-sdk, matrix-sdk-sqlite
- Severity
- Moderate
- CVSS vector
- CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:U
- Weaknesses
- CWE-89
- Reviewed
- 2025-07-10
Affected packages
• crates.io matrix-sdk: >= 0.11.0, < 0.13.0 → fixed in 0.13.0
• crates.io matrix-sdk-sqlite: >= 0.11.0, < 0.13.0 → fixed in 0.13.0
Description
An SQL injection vulnerability in the `EventCache::find_event_with_relations` method of matrix-sdk 0.11 and 0.12 allows malicious room members to execute arbitrary SQL commands in Matrix clients that directly pass relation types provided by those room members into this method, when used with the default sqlite-based store backend. Exploitation is unlikely, as no known clients currently use the API in this manner.
Workarounds
Passing only trusted (or sanitised) relation types to the `filter` argument of `EventCache::find_event_with_relations()` avoids the issue.
Patches
The issue is fixed in matrix-sdk 0.13.
References
The issue was introduced in https://github.com/matrix-org/matrix-rust-sdk/pull/4849.
Related
Alias · CVE (1)
- CVE-2025-53549 The Matrix Rust SDK is a collection of libraries that make it easier to build Matrix clients in Rust. vulnerability
Weakness · CWE (1)
- CWE-89 Improper Neutralization of Special Elements used in an SQL Command weakness
References
- https://github.com/matrix-org/matrix-rust-sdk/security/advisories/GHSA-275g-g844-73jh web
- https://nvd.nist.gov/vuln/detail/CVE-2025-53549 advisory
- https://github.com/matrix-org/matrix-rust-sdk/pull/4849 web
- https://github.com/matrix-org/matrix-rust-sdk/commit/d0c01006e4808db5eb96ad5c496416f284d8bd3c web
- https://github.com/matrix-org/matrix-rust-sdk package
- https://rustsec.org/advisories/RUSTSEC-2025-0043.html web