Matrix Rust SDK vulnerable to SQL Injection through its EventCache implementation
Moderate severity
GitHub Reviewed
Published
Jul 10, 2025
in
matrix-org/matrix-rust-sdk
•
Updated Jul 11, 2025
Description
Published to the GitHub Advisory Database
Jul 10, 2025
Reviewed
Jul 10, 2025
Published by the National Vulnerability Database
Jul 10, 2025
Last updated
Jul 11, 2025
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 ofEventCache::find_event_with_relations()
avoids the issue.Patches
The issue is fixed in matrix-sdk 0.13.
References
The issue was introduced in matrix-org/matrix-rust-sdk#4849.
References