Summary
Matrix Rust SDK vulnerable to SQL Injection through its EventCache implementation
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.
References
The issue was introduced in https://github.com/matrix-org/matrix-rust-sdk/pull/4849.
Impact
Untrusted input alters a database query, allowing the attacker to read or modify data the query was not intended to access. Typical impact: data disclosure or modification.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
The issue is fixed in matrix-sdk 0.13.
Frequently Asked Questions
- What is CVE-2025-53549? CVE-2025-53549 is a medium-severity SQL injection vulnerability in matrix-sdk (rust), affecting versions >= 0.11.0, < 0.13.0. It is fixed in 0.13.0. Untrusted input alters a database query, allowing the attacker to read or modify data the query was not intended to access.
- Which packages are affected by CVE-2025-53549?
matrix-sdk(rust) (versions >= 0.11.0, < 0.13.0)matrix-sdk-sqlite(rust) (versions >= 0.11.0, < 0.13.0)
- Is there a fix for CVE-2025-53549? Yes. CVE-2025-53549 is fixed in 0.13.0. Upgrade to this version or later.
- Is CVE-2025-53549 exploitable, and should I be worried? Whether CVE-2025-53549 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2025-53549 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2025-53549?
- Upgrade
matrix-sdkto 0.13.0 or later - Upgrade
matrix-sdk-sqliteto 0.13.0 or later
- Upgrade