Vulnerability advisory

CVE-2022-39250

Matrix JavaScript SDK vulnerable to key/device identifier confusion in SAS verification

Published Updated OSV record ↗

Also known as GHSA-5w8r-8pgj-5jmf

Severity
  • CVSS 3.xCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N

Affected versions

Repository

Affected commitsFixed by commit
GIT github.com/matrix-org/matrix-js-sdk ↗
All commits before 2d067ad95778b26aed24b801be0951e215c3ac8c2d067ad95778b26aed24b801be0951e215c3ac8c
Not specifieda587d7c36026fe1fcf93dfff63588abee359be76
Also listed as affected (57)
  • v19.6.0
  • v19.6.0-rc.1
  • v8.1.0
  • v8.1.0-rc.1
  • v8.0.0
  • v7.1.0
  • v7.1.0-rc.1
  • v5.0.1
  • v2.4.1
  • v2.0.1
  • v2.0.1-rc.2
  • v2.0.1-rc.1
  • v1.0.0
  • v1.0.0-rc.2
  • v1.0.0-rc.1
  • v0.11.0
  • v0.11.0-rc.1
  • v0.10.7
  • v0.10.7-rc.1
  • v0.10.5
  • v0.10.5-rc.1
  • v0.10.3
  • v0.10.2
  • v0.10.3-rc.1
  • v0.10.2-rc.1
  • v0.8.3
  • v0.8.3-rc.1
  • v0.8.2
  • v0.8.1
  • v0.8.1-rc.1
  • v0.8.0
  • v0.7.10
  • v0.7.9
  • v0.7.4
  • v0.7.4-rc.1
  • v0.7.2
  • v0.7.1-rc.1
  • v0.6.4
  • v0.6.4-rc.2
  • v0.6.2
  • v0.6.1
  • v0.6.0-rc2
  • v0.6.0-rc1
  • v0.5.6
  • v0.5.5
  • v0.5.4
  • v0.5.3
  • v0.5.2
  • v0.5.1
  • v0.5.0
  • v0.4.2
  • v0.4.1
  • v0.2.2
  • v0.2.1
  • v0.2.0
  • v0.1.1
  • v0.1.0

Description

Matrix JavaScript SDK is the Matrix Client-Server software development kit (SDK) for JavaScript. Prior to version 19.7.0, an attacker cooperating with a malicious homeserver could interfere with the verification flow between two users, injecting its own cross-signing user identity in place of one of the users’ identities. This would lead to the other device trusting/verifying the user identity under the control of the homeserver instead of the intended one. The vulnerability is a bug in the matrix-js-sdk, caused by checking and signing user identities and devices in two separate steps, and inadequately fixing the keys to be signed between those steps. Even though the attack is partly made possible due to the design decision of treating cross-signing user identities as Matrix devices on the server side (with their device ID set to the public part of the user identity key), no other examined implementations were vulnerable. Starting with version 19.7.0, the matrix-js-sdk has been modified to double check that the key signed is the one that was verified instead of just referencing the key by ID. An additional check has been made to report an error when one of the device ID matches a cross-signing key. As this attack requires coordination between a malicious homeserver and an attacker, those who trust their homeservers do not need a particular workaround.

References

  • Codex
  • Claude Code
  • VS Code
  • GitHub Copilot
  • Cursor
  • Cline
  • Windsurf
  • Google Anti-gravity
  • OpenCode
  • Pi
  • Gemini CLI
  • Hermes Agent
  • Zed
  • Junie
  • Qwen Code
  • Kiro
  • Kilo Code
  • Factory Droid

Set up GitHits for your agents

Run this command:

<> bash
npx githits@latest init

What happens next:

  1. Opens your browser to authorize GitHits
  2. Asks whether to set up GitHits at the user or project level
  3. Detects your supported AI coding tools
  4. Lets you choose which tools to configure
  5. Configures the selected tools