{"id":"CVE-2024-39691","published":"2024-07-05T18:42:06Z","modified":"2024-08-02T04:26:15Z","title":"Malicious Matrix homeserver can leak truncated message content of messages it shouldn't have access to","vendor":"matrix-org","product":"matrix-appservice-irc","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":4.3,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00668,"percentile":0.46911,"provenance":"source"},"cwes":[{"id":"CWE-280","name":"Improper Handling of Insufficient Permissions or Privileges"},{"id":"CWE-755","name":"Improper Handling of Exceptional Conditions"}],"references":[{"url":"https://github.com/matrix-org/matrix-appservice-irc/security/advisories/GHSA-w9mh-5x8j-9754","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/matrix-org/matrix-appservice-irc/pull/1804","tags":["x_refsource_MISC"]},{"url":"https://github.com/matrix-org/matrix-appservice-irc/commit/1835e047f269001054be4c68867797aa12372a0f","tags":["x_refsource_MISC"]},{"url":"https://github.com/matrix-org/matrix-appservice-irc/blob/d5d67d1d3ea3f0f6962a0af2cc57b56af3ad2129/config.sample.yaml#L601-L604","tags":["x_refsource_MISC"]}],"priority":{"score":12.4,"factors":[{"name":"EPSS percentile","points":9.38},{"name":"CVSS severity","points":3.01}]},"vendorSlug":"matrix-org","affectedVersions":[{"vendor":"matrix-org","product":"matrix-appservice-irc","versions":["< 2.0.1"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2024-07-08T15:48:15.391115Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"matrix-appservice-irc","vulnerableRanges":["<2.0.1"],"patched":["2.0.1"],"from":["GHSA-w9mh-5x8j-9754"],"provenance":"source"}],"summary":{"text":"A flaw in matrix-appservice-irc, the Node.js IRC bridge for the Matrix protocol, versions before 2.0.1, causes the bridge to rely on the homeserver-supplied origin_server_ts timestamp when deciding whether a user may see an event they are replying to. An attacker running a malicious Matrix homeserver that is joined to a room bridged by an affected instance can fabricate that timestamp to make the bridge include a truncated version of messages the attacker's server should not have access to in the resulting IRC message, requiring only that the malicious homeserver be present in the room.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:58:11Z"},"euvd":{"id":"EUVD-2024-2434","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-matrix-org-matrix-appservice-irc-cve-2023-38700","parents":[{"from":"CVE-2024-32000","to":"CVE-2024-39691","relation":"successor","confidence":"high","kind":"lineage","evidence":[{"kind":"version-step","provenance":"source","package":"npm:matrix-appservice-irc","fromFixed":"2.0.0","toFixed":"2.0.1","daysApart":84},{"kind":"same-code","provenance":"machine","files":["src/bridge/MatrixHandler.ts"],"commits":["https://github.com/matrix-org/matrix-appservice-irc/commit/4af7d3009f10b1f2fb810784c1e491d9d3bee82b","https://github.com/matrix-org/matrix-appservice-irc/commit/1835e047f269001054be4c68867797aa12372a0f"],"basis":"shared function","functions":["MatrixHandler"]},{"kind":"similar","provenance":"machine","score":0.35,"basis":"same product + CWE + description similarity"}]},{"from":"CVE-2023-38700","to":"CVE-2024-39691","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/bridge/MatrixHandler.ts"],"commits":["https://github.com/matrix-org/matrix-appservice-irc/commit/8bbd2b69a16cbcbeffdd9b5c973fd89d61498d75","https://github.com/matrix-org/matrix-appservice-irc/commit/1835e047f269001054be4c68867797aa12372a0f"],"basis":"shared function","functions":["MatrixHandler"]}]}],"packageHistory":[{"cve":"CVE-2023-38690","published":"2023-08-04","fixed":"1.0.1","kev":false},{"cve":"CVE-2023-38700","published":"2023-08-04","fixed":"1.0.1","kev":false},{"cve":"CVE-2024-32000","published":"2024-04-12","fixed":"2.0.0","kev":false},{"cve":"CVE-2024-39691","published":"2024-07-05","fixed":"2.0.1","kev":false},{"cve":"CVE-2025-27146","published":"2025-02-25","fixed":"3.0.4","kev":false}],"package":"npm:matrix-appservice-irc"}}