CVE-2021-40823

CVE-2021-40823 is a medium-severity use of a broken or risky cryptographic algorithm vulnerability in matrix-js-sdk (npm), affecting versions < 12.4.1. It is fixed in 12.4.1.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

matrix-js-sdk can be tricked into disclosing E2EE room keys to a participating homeserver

Workarounds

To prevent a homeserver from being able to steal the room keys, vulnerable clients can be taken offline or signed out. If signing out, care should be taken to either set up Secure Backup or export E2E room keys in order to preserve access to past messages.

Impact

A logic error in the room key sharing functionality of matrix-js-sdk before 12.4.1 allows a malicious Matrix homeserver† participating in an encrypted room to steal room encryption keys from affected Matrix clients participating in that room. This allows the homeserver to decrypt end-to-end encrypted messages sent by affected clients.

† Or anyone with access to the account of the original recipient of an encrypted message.

Known clients affected (via their use of vulnerable versions of matrix-js-sdk):

  • Element Web (1.8.2 and earlier)
  • Element Desktop (1.8.2 and earlier)
  • SchildiChat Web (1.7.32-sc1 and earlier)
  • SchildiChat Desktop (1.7.32-sc1 and earlier)
  • Cinny (1.2.0 and earlier)

The application uses a cryptographic algorithm known to have weaknesses, such as MD5, SHA-1, or DES. Typical impact: compromised confidentiality or integrity of protected data.

CVE-2021-40823 has a CVSS score of 5.9 (Medium). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (12.4.1); upgrading removes the vulnerable code path.

Affected versions

matrix-js-sdk (< 12.4.1)

Security releases

matrix-js-sdk → 12.4.1 (npm)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

This was fixed in https://github.com/matrix-org/matrix-js-sdk/commit/894c24880da0e1cc81818f51c0db80e3c9fb2be9.

Frequently Asked Questions

  1. What is CVE-2021-40823? CVE-2021-40823 is a medium-severity use of a broken or risky cryptographic algorithm vulnerability in matrix-js-sdk (npm), affecting versions < 12.4.1. It is fixed in 12.4.1. The application uses a cryptographic algorithm known to have weaknesses, such as MD5, SHA-1, or DES.
  2. How severe is CVE-2021-40823? CVE-2021-40823 has a CVSS score of 5.9 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of matrix-js-sdk are affected by CVE-2021-40823? matrix-js-sdk (npm) versions < 12.4.1 is affected.
  4. Is there a fix for CVE-2021-40823? Yes. CVE-2021-40823 is fixed in 12.4.1. Upgrade to this version or later.
  5. Is CVE-2021-40823 exploitable, and should I be worried? Whether CVE-2021-40823 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2021-40823 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2021-40823? Upgrade matrix-js-sdk to 12.4.1 or later.

Other vulnerabilities in matrix-js-sdk

Stop the waste.
Protect your environment with Kodem.