CVE-2025-53549: Matrix SDK SQL Injection Vulnerability in EventCache Implementation

matrix-sdk Updated 14 Dec 2025

Summary

10/07/2025
Yes i
Moderate
5.2

CVE-2025-53549: Matrix Rust SDK vulnerable to SQL Injection through its EventCache implementation. Affects matrix-sdk versions >= 0.11.0, < 0.13.0. Fixed in 0.13.0. How to fix ↓

Also tracked for

The same CVE-2025-53549 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The Matrix SDK is a Rust library designed for building Matrix clients, enabling real-time communication and collaboration. It provides functionalities for managing events, handling user interactions, and maintaining state within Matrix rooms. The SDK is widely used in applications that require secure and efficient messaging. However, versions 0.11 and 0.12 of the SDK contain a vulnerability that allows for SQL injection attacks through the EventCache component, specifically in the find_event_with_relations method.

Vulnerability Detail

An SQL injection vulnerability exists in the EventCache::find_event_with_relations method of the matrix-sdk versions 0.11 and 0.12. This flaw allows malicious room members to execute arbitrary SQL commands by manipulating relation types passed into the method. The vulnerability was introduced in a pull request and poses a moderate risk, although exploitation is unlikely as no known clients currently utilize the API in a vulnerable manner. The issue primarily affects applications using the default SQLite store backend.

How To Fix

Minimum fixed version

0.13.0

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

To mitigate the risk of SQL injection, ensure that only trusted or sanitized relation types are passed to the filter argument of EventCache::find_event_with_relations(). For example:

let safe_relation_type = sanitize_input(user_provided_relation_type);
event_cache.find_event_with_relations(safe_relation_type);

Conclusion

The SQL injection vulnerability in the Matrix SDK's EventCache implementation poses a moderate risk to applications using affected versions. By updating to version 0.13 or later and implementing proper input sanitization, developers can protect their applications from potential exploitation.

See every vulnerability recorded for matrix-sdk →

Share this vulnerability

FAQ

CVE-2025-53549 is an identifier for a security vulnerability in the Matrix SDK that allows SQL injection through the EventCache implementation.

The vulnerability affects versions 0.11 and 0.12 of the Matrix SDK.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit Vulert Scanner to check if your application is affected without needing to sign up.

Update the matrix-sdk package to version 0.13 or later by modifying your Cargo.toml file and running 'cargo update'.

Ensure that only trusted or sanitized relation types are passed to the filter argument of EventCache::find_event_with_relations to avoid SQL injection.

Related vulnerabilities

Recent vulnerabilities recorded for matrix-sdk.

How To Fix

Minimum fixed version

0.13.0

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback