CVE-2023-38691 matrix-appservice-bridge doesn't verify the sub parameter of an openId token exhange, allowing unauthorized access to provisioning APIs

Medium 5.0 Published Updated

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.

PackageAffectedFixed in
matrix-appservice-bridge npmFrom 4.0.08.1.2
matrix-appservice-bridge npmFrom 4.0.08.1.2
matrix-appservice-bridge npmFrom 9.0.09.0.1
matrix-appservice-bridge npmFrom 9.0.09.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.

Sources

Also known as GHSA-vc7j-h8xg-fv5x.

Is CVE-2023-38691 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free