CVE-2022-39257
JSON

7.5high

Matrix iOS SDK vulnerable to impersonation via forwarded Megolm sessions

Severity
7.5high CVSS:3.1 by GitHub_M
Exploit likelihood
1.02% (higher than 64% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M

Description

Matrix iOS SDK allows developers to build iOS apps compatible with Matrix. Prior to version 0.23.19, an attacker cooperating with a malicious homeserver can construct messages appearing to have come from another person. Such messages will be marked with a grey shield on some platforms, but this may be missing in others. This attack is possible due to the matrix-ios-sdk implementing a too permissive key forwarding strategy. The default policy for accepting key forwards has been made more strict in the matrix-ios-sdk version 0.23.19. matrix-ios-sdk will now only accept forwarded keys in response to previously issued requests and only from own, verified devices. The SDK now sets a `trusted` flag on the decrypted message upon decryption, based on whether the key used to decrypt the message was received from a trusted source. Clients need to ensure that messages decrypted with a key with `trusted = false` are decorated appropriately (for example, by showing a warning for such messages). This attack requires coordination between a malicious home server and an attacker, so those who trust their home servers do not need a workaround.

Affected

Product or packageVersionsReported by
matrix-org matrix-ios-sdk< 0.23.19CVE List
matrix software_development_kitbefore 0.23.19NVD

All scores

GitHub_M7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Classification

CWE-287CWE-322

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

Matrix iOS SDK allows developers to build iOS apps compatible with Matrix. Prior to version 0.23.19, an attacker cooperating with a malicious homeserver can construct messages appearing to have come from another person. Such messages will be marked with a grey shield on some platforms, but this may be missing in others. This attack is possible due to the matrix-ios-sdk implementing a too permissive key forwarding strategy. The default policy for accepting key forwards has been made more strict in the matrix-ios-sdk version 0.23.19. matrix-ios-sdk will now only accept forwarded keys in response to previously issued requests and only from own, verified devices. The SDK now sets a `trusted` flag on the decrypted message upon decryption, based on whether the key used to decrypt the message was received from a trusted source. Clients need to ensure that messages decrypted with a key with `trusted = false` are decorated appropriately (for example, by showing a warning for such messages). This attack requires coordination between a malicious home server and an attacker, so those who trust their home servers do not need a workaround.

NVD (es)

Matrix iOS SDK permite a los desarrolladores crear aplicaciones para iOS compatibles con Matrix. En versiones anteriores a 0.23.19, un atacante que colabore con un servidor doméstico malicioso puede construir mensajes que parezcan proceder de otra persona. Dichos mensajes estarán marcados con un escudo gris en algunas plataformas, pero éste puede faltar en otras. Este ataque es posible debido a que el matrix-ios-sdk implementa una estrategia de reenvío de claves demasiado permisiva. La política por defecto para aceptar reenvíos de claves se ha hecho más estricta en matrix-ios-sdk versión 0.23.19. matrix-ios-sdk ahora sólo aceptará claves reenviadas en respuesta a peticiones previamente emitidas y sólo desde dispositivos propios y verificados. El SDK ahora establece un flag "trusted" en el mensaje descifrado al descifrarlo, basándose en si la clave usada para descifrar el mensaje fue recibida de una fuente confiable. Los clientes deben asegurarse de que los mensajes descifrados con una clave con "trusted = false" sean decorados apropiadamente (por ejemplo, mostrando una advertencia para tales mensajes). Este ataque requiere la coordinación entre un servidor doméstico malicioso y un atacante, por lo que aquellos que confían en sus servidores domésticos no necesitan una mitigación

References

Sources

SourceRecordLicence
CVE ListCVE-2022-39257 changed 2025-04-23CVE Terms of Use
NVDCVE-2022-39257 changed 2026-06-17Public domain