CVE-2022-29166: Matrix appservice irc Improper Handling Of Multiline Messages Vulnerability
HIGHCVE-2022-29166 is a HIGH (CVSS 8.0) improper handling of multiline messages vulnerability (CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')) affecting Matrix appservice irc libraries in the npm ecosystem. The issue involves improper handling of multiline messages in node-irc affects matrix-appservice-irc. Remediation is available by upgrading affected packages to version 0.33.2.
CVE-2022-29166 at a Glance
Security Impact
CVSS: 8.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:R/S:U/C:H/I:H/A:H).
How to Fix CVE-2022-29166
To remediate this vulnerability, upgrade all affected Matrix appservice irc 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-irc@0.33.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls matrix-appservice-irc
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2022-29166, inspect your project dependencies using npm:
npm ls matrix-appservice-irc
Analyze the terminal output to locate any version of Matrix appservice irc in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.33.2), your application is affected.
Note: The npm ls matrix-appservice-irc 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-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection'), where the product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. In Matrix appservice irc, 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-2022-29166 Affected Matrix appservice irc Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
matrix-appservice-irc
|
npm |
< 0.33.2
|
0.33.2
|
References
Frequently Asked Questions
What is CVE-2022-29166?
Which Matrix appservice irc versions are affected?
What version fixes CVE-2022-29166?
Is matrix-appservice-irc affected?
What is the CVSS score of CVE-2022-29166?
What CWE is associated with CVE-2022-29166?
How can I check npm dependencies for CVE-2022-29166?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-37hr-348p-rmf4",
"modified" : "2022-05-23T20:17:07Z",
"published" : "2022-05-23T20:17:07Z",
"aliases" : [ "CVE-2022-29166" ],
"summary" : "Improper handling of multiline messages in node-irc affects matrix-appservice-irc",
"details" : "matrix-appservice-irc provides an IRC bridge for Matrix. The vulnerability in node-irc allows an attacker to manipulate a Matrix user into executing IRC commands by having them reply to a maliciously crafted message. The vulnerability has been patched in matrix-appservice-irc 0.33.2. In terms of a workaround, users should refrain from replying to messages from untrusted participants in IRC-bridged Matrix rooms. ",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "matrix-appservice-irc"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.33.2"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.33.1"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/matrix-org/matrix-appservice-irc/security/advisories/GHSA-37hr-348p-rmf4"
}, {
"type" : "WEB",
"url" : "https://github.com/matrix-org/node-irc/security/advisories/GHSA-52rh-5rpj-c3w6"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-29166"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/matrix-org/matrix-appservice-irc"
}, {
"type" : "WEB",
"url" : "https://matrix.org/blog/2022/05/04/0-34-0-security-release-for-matrix-appservice-irc-high-severity"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-74" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-05-23T20:17:07Z",
"nvd_published_at" : "2022-05-05T23:15:00Z"
}
}