CVE-2023-38691 matrix-appservice-bridge doesn't verify the sub parameter of an openId token exhange, allowing unauthorized access to provisioning APIs
A malicious Matrix server can impersonate users via OpenID token exchange flaws, allowing unauthorized access to provisioning APIs in the matrix-appservice-bridge library.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2023-38691?
CVE-2023-38691 is a medium-severity authentication bypass vulnerability in matrix-org matrix-appservice-bridge, published on 4 Aug 2023. Any signed-in user can exploit it over the network, with no action from the victim.
Official description
matrix-appservice-bridge provides an API for setting up bridges. Starting in version 4.0.0 and prior to versions 8.1.2 and 9.0.1, a malicious Matrix server can use a foreign user's MXID in an OpenID exchange, allowing a bad actor to impersonate users when using the provisioning API. The library does not check that the servername part of the `sub` parameter (containing the user's *claimed* MXID) is the the same as the servername we are talking to. A malicious actor could spin up a server on any given domain, respond with a `sub` parameter according to the user they want to act as and use the resulting token to perform provisioning requests. Versions 8.1.2 and 9.0.1 contain a patch. As a workaround, disable the provisioning API.
Weakness: CWE-287
Which versions are affected by CVE-2023-38691?
4 open source packages ship an affected version, including matrix-appservice-bridge. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
matrix-appservice-bridge npm | From 4.0.0 | 8.1.2 |
matrix-appservice-bridge npm | From 4.0.0 | 8.1.2 |
matrix-appservice-bridge npm | From 9.0.0 | 9.0.1 |
matrix-appservice-bridge npm | From 9.0.0 | 9.0.1 |
Products include Matrix Matrix-Appservice-Bridge.
How do I fix CVE-2023-38691?
Upgrade matrix-appservice-bridge to a fixed version for your release line: 8.1.2 or 9.0.1.
Upgrade, and rotate credentials and sessions that may have been exposed. More about Authentication bypass.
Is CVE-2023-38691 being exploited?
There is no known exploitation of CVE-2023-38691 in the wild and no public exploit code.
Other vulnerabilities in matrix-org matrix-appservice-bridge
Sources
Also known as GHSA-vc7j-h8xg-fv5x.