CVE-2024-39691 Malicious Matrix homeserver can leak truncated message content of messages it shouldn't have access to
A malicious Matrix homeserver can trick the IRC bridge into leaking truncated message content it should not access by fabricating timestamps.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-39691?
CVE-2024-39691 is a medium-severity vulnerability in matrix-org matrix-appservice-irc, published on 5 Jul 2024. Any signed-in user can exploit it over the network, with no action from the victim.
Official description
matrix-appservice-irc is a Node.js IRC bridge for the Matrix messaging protocol. The fix for GHSA-wm4w-7h2q-3pf7 / CVE-2024-32000 included in matrix-appservice-irc 2.0.0 relied on the Matrix homeserver-provided timestamp to determine whether a user has access to the event they're replying to when determining whether or not to include a truncated version of the original event in the IRC message. Since this value is controlled by external entities, a malicious Matrix homeserver joined to a room in which a matrix-appservice-irc bridge instance (before version 2.0.1) is present can fabricate the timestamp with the intent of tricking the bridge into leaking room messages the homeserver should not have access to. matrix-appservice-irc 2.0.1 drops the reliance on `origin_server_ts` when determining whether or not an event should be visible to a user, instead tracking the event timestamps internally. As a workaround, it's possible to limit the amount of information leaked by setting a reply template that doesn't contain the original message.
Which versions are affected by CVE-2024-39691?
2 open source packages ship an affected version, including matrix-appservice-irc.
| Package | Affected | Fixed in |
|---|---|---|
matrix-appservice-irc npm | All versions | 2.0.1 |
matrix-appservice-irc npm | All versions | 2.0.1 |
How do I fix CVE-2024-39691?
Upgrade matrix-appservice-irc to 2.0.1 or later.
Is CVE-2024-39691 being exploited?
There is no known exploitation of CVE-2024-39691 in the wild and no public exploit code.
Sources
Also known as GHSA-w9mh-5x8j-9754.