Vulnerabilities in pkg:npm/matrix-appservice-bridge
PACKAGECVE-2023-38691 is a MODERATE (CVSS 5.0) matrix-appservice-bridge doesn't verify the sub vulnerability (CWE-287: Improper Authentication) affecting Matrix appservice bridge libraries in the npm ecosystem. The issue involves matrix-appservice-bridge doesn't verify the sub parameter of an openid token exhange, allowing unauthorized access to provisioning apis. Remediation is available by upgrading affected packages to version 8.1.2, 9.0.1.
pkg:npm/matrix-appservice-bridge
Vulnerability advisories affecting package pkg:npm/matrix-appservice-bridge. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-vc7j-h8xg-fv5x | CVE-2023-38691 | MODERATE | matrix-appservice-bridge doesn't verify the sub parameter of an openId token exhange, allowing unauthorized access to provisioning APIs |
| GHSA-35g4-qx3c-vjhx | CVE-2021-32659 | MODERATE | Automatic room upgrade handling can be used maliciously to bridge a room non-consentually |
CVE-2023-38691 at a Glance
Security Impact
CVSS: 5.0
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:C/C:L/I:N/A:N).
How to Fix CVE-2023-38691
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@8.1.2
npm install matrix-appservice-bridge@9.0.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-2023-38691, 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 8.1.2), 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-287: Improper Authentication, where when an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct. 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-2023-38691 Affected Matrix appservice bridge Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
matrix-appservice-bridge
|
npm |
≥ 4.0.0
< 8.1.2
|
8.1.2
|
|
matrix-appservice-bridge
|
npm |
≥ 9.0.0
< 9.0.1
All 1 versions
9.0.0
|
9.0.1
|
References
Frequently Asked Questions
What is CVE-2023-38691?
Which Matrix appservice bridge versions are affected?
What version fixes CVE-2023-38691?
Is matrix-appservice-bridge affected?
What is the CVSS score of CVE-2023-38691?
What CWE is associated with CVE-2023-38691?
How can I check npm dependencies for CVE-2023-38691?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-vc7j-h8xg-fv5x",
"modified" : "2023-08-04T17:26:32Z",
"published" : "2023-08-04T17:26:32Z",
"aliases" : [ "CVE-2023-38691" ],
"summary" : "matrix-appservice-bridge doesn't verify the sub parameter of an openId token exhange, allowing unauthorized access to provisioning APIs",
"details" : "### Impact\n\nA 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.\n\n### Details\n\nThe library does not check that the servername part of the `sub` parameter (containing the user's *claimed* MXID) is 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.\n\n### Workarounds\n\nDisable the provisioning API. If the bridge does not use the provisioning API, you are not vulnerable.\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "matrix-appservice-bridge"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.0.0"
}, {
"fixed" : "8.1.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "matrix-appservice-bridge"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "9.0.0"
}, {
"fixed" : "9.0.1"
} ]
} ],
"versions" : [ "9.0.0" ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/matrix-org/matrix-appservice-bridge/security/advisories/GHSA-vc7j-h8xg-fv5x"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-38691"
}, {
"type" : "WEB",
"url" : "https://github.com/matrix-org/matrix-appservice-bridge/commit/4c6723a5e7beda65cdf1ae5dbb882e8beaac8552"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/matrix-org/matrix-appservice-bridge"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-287" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-08-04T17:26:32Z",
"nvd_published_at" : "2023-08-04T17:15:11Z"
}
}