GHSA-275g-g844-73jh

Suggest an improvement
Source
https://github.com/advisories/GHSA-275g-g844-73jh
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/07/GHSA-275g-g844-73jh/GHSA-275g-g844-73jh.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-275g-g844-73jh
Aliases
Published
2025-07-10T17:41:16Z
Modified
2025-07-11T20:45:34Z
Severity
  • 5.2 (Medium) CVSS_V4 - 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 CVSS Calculator
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.

Workarounds

Passing only trusted (or sanitised) relation types to the filter argument of EventCache::find_event_with_relations() avoids the issue.

Patches

The issue is fixed in matrix-sdk 0.13.

References

The issue was introduced in https://github.com/matrix-org/matrix-rust-sdk/pull/4849.

Database specific
{
    "nvd_published_at": "2025-07-10T19:15:26Z",
    "github_reviewed_at": "2025-07-10T17:41:16Z",
    "github_reviewed": true,
    "severity": "MODERATE",
    "cwe_ids": [
        "CWE-89"
    ]
}
References

Affected packages

crates.io / matrix-sdk

Package

Affected ranges

Type
SEMVER
Events
Introduced
0.11.0
Fixed
0.13.0

crates.io / matrix-sdk-sqlite

Package

Name
matrix-sdk-sqlite
View open source insights on deps.dev
Purl
pkg:cargo/matrix-sdk-sqlite

Affected ranges

Type
SEMVER
Events
Introduced
0.11.0
Fixed
0.13.0