Changelog
All notable changes to this project will be documented in this file.
0.18.0 - 2026-06-02
No significant changes.
[0.17.0] - 2026-05-08
Bug fixes
- Check the user ID in the
sender_device_keysproperty of Olm-encrypted to-device events to prevent sender spoofing by homeserver owners. (#6553)
Features
- [breaking] Change to the stable identifiers for
m.room_key_bundle,m.history_not_sharedandm.shared_history. We still support reading the unstable identifiers. (#6467) - Add support for MSC4385.
(#6164)
- Add new method
OlmMachine::push_secret_to_verified_devices. - Pushed secrets that we receive from verified devices are added to the secrets inbox.
- Add new method
- Add
Store::{store,clear}_room_pending_key_bundle,CryptoStore::get_pending_key_bundle_details_for_roomandCryptoStore::get_all_rooms_pending_key_bundle, which can be used by applications to track whether they are expecting an MSC4268 key bundle. (#6199), (#6233), - Add MSC4388 support to the QrcodeData struct. (#6089)
- Improved logging when we are sending secrets in
GossipMachine. (#6074) (#6083) - Added a new field
forwardertoInboundGroupSessionof typeForwarderData, which stores information about the forwarder of a session shared in a room key bundle under MSC4268. ([#5980])(https://github.com/matrix-org/matrix-rust-sdk/pull/5980) - The
OutboundGroupSessionandOlmMachinenow return theEncryptionInfoused when encrypting raw events. (#5936) - Expose a new method
CryptoStore::has_downloaded_all_room_keys, used to track whether the client has previously downloaded historical room keys for a given room from key backup prior to building an MSC4268 room key bundle. (#6017) (#6044)
Refactor
- Re-introduce cross-process lock generation logic in
OlmMachine(#6496) - [breaking] The
MegolmV1BackupKey::encryptnow returns aResult(#6477) - [breaking]
CryptoStore::get_secrets_from_inboxnow returns aVecof the secrets as strings, rather than aVecofGossippedSecretstructs. (#6164) - [breaking]
store::types::Changes::sessionsnow stores aVecofSecretsInboxItem. (#6164) - breaking The
BackupDecryptionKey::newandDehydratedDeviceKey::newmethods became infallible, they don’t return aResultanymore. (#5502) - [breaking] Remove cross-process lock generation logic from
OlmMachine, which is now implemented more generally inmatrix_sdk_common::cross_process_lock::CrossProcessLock. (#6326) - [breaking] The
MediaEncryptionInfofields changed to match the new fields ofEncryptedFilefrom Ruma. The serialized JSON format did not change and still matches the format ofEncryptedFiledefined in the spec, without theurlfield. TheDecryptorError::KeyNonceLengthvariant was removed because the length of the key and nonce are now enforced inMediaEncryptionInfo. (#6346) - [breaking] Removed
WithLockingfromEncryptionSyncServiceand replaced it withCrossProcessLockConfig. (#6160) - [breaking] The QrcodeData struct has been reworked in preparation to
support MSC4388. The fields of the QrcodeData struct are not anymore publicly
accessible. The
mode_data()method has been renamed tointent_data()and returns an MSC-specific struct now. Therendezvous_url()method has been removed. (#6081) - [breaking] The
message-idsfeature has been removed. It was already a no-op and has now been eliminated entirely. (#5963)
[0.16.1] - 2026-05-08
Bug fixes
- Check the user ID in the
sender_device_keysproperty of Olm-encrypted to-device events to prevent sender spoofing by homeserver owners. (#6553)
[0.16.0] - 2025-12-04
Features
- When we receive an inbound Megolm session from two different sources, merge the two copies together to get the best of both. (#5865
- When constructing a key bundle for history sharing, if we had received a key bundle ourselves, in which one or more sessions was marked as “history not shared”, pass that on to the new user. (#5820
- Expose new method
CryptoStore::get_withheld_sessions_by_room_id. (#5819) - Use new withheld code in key bundles for sessions not marked as
shared_history. (#5807, (#5834) - Improve feedback support for shared history when downloading room key
bundles.
(#5737)
- Add
RoomKeyWithheldEntryenum, wrapping either a received to-devicem.room_key.withheldevent or its content, if derived from a downloaded room key bundle. OlmMachine::receive_room_key_bundlenow appends withheld key information to the store.- [breaking]
Changes::withheld_session_infonow stores aRoomKeyWithheldEntryin eachroom-id-session-identry. - [breaking]
CryptoStore::get_withheld_infonow returnsResult<Option<RoomKeyWithheldEntry>>. This change also affectsMemoryStore.
- Add
- [breaking] Add
namefields to some of the variants ofstore::SecretImportErrorto indicate what secret was being imported when the error occurred. (#5647)
Bug fixes
- Fix a bug which caused encrypted to-device messages from unknown devices to be ignored. (#5763)
- Fix a bug which caused history shared on invite to be ignored when “exclude insecure devices” was enabled. (#5763)
- Fix a bug introduced in 0.14.0 which meant that the serialization of the value
returned by
OtherUserIdentity::verification_request_contentdid not include amsgtypefield. (#5642)
[0.14.0] - 2025-09-04
Features
- Log message index for Megolm sessions received over encrypted to-device messages. (#5599)
- Add
RoomSettings::encrypt_state_eventsflag. (#5511) - Make sure to accept historic room key bundles only if the sender is trusted enough. (#5510)
- [breaking]: When in “exclude insecure devices” mode, refuse to decrypt
incoming to-device messages from unverified devices, except for some
exceptions for certain event types. To support this, a new variant has been
added to
ProcessedToDeviceEvent:UnverifiedSender, which is returned fromOlmMachine::receive_sync_changeswhen we are excluding insecure devices and the sender’s device is not verified. Also, several methods now take aDecryptionSettingsargument to allow controlling the processing of to-device events based on those settings. To recreate the previous behaviour pass in:DecryptionSettings { sender_device_trust_requirement: TrustRequirement::Untrusted }. Affected methods areOlmMachine::receive_sync_changes,RehydratedDevice::receive_events, and several internal methods. (#5319) - [breaking] The
Device::encrypt_event_rawand (experimental)OlmMachine::encrypt_content_for_deviceshave newshare_strategyparameters to ensure that the recipients are sufficiently trusted. (#5457)
Refactor
- [breaking] The
sender_keyanddevice_idfields ofencrypted::MegolmV1AesSha2Contentandroom_key_request::MegolmV1AesSha2Contentare now optional. The have been deprecated in Matrix 1.3 and are no longer required. (#5489)
[0.13.0] - 2025-07-10
Features
- [breaking] Add a new
VerificationLevel::MismatchedSenderto indicate that the sender of an event appears to have been tampered with. (#5219)
Refactor
- [breaking] The
PendingChanges,Changes,StoredRoomKeyBundleData,TrackedUser,IdentityChanges,DeviceChanges,DeviceUpdates,IdentityUpdates,BackupDecryptionKey,DehydratedDeviceKey,RoomKeyCounts,BackupKeys,CrossSigningKeyExport,UserKeyQueryResult,RoomSettings,RoomKeyInfo, andRoomKeyWithheldInfotypes have been moved from thestoremodule into a newstore/typesmodule. (#5177)
[0.12.0] - 2025-06-10
Features
[breaking] The
ProcessedToDeviceEvent::Decryptedvariant now also have anEncryptionInfofield. Format changed fromDecrypted(Raw<AnyToDeviceEvent>)toDecrypted { raw: Raw<AnyToDeviceEvent>, encryption_info: EncryptionInfo) }(#5074)[breaking] Move
session_idfromEncryptionInfotoAlgorithmInfoas it is megolm specific. UseEncryptionInfo::session_id()helper for quick access. (#4981)Send stable identifier
sender_device_keysfor MSC4147 (Including device keys with Olm-encrypted events). (#4964)Add experimental APIs for sharing encrypted room key history with new members,
Store::build_room_key_bundleandOlmMachine::share_room_key_bundle_data. (#4775, #4864)Check the
sender_device_keysfield on all incoming Olm-encrypted to-device messages and ignore any to-device messages which include the field but whose data is invalid (as per MSC4147). (#4922)Fix bug which caused room keys to be unnecessarily rotated on every send in the presence of blacklisted/withheld devices in the room. (#4954)
Fix #2729 which in rare cases can cause room key oversharing. (#4975)
[breaking]
OlmMachine.receive_sync_changesreturns now a list ofProcessedToDeviceEventinstead of a list ofRaw<AnyToDeviceEvent>. With variants likeDecrypted|UnableToDecrypt|PlainText|NotProcessed. This allows for example to make the difference between an event sent in clear and an event successfully decrypted. For quick compatibility a helperProcessedToDeviceEvent::to_rawallows to map back to the previous behaviour. (#4935)
[0.11.1] - 2025-06-10
Security fixes
- Check the sender of an event matches owner of session, preventing sender spoofing by homeserver owners. 13c1d20 (High, CVE-2025-48937, GHSA-x958-rvg6-956w).
Bug fixes
- Remove a wildcard enum variant import which breaks compilation if used with
tracing-attributesversion0.1.29. This is a workaround for a bug intracing-attributes. (#5190) (#5191) (#5193)
[0.11.0] - 2025-04-11
Features
[breaking] Add support for the shared history flag defined in MSC3061. The shared history flag is now respected when room keys are received as an
m.room_keyevent as well as when they are imported from a backup or a file export. We also ensure to set the flag when we send out room keys. Due to this, a new argument to the constructor forroom_key::MegolmV1AesSha2Contenthas been added andPickledInboundGroupSessionhas received a newshared_historyfield that defaults tofalse.(#4700)Have the
RoomIdentityProviderreturn processing changes when identities transition toIdentityState::Verifiedtoo. (#4670)
[0.10.0] - 2025-02-04
Features
[breaking]
CollectStrategy::DeviceBasedStrategyis now split into three separate strategies (AllDevices,ErrorOnVerifiedUserProblem,OnlyTrustedDevices), to make the behaviour clearer. (#4581)Accept stable identifier
sender_device_keysfor MSC4147 (Including device keys with Olm-encrypted events). (#4420)Room keys are not shared with unsigned dehydrated devices. (#4551)
[0.9.0] - 2024-12-18
Features
[breaking] Expose new API
DehydratedDevices::get_dehydrated_device_pickle_key,DehydratedDevices::save_dehydrated_device_pickle_keyandDehydratedDevices::delete_dehydrated_device_pickle_keyto store/load the dehydrated device pickle key. This allows client to automatically rotate the dehydrated device to avoid one-time-keys exhaustion and to_device accumulation.DehydratedDevices::keys_for_uploadandDehydratedDevices::rehydratenow use theDehydratedDeviceKeyas parameter instead of a raw byte array. UseDehydratedDeviceKey::from_bytesto migrate. (#4383)Add extra logging in
OtherUserIdentity::pin_current_master_keyandOtherUserIdentity::withdraw_verification. (#4415)Added new
UtdCausevariantsWithheldForUnverifiedOrInsecureDeviceandWithheldBySender. These variants provide clearer categorization for expected Unable-To-Decrypt (UTD) errors when the sender either did not wish to share or was unable to share the room_key. (#4305)UtdCausehas two new variants that replace the existingHistoricalMessage:HistoricalMessageAndBackupIsDisabledandHistoricalMessageAndDeviceIsUnverified. These give more detail about what went wrong and allow us to suggest to users what actions they can take to fix the problem. See the doc comments on these variants for suggested wording. (#4384)
[0.8.0] - 2024-11-19
Features
Pin identity when we withdraw verification.
Expose new method
OlmMachine::room_keys_withheld_received_stream, to allow applications to receive notifications about receivedm.room_key.withheldevents. (#3660), (#3674)Expose new method
OlmMachine::clear_crypto_cache(), with FFI bindings. (#3462)Expose new method
OlmMachine::upload_device_keys(). (#3457)Expose new method
CryptoStore::import_room_keys. (#3448)Expose new method
BackupMachine::backup_version. (#3320)Add data types to parse the QR code data for the QR code login defined in. MSC4108
Expose new method
CryptoStore::clear_caches. (#3338)Expose new method
OlmMachine::device_creation_time. (#3275)Log more details about the Olm session after encryption and decryption. (#3242)
When Olm message decryption fails, report the error code(s) from the failure. (#3212)
Expose new methods
OlmMachine::set_room_settingsandOlmMachine::get_room_settings. (#3042)Add new properties
session_rotation_periodandsession_rotation_period_msgstostore::RoomSettings. (#3042)Fix bug which caused
SecretStorageKeyto incorrectly reject secret storage keys whose metadata lacked check fields. (#3046)Add new API
Device::encrypt_event_rawthat allows to encrypt an event to a specific device. (#3091)Add new API
store::Store::export_room_keys_streamthat provides room keys on demand.Include event timestamps on logs from event decryption. (#3194)
Refactor
Fix #4424 Failed storage upgrade for “PreviouslyVerifiedButNoLonger”. This bug caused errors to occur when loading crypto information from storage, which typically prevented apps from starting correctly. (#4430)
Add new method
OlmMachine::try_decrypt_room_event. (#4116)Add reason code to
matrix_sdk_common::deserialized_responses::UnableToDecryptInfo. (#4116)[breaking] The
UserIdentitystruct has been renamed toOtherUserIdentity. (#4036)[breaking] The
UserIdentitiesenum has been renamed toUserIdentity. (#4036)Change the withheld code for keys not shared due to the
IdentityBasedStrategy, fromm.unauthorisedtom.unverified. (#3985)Improve logging for undecryptable Megolm events. (#3989)
Miscellaneous improvements to logging for verification and
OwnUserIdentityupdates. (#3949)Update
SenderDataon existing inbound group sessions when we receive updates via/keys/query. (#3849)Add message IDs to all outgoing to-device messages encrypted by
matrix-sdk-crypto. Themessage-idsfeature ofmatrix-sdk-cryptoandmatrix-sdk-baseis now a no-op. (#3776)Log the content of received
m.room_key.withheldto-device events. (#3591)Attempt to decrypt bundled events (reactions and the latest thread reply) if they are found in the unsigned part of an event. (#3468)
Sign the device keys with the user-identity (i.e. cross-signing keys) if we’re uploading the device keys and if the cross-signing keys are available. This approach eliminates the need to upload signatures in a separate request, ensuring that other users/devices will never encounter this device without a signature from their user identity. Consequently, they will never see the device as unverified. (#3453)
Avoid emitting entries from
identities_stream_rawanddevices_streamwhen we receive a/keys/queryresponse which shows that no devices changed. (#3442)Fallback keys are rotated in a time-based manner, instead of waiting for the server to tell us that a fallback key got used. (#3151)
Breaking changes:
[breaking]
VerificationRequestState::Transitionednow includes a new fieldother_device_dataof typeDeviceData. (#4153)[breaking]
OlmMachine::decrypt_room_eventnow returns aDecryptedRoomEventtype, instead of the more genericTimelineEventtype.[breaking] NOTE: this version causes changes to the format of the serialised data in the CryptoStore, meaning that, once upgraded, it will not be possible to roll back applications to earlier versions without breaking user sessions.
[breaking] Renamed
VerificationLevel::PreviouslyVerifiedtoVerificationLevel::VerificationViolation.[breaking]
OlmMachine::decrypt_room_eventnow takes aDecryptionSettingsargument, which includes aTrustRequirementindicating the required trust level for the sending device. When it is called withTrustRequirementother thanTrustRequirement::Unverified, it may return the newMegolmError::SenderIdentityNotTrustedvariant if the sending device does not satisfy the required trust level. (#3899)[breaking] Change the structure of the
SenderDataenum to separate variants for previously-verified, unverified and verified. (#3877)[breaking] Where
EncryptionInfois returned it may include the newPreviouslyVerifiedvariant ofVerificationLevelto indicate that the user was previously verified and is no longer verified. (#3877)[breaking] Expose new methods
OwnUserIdentity::was_previously_verified,OwnUserIdentity::withdraw_verification, andOwnUserIdentity::has_verification_violation, which track whether our own identity was previously verified. (#3846)[breaking] Add a new
error_on_verified_user_problemproperty toCollectStrategy::DeviceBasedStrategy, which, when set, causesOlmMachine::share_room_keyto fail with an error if any verified users on the recipient list have unsigned devices, or are no longer verified.When
CallectStrategy::IdentityBasedStrategyis used,OlmMachine::share_room_keywill fail with an error if any verified users on the recipient list are no longer verified, or if our own device is not properly cross-signed.Also remove
CollectStrategy::new_device_based: callers should construct aCollectStrategy::DeviceBasedStrategydirectly.EncryptionSettings::newnow takes aCollectStrategyargument, instead of a list of booleans. (#3810) (#3816) (#3896)[breaking] Remove the method
OlmMachine::clear_crypto_cache(), crypto stores are not supposed to have any caches anymore.[breaking] Add a
custom_accountargument to theOlmMachine::with_store()method, this allows users to learn their identity keys before they get access to the user and device ID. (#3451)[breaking] Add a
backup_versionargument toCryptoStore’sinbound_group_sessions_for_backup,mark_inbound_group_sessions_as_backed_upandinbound_group_session_countsmethods. (#3253)[breaking] Rename the
OlmMachine::invalidate_group_sessionmethod toOlmMachine::discard_room_key.[breaking] Move
OlmMachine::export_room_keystomatrix_sdk_crypto::store::Store. (Call it witholm_machine.store().export_room_keys(...).)[breaking] Add new
dehydratedproperty toolm::account::PickledAccount. (#3164)[breaking] Remove deprecated
OlmMachine::import_room_keys. (#3448)[breaking] Add the
SasState::Createdvariant to differentiate the state between the party that sent the verification start and the party that received it.[breaking] Deprecate
BackupMachine::import_backed_up_room_keys. (#3448)
0.7.2
Security fixes
- Fix
UserIdentity::is_verifiedto take into account our own identity #d8d9dae (Moderate, GHSA-4qg4-cvh2-crgg).
0.7.1
Security fixes
- Don’t log the private part of the backup key, introduced in #71136e4.
0.7.0
Add method to mark a list of inbound group sessions as backed up:
CryptoStore::mark_inbound_group_sessions_as_backed_upOlmMachine::toggle_room_key_forwardingis replaced by two separate methods:OlmMachine::set_room_key_requests_enabled, which controls whether outgoing room key requests are enabled, and:OlmMachine::set_room_key_forwarding_enabled, which controls whether we automatically reply to incoming room key requests.
OlmMachine::is_room_key_forwarding_enabledis updated to return the setting ofOlmMachine::set_room_key_forwarding_enabled, whileOlmMachine::are_room_key_requests_enabledis added to return the setting ofOlmMachine::set_room_key_requests_enabled.(#2902)
Improve performance of
share_room_key. (#2862)get_missing_sessions: Don’t block waiting for/keys/queryrequests on blacklisted servers, and improve performance. (#2845)Generalize
olm::Session::encryptto accept any value implementingSerializefor thevalueparameter, instead of specificallyserde_json::Value. Note that references toSerialize-implementing types themselves implementSerialize.Change the argument to
OlmMachine::receive_sync_changesto be anEncryptionSyncChangesstruct packing all the arguments instead of many single arguments. The newnext_batch_tokenfield there should be thenext_batchvalue read from the latest sync response.Handle missing devices in
/keys/claimresponses. (#2805)Add the higher level decryption method
decrypt_session_datato theBackupDecryptionKeytype.Add a higher level method to create signatures for the backup info. The
OlmMachine::backup_machine()::sign_backup()method can be used to add signatures to aRoomKeyBackupInfo.Remove the
backups_v1feature, backups support is now enabled by default.Use the
Signaturestype as the return value for theMegolmV1BackupKey::signatures()method.Add two new methods to import room keys,
OlmMachine::store()::import_exported_room_keys()for file exports andOlmMachine::backup_machine()::import_backed_up_room_keys()for backups. TheOlmMachine::import_room_keys()method is now deprecated.The parameter order of
OlmMachine::encrypt_room_event_rawandOutboundGroupSession::encrypthas changed,contentis now last- The parameter type of
contenthas also changed, fromserde_json::Valueto&Raw<AnyMessageLikeEventContent>
- The parameter type of
Change the return value of
bootstrap_cross_signingso it returns an extra keys upload request. The three requests must be sent in the order they appear in the return tuple.Stop logging large quantities of data about the
Storeduring olm decryption.Remove spurious “Unknown outgoing secret request” warning which was logged for every outgoing secret request.
Clean up the logging of to-device messages in
share_room_key.Expose new
OlmMachine::get_room_event_encryption_infomethod.Add support for secret storage.
Add initial support for MSC3814 - dehydrated devices.
Mark our
OwnUserIdentityas verified if we successfully import the matching private keys.The
OlmMachine::export_cross_signing_keys()method now returns aResult. This removes anunwrap()from the codebase.Add support for the
hkdf-hmac-sha256.v2SAS message authentication code.Ensure that the correct short authentication strings are used when accepting a SAS verification with the
Sas::accept()method.Add a new optional
message-idsfeature which adds a unique ID to the content ofm.room.encryptedevent contents which get sent out.Disable the automatic-key-forwarding feature by default.
Add a new variant to the
VerificationRequestStateenum calledTransitioned. This enum variant is used when aVerificationRequesttransitions into a concreteVerificationobject. The concreteVerificationobject is given as associated data in theTransitionedenum variant.Replace the libolm backup encryption code with a native Rust version. This adds WASM support to the backups_v1 feature.
Add new API
store::Store::room_keys_received_streamto provide updates of room keys being received.Add new method
identities::device::Device::first_time_seen_tsthat allows to get a local timestamp of when the device was first seen by the sdk (in seconds since epoch).When rejecting a key-verification request over to-device messages, send the
m.key.verification.cancelto the device that made the request, rather than broadcasting to all devices.Expose
VerificationRequest::time_remaining.For verification-via-emojis, return the word “Aeroplane” rather than “Airplane”, for consistency with the Matrix spec.
Fix handling of SAS verification start events once we have shown a QR code.
Fix a bug which could cause generated one-time-keys not to be persisted.
Fix parsing error for
POST /_matrix/client/v3/keys/signatures/uploadresponses generated by Synapse.Add new API
OlmMachine::query_keys_for_usersfor generating out-of-band key queries.Rename “recovery key” to “backup decryption key” to avoid confusion with the secret-storage key which is also known as a recovery key.
This affects the
matrix_sdk_crypto::store::RecoveryKeystruct itself (now renamed toBackupDecryptionKey, as well asBackupMachine::save_recovery_key(nowsave_decryption_key).Change the returned success value type of
BackupMachine::backupfromOutgoingRequestto(OwnedTransactionId, KeysBackupRequest).