{"id":"CVE-2025-53549","aliases":["CVE-2025-53549","GHSA-275g-g844-73jh","RUSTSEC-2025-0043"],"related":[],"kind":"vulnerability","state":"published","title":"Matrix Rust SDK allows SQL injection in the EventCache implementation","summary":"The Matrix Rust SDK is a collection of libraries that make it easier to build Matrix clients in Rust. 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. This vulnerability is fixed in 0.13.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"The Matrix Rust SDK is a collection of libraries that make it easier to build Matrix clients in Rust. 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. This vulnerability is fixed in 0.13.","source":"cvelist"},{"lang":"en","text":"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.","format":"markdown","source":"ghsa"},{"lang":"en","text":"The `SqliteEventCacheStore::find_event_with_relations` function constructs SQL\nqueries using `format!()` with unescaped input, allowing an attacker to inject\narbitrary SQL. This results in a SQL injection vulnerability.","format":"markdown","source":"rustsec"},{"lang":"es","text":"SDK Matrix de Rust es una colección de librerías que facilita la creación de clientes Matrix en Rust. Una vulnerabilidad de inyección SQL en el método EventCache::find_event_with_relations de matrix-sdk 0.11 y 0.12 permite a miembros maliciosos de la sala ejecutar comandos SQL arbitrarios en clientes Matrix que transfieren directamente los tipos de relación proporcionados por dichos miembros a este método, al usarse con el backend de almacenamiento predeterminado basado en SQLite. Es improbable que se explote, ya que actualmente ningún cliente conocido utiliza la API de esta manera. Esta vulnerabilidad se corrigió en la versión 0.13.","source":"nvd"}],"published":"2025-07-10T17:41:16.000Z","modified":"2026-10-12T18:00:10.950Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","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","score":5.2,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","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","score":5.2,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","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","rating":"MEDIUM"}],"cwes":["CWE-89"],"affected":[{"ranges":[{"version":">= 0.11, < 0.13","status":"affected"}],"vendor":"matrix-org","product":"matrix-rust-sdk","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.11.0","status":"affected","fixed":"0.13.0"}],"ecosystem":"crates.io","package":"matrix-sdk","purl":"pkg:cargo/matrix-sdk","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.11.0","status":"affected","fixed":"0.13.0"}],"ecosystem":"crates.io","package":"matrix-sdk-sqlite","purl":"pkg:cargo/matrix-sdk-sqlite","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.11.0","status":"affected","fixed":"0.13.0"}],"ecosystem":"crates.io","package":"matrix-sdk-sqlite","purl":"pkg:cargo/matrix-sdk-sqlite","source":"rustsec"}],"references":[{"url":"https://github.com/matrix-org/matrix-rust-sdk/security/advisories/GHSA-275g-g844-73jh","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/matrix-org/matrix-rust-sdk/pull/4849","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","rustsec","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-53549","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/matrix-org/matrix-rust-sdk/commit/d0c01006e4808db5eb96ad5c496416f284d8bd3c","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/matrix-org/matrix-rust-sdk","tags":["package"],"sources":["ghsa"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2025-0043.html","tags":["advisory","web"],"sources":["ghsa","rustsec"]},{"url":"https://crates.io/crates/matrix-sdk-sqlite","tags":["package"],"sources":["rustsec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2025-07-10T19:02:17.517Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-53549","url":"https://www.cve.org/CVERecord?id=CVE-2025-53549","licence":"CVE Terms of Use","modified":"2025-07-10T19:02:23.365Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-275g-g844-73jh","url":"https://github.com/advisories/GHSA-275g-g844-73jh","licence":"CC-BY-4.0","modified":"2025-07-11T20:45:34.000Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2025-0043","url":"https://rustsec.org/advisories/RUSTSEC-2025-0043.html","licence":"CC0-1.0","modified":"2026-10-12T18:00:10.950Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-53549","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-53549","licence":"Public domain","modified":"2026-06-17T09:38:25.760Z"}],"updatedAt":"2026-11-25T22:59:01.110Z","epss":{"score":0.00318,"percentile":0.26724,"date":"2026-12-01T12:00:22.000Z"}}