GHSA-52rh-5rpj-c3w6: Matrix org irc Improper Handling Of Multiline Messages Vulnerability

HIGH
CVSS 8.0
CWE-74 CWE-93
Published
Advisory Summary

GHSA-52rh-5rpj-c3w6 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 org irc libraries in the npm ecosystem. The issue involves improper handling of multiline messages in node-irc. Remediation is available by upgrading affected packages to version 1.2.1.

GHSA-52rh-5rpj-c3w6 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-52rh-5rpj-c3w6
Severity HIGH
CVSS v3.1 Base Score 8.0
CWE Classification CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
Affected Product Matrix org irc
Package Ecosystem npm
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix GHSA-52rh-5rpj-c3w6

To remediate this vulnerability, upgrade all affected Matrix org 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.

matrix-org-irc fixed: 1.2.1
npm install matrix-org-irc@1.2.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls matrix-org-irc

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-52rh-5rpj-c3w6, inspect your project dependencies using npm:

npm ls matrix-org-irc

Analyze the terminal output to locate any version of Matrix org irc in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.2.1), your application is affected.

Note: The npm ls matrix-org-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 org 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

node-irc is a socket wrapper for the IRC protocol that extends Node.js' EventEmitter. The vulnerability allows an attacker to manipulate a Matrix user into executing IRC commands by having them reply to a maliciously crafted message. Incorrect handling of a CR character allowed for making part of the message be sent to the IRC server verbatim rather than as a message to the channel. The vulnerability has been patched in node-irc version 1.2.1.

GHSA-52rh-5rpj-c3w6 Affected Matrix org irc Versions

1 component(s)
Fixed Versions:
1.2.1
Product / Package Ecosystem Affected Versions Fixed Version
matrix-org-irc
npm
< 1.2.1
1.2.1

References

Frequently Asked Questions

What is GHSA-52rh-5rpj-c3w6?
GHSA-52rh-5rpj-c3w6 is a security vulnerability in Matrix org irc involving Improper handling of multiline messages in node-irc under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection').
Which Matrix org irc versions are affected?
Affected versions include releases prior to 1.2.1 across affected packages: matrix-org-irc.
What version fixes GHSA-52rh-5rpj-c3w6?
Upgrading to 1.2.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is matrix-org-irc affected?
Yes, matrix-org-irc is affected in releases prior to 1.2.1. Upgrade your dependency to 1.2.1 or later.
What is the CVSS score of GHSA-52rh-5rpj-c3w6?
GHSA-52rh-5rpj-c3w6 has a CVSS v3.1 base score of 8.0 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with GHSA-52rh-5rpj-c3w6?
GHSA-52rh-5rpj-c3w6 is classified under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') (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.).
How can I check npm dependencies for GHSA-52rh-5rpj-c3w6?
Run the dependency tree command: 'npm ls matrix-org-irc'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-52rh-5rpj-c3w6",
  "modified" : "2026-02-11T21:54:44Z",
  "published" : "2022-05-05T16:00:50Z",
  "aliases" : [ ],
  "summary" : "Improper handling of multiline messages in node-irc",
  "details" : "node-irc is a socket wrapper for the IRC protocol that extends Node.js' EventEmitter. The vulnerability allows an attacker to manipulate a Matrix user into executing IRC commands by having them reply to a maliciously crafted message. Incorrect handling of a CR character allowed for making part of the message be sent to the IRC server verbatim rather than as a message to the channel.\nThe vulnerability has been patched in node-irc version 1.2.1.",
  "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-org-irc"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.2.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.2.0"
    }
  } ],
  "references" : [ {
    "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" : "WEB",
    "url" : "https://github.com/matrix-org/node-irc/commit/2976c856df37660a9d664e94c857c796de2e34f7"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/matrix-org/node-irc/commit/e3eb9c15f8240e9c92365f5ffc3944469229771b"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/matrix-org/node-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", "CWE-93" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-05-05T16:00:50Z",
    "nvd_published_at" : null
  }
}