CVE-2024-39691
JSON

4.3medium

Malicious Matrix homeserver can leak truncated message content of messages it shouldn't have access to

Severity
4.3medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.49% (higher than 43% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-w9mh-5x8j-9754

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.

Affected

Product or packageVersionsReported by
matrix-org matrix-appservice-irc< 2.0.1CVE List
matrix-appservice-irc (npm)before 2.0.1GitHub Advisory Database

All scores

GitHub_M4.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N
GitHub4.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N

Classification

CWE-280CWE-755

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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.

GitHub Advisory Database
Impact

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.

Patches

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.

Workarounds

It's possible to limit the amount of information leaked by setting a reply template that doesn't contain the original message. See these lines in the configuration file.

References
For more information

If you have any questions or comments about this advisory, please email us at security at matrix.org.

NVD (es)

Matrix-appservice-irc es un puente IRC de Node.js para el protocolo de mensajería Matrix. La solución para GHSA-wm4w-7h2q-3pf7/CVE-2024-32000 incluida en Matrix-appservice-irc 2.0.0 se basaba en la marca de tiempo proporcionada por el servidor doméstico de Matrix para determinar si un usuario tiene acceso al evento al que está respondiendo cuando determina si se incluye o no una versión truncada del evento original en el mensaje IRC. Dado que este valor está controlado por entidades externas, un servidor doméstico Matrix malicioso unido a una sala en la que está presente una instancia de puente Matrix-appservice-irc (anterior a la versión 2.0.1) puede fabricar la marca de tiempo con la intención de engañar al puente para fugar mensajes de la sala, mensajes a los que el servidor doméstico no debería tener acceso. Matrix-appservice-irc 2.0.1 elimina la dependencia de `origin_server_ts` al determinar si un evento debe ser visible o no para un usuario, en lugar de realizar un seguimiento interno de las marcas de tiempo del evento. Como solución alternativa, es posible limitar la cantidad de información filtrada configurando una plantilla de respuesta que no contenga el mensaje original.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-39691 changed 2024-08-02CVE Terms of Use
GitHub Advisory DatabaseGHSA-w9mh-5x8j-9754 changed 2026-09-10CC-BY-4.0
NVDCVE-2024-39691 changed 2026-06-17Public domain