{"id":"GHSA-h97m-27fx-42rx","summary":"matrix-sdk-ui: Incomplete edit validation","details":"### Impact\nThe message edit validation logic in the  `matrix-sdk-ui` crate before 0.16.1 is missing a check: when replacing an encrypted event, the replacement event itself is not required to be encrypted. This enables a malicious homeserver administrator (or an actor with equivalent power) to impersonate or spoof messages as if they were sent by a victim user.\n\n### Patches\n`matrix-sdk-ui` 0.16.1 fixes the message edit validation logic to align with the algorithm for replacement events[^1] described in the Matrix specification.\n\n### Workarounds\nN/A\n\n### References\n* Pull request: https://github.com/matrix-org/matrix-rust-sdk/pull/6454\n\n### For more information\nIf you have any questions or comments about this advisory, please email us at [security at matrix.org](mailto:security@matrix.org).\n\n[^1]: https://spec.matrix.org/unstable/client-server-api/#validity-of-replacement-events","aliases":["CVE-2026-45057","RUSTSEC-2026-0158"],"modified":"2026-06-04T15:00:08.147473159Z","published":"2026-06-04T14:50:47Z","database_specific":{"nvd_published_at":null,"cwe_ids":["CWE-345"],"severity":"MODERATE","github_reviewed":true,"github_reviewed_at":"2026-06-04T14:50:47Z"},"references":[{"type":"WEB","url":"https://github.com/matrix-org/matrix-rust-sdk/security/advisories/GHSA-h97m-27fx-42rx"},{"type":"WEB","url":"https://github.com/matrix-org/matrix-rust-sdk/pull/6454"},{"type":"PACKAGE","url":"https://github.com/matrix-org/matrix-rust-sdk"},{"type":"WEB","url":"https://github.com/matrix-org/matrix-rust-sdk/releases/tag/matrix-sdk-0.16.1"},{"type":"WEB","url":"https://rustsec.org/advisories/RUSTSEC-2026-0158.html"}],"affected":[{"package":{"name":"matrix-sdk-ui","ecosystem":"crates.io","purl":"pkg:cargo/matrix-sdk-ui"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.16.1"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/06/GHSA-h97m-27fx-42rx/GHSA-h97m-27fx-42rx.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:N"}]}