CVE-2022-29166 Improper handling of multiline messages in matrix-appservice-irc
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.
| Package | Affected | Fixed in |
|---|---|---|
matrix-appservice-irc npm | All versions | 0.33.2 |
matrix-appservice-irc npm | All versions | 0.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.
Other vulnerabilities in matrix-org matrix-appservice-irc
- CVE-2022-39203 Parsing issue in matrix-org/node-irc leading to room takeovers
- CVE-2023-38690 matrix-appservice-irc IRC command injection via admin commands containing newlines
- CVE-2022-3971 matrix-appservice-irc PgDataStore.ts sql injection
- CVE-2022-39202 IRC mode parameter confusion in matrix-appservice-irc
- CVE-2023-38700 matrix-appservice-irc events can be crafted to leak parts of targeted messages from other bridged rooms
Sources
Also known as GHSA-37hr-348p-rmf4.