# CVE-2022-39254: When matrix-nio receives forwarded room keys, the receiver doesn't check if it requested the key from the forwarder

- Severity: High 8.6 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.72%, higher than 50% of CVEs (2026-11-30)
- Published: 2022-09-29T14:35:10.000Z
- Modified: 2026-07-07T11:56:11.195Z
- Also known as: GHSA-w4pr-4vjg-hffh, PYSEC-2026-842
- Weaknesses: CWE-287, CWE-322
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial
- Assigned by: GitHub_M

## Description

matrix-nio is a Python Matrix client library, designed according to sans I/O principles. Prior to version 0.20, when a users requests a room key from their devices, the software correctly remember the request. Once they receive a forwarded room key, they accept it without checking who the room key came from. This allows homeservers to try to insert room keys of questionable validity, potentially mounting an impersonation attack. Version 0.20 fixes the issue.

(As written by CVE List.)

## Affected

- poljar matrix-nio: < 0.20
- matrix-nio (PyPI): before 0.20
- matrix-nio_project matrix-nio: before 0.20

## Every score

- GitHub_M: CVSS:3.1 8.6 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N`
- GitHub: CVSS:3.1 8.6 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N`
- NVD: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N`
- PyPA Advisory Database: CVSS:3.1 8.6 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N`

## References

- <https://github.com/poljar/matrix-nio/security/advisories/GHSA-w4pr-4vjg-hffh> (third-party-advisory, web)
- <https://github.com/poljar/matrix-nio/commit/b1cbf234a831daa160673defd596e6450e9c29f0> (patch, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-39254> (advisory)
- <https://github.com/poljar/matrix-nio> (package)
- <https://pypi.org/project/matrix-nio> (package)
- <https://github.com/advisories/GHSA-w4pr-4vjg-hffh> (advisory)

## Sources

- CVE List: [CVE-2022-39254](https://www.cve.org/CVERecord?id=CVE-2022-39254), CVE Terms of Use, modified 2025-04-23
- GitHub Advisory Database: [GHSA-w4pr-4vjg-hffh](https://github.com/advisories/GHSA-w4pr-4vjg-hffh), CC-BY-4.0, modified 2026-07-07
- NVD: [CVE-2022-39254](https://nvd.nist.gov/vuln/detail/CVE-2022-39254), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2026-842](https://osv.dev/vulnerability/PYSEC-2026-842), CC-BY-4.0, modified 2026-07-07

---

Page: https://cve.day/CVE-2022-39254 · Whole record: https://cve.day/CVE-2022-39254.json · Rebuilt by cve.day 2026-11-25T22:58:15.373Z
