{"id":"CVE-2022-39254","aliases":["DEBIAN-CVE-2022-39254","EUVD-2022-6957","GHSA-w4pr-4vjg-hffh","PYSEC-2026-842","UBUNTU-CVE-2022-39254"],"status":"published","title":"When matrix-nio receives forwarded room keys, the receiver doesn't check if it requested the key from the forwarder","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.","severity":{"version":"3.1","score":8.6,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-10","score":0.00678,"percentile":0.52649,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-287","CWE-322"],"published":"2022-09-29T14:35:10Z","modified":"2026-11-11T02:31:13Z","fixes":[{"ecosystem":"PyPI","package":"matrix-nio","fixed_in":["0.20"],"sources":["ghsa","osv"]},{"ecosystem":"Debian:12","package":"python-matrix-nio","fixed_in":["0.20.0-1"],"sources":["osv"]},{"ecosystem":"Debian:13","package":"python-matrix-nio","fixed_in":["0.20.0-1"],"sources":["osv"]},{"ecosystem":"Debian:14","package":"python-matrix-nio","fixed_in":["0.20.0-1"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"PyPI","package":"matrix-nio","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.20"}]}]},{"source":"osv","ecosystem":"Debian:12","package":"python-matrix-nio","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.20.0-1"}]}]},{"source":"osv","ecosystem":"Debian:13","package":"python-matrix-nio","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.20.0-1"}]}]},{"source":"osv","ecosystem":"Debian:14","package":"python-matrix-nio","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.20.0-1"}]}]},{"source":"osv","ecosystem":"PyPI","package":"matrix-nio","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.20"}]}],"versions":["0.10.0","0.11.0","0.11.1","0.11.2","0.12.0","0.13.0","0.14.0","0.14.1","0.15.0","0.15.1","0.15.2","0.16.0","0.17.0","0.18.0","0.18.1","0.18.2","0.18.3","0.18.4","0.18.5","0.18.6","0.18.7","0.19.0","0.2","0.3","0.4","0.4.1","0.5","0.6","0.7","0.7.1","0.7.2","0.8.0","0.9.0"]},{"source":"osv","ecosystem":"PyPI","package":"matrix-nio","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.20"}]}],"versions":["0.10.0","0.11.0","0.11.1","0.11.2","0.12.0","0.13.0","0.14.0","0.14.1","0.15.0","0.15.1","0.15.2","0.16.0","0.17.0","0.18.0","0.18.1","0.18.2","0.18.3","0.18.4","0.18.5","0.18.6","0.18.7","0.19.0","0.2","0.3","0.4","0.4.1","0.5","0.6","0.7","0.7.1","0.7.2","0.8.0","0.9.0"]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"python-matrix-nio","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.16.0-1","0.18.7-1","0.19.0-2"]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"python-matrix-nio","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.21.2-1","0.23.0-1","0.24.0-1"]},{"source":"osv","ecosystem":"Ubuntu:25.10","package":"python-matrix-nio","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.25.2-1"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"python-matrix-nio","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.25.2-2"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"python-matrix-nio","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.25.2-1","0.25.2-2"]}],"products":[{"vendor":"matrix-nio_project","product":"matrix-nio"},{"vendor":"poljar","product":"matrix-nio"}],"references":[{"url":"https://github.com/poljar/matrix-nio/security/advisories/GHSA-w4pr-4vjg-hffh","tags":["x_refsource_CONFIRM","x_transferred","Third Party Advisory","advisory","web","report"]},{"url":"https://github.com/poljar/matrix-nio/commit/b1cbf234a831daa160673defd596e6450e9c29f0","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web","report"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-39254","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-w4pr-4vjg-hffh","tags":["advisory"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/39xxx/CVE-2022-39254.json","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2022-39254","tags":["advisory"]},{"url":"https://github.com/poljar/matrix-nio","tags":["package"]},{"url":"https://pypi.org/project/matrix-nio","tags":["package"]},{"url":"https://ubuntu.com/security/CVE-2022-39254","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2022-39254","tags":["report"]}],"sources":{"cve":[{"id":"CVE-2022-39254","title":"When matrix-nio receives forwarded room keys, the receiver doesn't check if it requested the key from the forwarder","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.","status":"published","published":"2022-09-29T14:35:10Z","modified":"2025-04-23T16:53:59.84Z","cvss":[{"version":"3.1","score":8.6,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N","level":"high","assessor":"cna"}],"cwes":["CWE-322","CWE-287"],"updated_at":"2026-11-02T14:34:39.233406Z"}],"euvd":[{"id":"EUVD-2022-6957","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.","status":"published","published":"2022-09-29T14:35:10Z","modified":"2025-04-23T16:53:59Z","cvss":[{"version":"3.1","score":8.6,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N","level":"high"}],"updated_at":"2026-11-02T20:52:11.440801Z"}],"ghsa":[{"id":"GHSA-w4pr-4vjg-hffh","title":"When matrix-nio receives forwarded room keys, the receiver doesn't check if it requested the key from the forwarder","description":"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.\n\nThis allows a malicious homeserver to insert room keys of questionable validity into the key store in some situations, potentially assisting in an impersonation attack.\n\n### For more information\nIf you have any questions or comments about this advisory, e-mail us at [poljar@termina.org.uk](mailto:poljar@termina.org.uk).","status":"published","published":"2022-09-30T22:56:17Z","modified":"2023-09-07T20:46:29Z","cvss":[{"version":"3.1","score":8.6,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N","level":"high"}],"cwes":["CWE-287","CWE-322"],"updated_at":"2026-11-02T14:37:03.287418Z"}],"nvd":[{"id":"CVE-2022-39254","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.","status":"published","published":"2022-09-29T15:15:10.513Z","modified":"2026-06-17T04:58:00.4Z","cvss":[{"version":"3.1","score":8.6,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N","level":"high","assessor":"secondary"},{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N","level":"medium","assessor":"primary"}],"cwes":["CWE-287","CWE-322"],"updated_at":"2026-11-02T14:07:29.026521Z"}],"osv":[{"id":"CVE-2022-39254","title":"When matrix-nio receives forwarded room keys, the receiver doesn't check if it requested the key from the forwarder","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.","status":"published","published":"2022-09-29T14:35:10Z","modified":"2026-11-11T02:31:13.493117023Z","cvss":[{"version":"3.1","score":8.6,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N","level":"high"}],"cwes":["CWE-287","CWE-322"],"updated_at":"2026-11-11T02:50:43.46164Z"},{"id":"DEBIAN-CVE-2022-39254","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.","status":"published","published":"2022-09-29T15:15:10.513Z","modified":"2026-11-03T08:03:55.019467981Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N","level":"medium"}],"updated_at":"2026-11-03T08:23:34.488036Z"},{"id":"GHSA-w4pr-4vjg-hffh","title":"When matrix-nio receives forwarded room keys, the receiver doesn't check if it requested the key from the forwarder","description":"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.\n\nThis allows a malicious homeserver to insert room keys of questionable validity into the key store in some situations, potentially assisting in an impersonation attack.\n\n### For more information\nIf you have any questions or comments about this advisory, e-mail us at [poljar@termina.org.uk](mailto:poljar@termina.org.uk).","status":"published","published":"2022-09-30T22:56:17Z","modified":"2026-07-07T11:56:11.195093339Z","cvss":[{"version":"3.1","score":8.6,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N","level":"high"}],"cwes":["CWE-287","CWE-322"],"updated_at":"2026-11-02T15:46:58.04805Z"},{"id":"PYSEC-2026-842","title":"When matrix-nio receives forwarded room keys, the receiver doesn't check if it requested the key from the forwarder","description":"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.\n\nThis allows a malicious homeserver to insert room keys of questionable validity into the key store in some situations, potentially assisting in an impersonation attack.\n\n### For more information\nIf you have any questions or comments about this advisory, e-mail us at [poljar@termina.org.uk](mailto:poljar@termina.org.uk).","status":"published","published":"2026-07-07T10:17:22.451432Z","modified":"2026-07-07T11:46:05.855618817Z","cvss":[{"version":"3.1","score":8.6,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N","level":"high"}],"updated_at":"2026-11-02T15:52:58.117212Z"},{"id":"UBUNTU-CVE-2022-39254","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.","status":"published","published":"2022-09-29T15:15:00Z","modified":"2026-10-17T12:57:15.077454316Z","cvss":[{"version":"3.1","score":8.6,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N","level":"high"},{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N","level":"medium"}],"updated_at":"2026-11-02T16:53:55.502114Z"}]}}
