CVE-2025-53549: Matrix sdk SQL Injection Vulnerability
MODERATECVE-2025-53549 is a MODERATE sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Matrix sdk libraries in the crates.io ecosystem. The issue involves matrix rust sdk vulnerable to sql injection through its eventcache implementation. Remediation is available by upgrading affected packages to version 0.13.0.
CVE-2025-53549 at a Glance
How to Fix CVE-2025-53549
To remediate this vulnerability, upgrade all affected Matrix sdk dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade matrix-sdk to 0.13.0
Upgrade matrix-sdk-sqlite to 0.13.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for matrix-sdk
How to Check if You Are Affected
To determine whether your application is affected by CVE-2025-53549, inspect your project dependencies for Matrix sdk:
inspect dependencies for matrix-sdk
Analyze the terminal output to locate any version of Matrix sdk in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.13.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In Matrix sdk, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-53549 Affected Matrix sdk Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
matrix-sdk
|
crates.io |
≥ 0.11.0
< 0.13.0
|
0.13.0
|
|
matrix-sdk-sqlite
|
crates.io |
≥ 0.11.0
< 0.13.0
|
0.13.0
|
References
Frequently Asked Questions
What is CVE-2025-53549?
Which Matrix sdk versions are affected?
What version fixes CVE-2025-53549?
Is matrix-sdk affected?
Is matrix-sdk-sqlite affected?
What CWE is associated with CVE-2025-53549?
How can I check crates.io dependencies for CVE-2025-53549?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-275g-g844-73jh",
"modified" : "2025-07-11T20:45:34Z",
"published" : "2025-07-10T17:41:16Z",
"aliases" : [ "CVE-2025-53549" ],
"summary" : "Matrix Rust SDK vulnerable to SQL Injection through its EventCache implementation",
"details" : "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.\n\n### Workarounds\n\nPassing only trusted (or sanitised) relation types to the `filter` argument of `EventCache::find_event_with_relations()` avoids the issue.\n\n### Patches\n\nThe issue is fixed in matrix-sdk 0.13.\n\n### References\n\nThe issue was introduced in https://github.com/matrix-org/matrix-rust-sdk/pull/4849.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "matrix-sdk"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.11.0"
}, {
"fixed" : "0.13.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "crates.io",
"name" : "matrix-sdk-sqlite"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.11.0"
}, {
"fixed" : "0.13.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/matrix-org/matrix-rust-sdk/security/advisories/GHSA-275g-g844-73jh"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-53549"
}, {
"type" : "WEB",
"url" : "https://github.com/matrix-org/matrix-rust-sdk/pull/4849"
}, {
"type" : "WEB",
"url" : "https://github.com/matrix-org/matrix-rust-sdk/commit/d0c01006e4808db5eb96ad5c496416f284d8bd3c"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/matrix-org/matrix-rust-sdk"
}, {
"type" : "WEB",
"url" : "https://rustsec.org/advisories/RUSTSEC-2025-0043.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-89" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-07-10T17:41:16Z",
"nvd_published_at" : "2025-07-10T19:15:26Z"
}
}