Every CVE Search/ Get API key

CVE-2022-39254

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

8.6 HighFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
None
Integrity
High
Availability
None

Exploit likelihood

0.68%Down 0.2 points since Sep 30, 2022
90%50%10%1%

What each source reports

CVE List Score used 8.6

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

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.

Record
CVE-2022-39254
CVSS 3.1
8.6 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N
Weakness
CWE-322, CWE-287
Updated
2026-11-02
EUVDEUVD-2022-6957 8.6

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.

Record
EUVD-2022-6957
CVSS 3.1
8.6 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N
Updated
2026-11-02
GitHub AdvisoriesGHSA-w4pr-4vjg-hffh 8.6

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

When matrix-nio before 0.20 requests a room key from our devices, it correctly accepts key forwards only if they are a response to a previous request. However, it doesn't check that the device that responded matches the device the key was requested from.

This allows a malicious homeserver to insert room keys of questionable validity into the key store in some situations, potentially assisting in an impersonation attack.

For more information

If you have any questions or comments about this advisory, e-mail us at [email protected].

Record
GHSA-w4pr-4vjg-hffh
CVSS 3.1
8.6 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N
Weakness
CWE-287, CWE-322
Updated
2026-11-02
NVD 8.6

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.

Record
CVE-2022-39254
CVSS 3.1
8.6 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N
CVSS 3.1
6.5 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N
Weakness
CWE-287, CWE-322
Updated
2026-11-02
OSV 8.6

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

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.

Record
CVE-2022-39254
CVSS 3.1
8.6 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N
Weakness
CWE-287, CWE-322
Updated
2026-11-02
OSVDEBIAN-CVE-2022-39254 6.5

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.

Record
DEBIAN-CVE-2022-39254
CVSS 3.1
6.5 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N
Updated
2026-11-03
OSVGHSA-w4pr-4vjg-hffh 8.6

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

When matrix-nio before 0.20 requests a room key from our devices, it correctly accepts key forwards only if they are a response to a previous request. However, it doesn't check that the device that responded matches the device the key was requested from.

This allows a malicious homeserver to insert room keys of questionable validity into the key store in some situations, potentially assisting in an impersonation attack.

For more information

If you have any questions or comments about this advisory, e-mail us at [email protected].

Record
GHSA-w4pr-4vjg-hffh
CVSS 3.1
8.6 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N
Weakness
CWE-287, CWE-322
Updated
2026-11-02
OSVPYSEC-2026-842 8.6

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

When matrix-nio before 0.20 requests a room key from our devices, it correctly accepts key forwards only if they are a response to a previous request. However, it doesn't check that the device that responded matches the device the key was requested from.

This allows a malicious homeserver to insert room keys of questionable validity into the key store in some situations, potentially assisting in an impersonation attack.

For more information

If you have any questions or comments about this advisory, e-mail us at [email protected].

Record
PYSEC-2026-842
CVSS 3.1
8.6 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N
Updated
2026-11-02
OSVUBUNTU-CVE-2022-39254 8.6

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.

Record
UBUNTU-CVE-2022-39254
CVSS 3.1
8.6 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N
CVSS 3.1
6.5 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
matrix-nio
PyPI
before 0.20
0.20
python-matrix-nio
Debian:12
before 0.20.0-1
0.20.0-1
python-matrix-nio
Debian:13
before 0.20.0-1
0.20.0-1
python-matrix-nio
Debian:14
before 0.20.0-1
0.20.0-1
matrix-nio
PyPI
before 0.20, plus listed versions
0.10.00.11.00.11.10.11.20.12.0
Show 28 moreShow less
0.13.00.14.00.14.10.15.00.15.10.15.20.16.00.17.00.18.00.18.10.18.20.18.30.18.40.18.50.18.60.18.70.19.00.20.30.40.4.10.50.60.70.7.10.7.20.8.00.9.0
0.20
python-matrix-nio
Ubuntu:22.04:LTS
All versions, plus listed versions
0.16.0-10.18.7-10.19.0-2
None known
python-matrix-nio
Ubuntu:24.04:LTS
All versions, plus listed versions
0.21.2-10.23.0-10.24.0-1
None known
python-matrix-nio
Ubuntu:25.10
All versions, plus listed versions
0.25.2-1
None known
python-matrix-nio
Ubuntu:26.10
All versions, plus listed versions
0.25.2-2
None known
python-matrix-nio
Ubuntu:26.04:LTS
All versions, plus listed versions
0.25.2-10.25.2-2
None known

History

History
RecordedChangedSources
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2022-39254 is a high vulnerability (CVSS 8.6) in Matrix-nio Project Matrix-nio, published September 29, 2022. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.68%, the 52nd percentile. Fixed in matrix-nio 0.20.

References

Show 4 moreShow less
MoveEnter Open