CVE-2021-32659 Automatic room upgrade handling can be used maliciously to bridge a room non-consentually

Medium 6.5 Published Updated

A malicious admin can redirect bridged room traffic to an unauthorized room by exploiting missing predecessor validation in Matrix appservice bridges.

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-2021-32659?

CVE-2021-32659 is a medium-severity vulnerability in matrix-org matrix-appservice-bridge, published on 16 Jun 2021. Any signed-in user can exploit it over the network, with no action from the victim.

Official description

Matrix-appservice-bridge is the bridging service for the Matrix communication program's application services. In versions 2.6.0 and earlier, if a bridge has room upgrade handling turned on in the configuration (the `roomUpgradeOpts` key when instantiating a new `Bridge` instance.), any `m.room.tombstone` event it encounters will be used to unbridge the current room and bridge into the target room. However, the target room `m.room.create` event is not checked to verify if the `predecessor` field contains the previous room. This means that any malicious admin of a bridged room can repoint the traffic to a different room without the new room being aware. Versions 2.6.1 and greater are patched. As a workaround, disabling the automatic room upgrade handling can be done by removing the `roomUpgradeOpts` key from the `Bridge` class options.

Weakness: CWE-306

Which versions are affected by CVE-2021-32659?

2 open source packages ship an affected version, including matrix-appservice-bridge. It affects 1 product.

PackageAffectedFixed in
matrix-appservice-bridge npmAll versions2.6.1
matrix-appservice-bridge npmAll versions2.6.1

Products include Matrix Matrix-Appservice-Bridge.

How do I fix CVE-2021-32659?

Upgrade matrix-appservice-bridge to 2.6.1 or later.

Is CVE-2021-32659 being exploited?

There is no known exploitation of CVE-2021-32659 in the wild and no public exploit code.

Sources

Also known as GHSA-35g4-qx3c-vjhx.

Is CVE-2021-32659 in your software?

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

Check your SBOMs for free