CVE-2022-29166 Improper handling of multiline messages in matrix-appservice-irc

High 8.0 Published Updated

An attacker can trick Matrix users into executing arbitrary IRC commands by replying to maliciously crafted messages in bridged rooms.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2022-29166?

CVE-2022-29166 is a high-severity command injection vulnerability in matrix-org matrix-appservice-irc, published on 5 May 2022. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

Official description

matrix-appservice-irc is a Node.js 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. Refrain from replying to messages from untrusted participants in IRC-bridged Matrix rooms. There are no known workarounds for this issue.

Weakness: CWE-74

Which versions are affected by CVE-2022-29166?

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

PackageAffectedFixed in
matrix-appservice-irc npmAll versions0.33.2
matrix-appservice-irc npmAll versions0.33.2

Products include Matrix Matrix Irc Bridge.

How do I fix CVE-2022-29166?

Upgrade matrix-appservice-irc to 0.33.2 or later.

Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.

Is CVE-2022-29166 being exploited?

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

Sources

Also known as GHSA-37hr-348p-rmf4.

Is CVE-2022-29166 in your software?

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

Check your SBOMs for free