CVE-2021-32659: Matrix appservice bridge Automatic Room Upgrade Handling Can Vulnerability
MODERATECVE-2021-32659 is a MODERATE (CVSS 6.5) automatic room upgrade handling can vulnerability (CWE-306: Missing Authentication for Critical Function) affecting Matrix appservice bridge libraries in the npm ecosystem. The issue involves automatic room upgrade handling can be used maliciously to bridge a room non-consentually. Remediation is available by upgrading affected packages to version 2.6.1.
CVE-2021-32659 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N).
How to Fix CVE-2021-32659
To remediate this vulnerability, upgrade all affected Matrix appservice bridge dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install matrix-appservice-bridge@2.6.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls matrix-appservice-bridge
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2021-32659, inspect your project dependencies using npm:
npm ls matrix-appservice-bridge
Analyze the terminal output to locate any version of Matrix appservice bridge in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.6.1), your application is affected.
Note: The npm ls matrix-appservice-bridge command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-306: Missing Authentication for Critical Function, where the product does not perform any authentication for functionality that requires a provable user identity or consumes a significant amount of resources. In Matrix appservice bridge, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2021-32659 Affected Matrix appservice bridge Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
matrix-appservice-bridge
|
npm |
< 2.6.1
|
2.6.1
|
References
Frequently Asked Questions
What is CVE-2021-32659?
Which Matrix appservice bridge versions are affected?
What version fixes CVE-2021-32659?
Is matrix-appservice-bridge affected?
What is the CVSS score of CVE-2021-32659?
What CWE is associated with CVE-2021-32659?
How can I check npm dependencies for CVE-2021-32659?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-35g4-qx3c-vjhx",
"modified" : "2021-06-16T20:08:37Z",
"published" : "2021-06-21T17:09:22Z",
"aliases" : [ "CVE-2021-32659" ],
"summary" : "Automatic room upgrade handling can be used maliciously to bridge a room non-consentually ",
"details" : "### Impact\n\nIf 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 mailcious admin of a bridged room can repoint the traffic to a different room without the new room being aware.\n\n\n### Patches\n\nVersions 2.6.1 and greater are patched.\n\n### Workarounds\n\nDisabling the automatic room upgrade handling can be done by removing the `roomUpgradeOpts` key from the `Bridge` class options. \n\n### References\n\nThe issue is patched by https://github.com/matrix-org/matrix-appservice-bridge/pull/330\n\n### For more information]\n\nIf you have any questions or comments about this advisory, email us at security@matrix.org.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "matrix-appservice-bridge"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.6.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/matrix-org/matrix-appservice-bridge/security/advisories/GHSA-35g4-qx3c-vjhx"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-32659"
}, {
"type" : "WEB",
"url" : "https://github.com/matrix-org/matrix-appservice-bridge/pull/330"
}, {
"type" : "WEB",
"url" : "https://github.com/matrix-org/matrix-appservice-bridge/commit/b69e745584a34fcfd858df33e4631e420da07b9f"
}, {
"type" : "WEB",
"url" : "https://github.com/matrix-org/matrix-appservice-bridge/releases/tag/2.6.1"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-306" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2021-06-16T20:08:37Z",
"nvd_published_at" : "2021-06-16T19:15:00Z"
}
}