Skip to content

Fix metadata leak in private room message forwarding#191

Merged
7w1 merged 1 commit intoSableClient:devfrom
dozro:fix/message-forward-meta-leak
Mar 12, 2026
Merged

Fix metadata leak in private room message forwarding#191
7w1 merged 1 commit intoSableClient:devfrom
dozro:fix/message-forward-meta-leak

Conversation

@dozro
Copy link
Contributor

@dozro dozro commented Mar 11, 2026

Description

fix metadata leak when forwarding from a private room by setting 'm.mentions' and 'm.relates_to' explicitly to 'null'

Fixes #190

Example

{
  "content": {
    "body": "(Forwarded message from a private room)\n\n> oi3fhif3h2qoifew",
    "format": "org.matrix.custom.html",
    "formatted_body": "<div data-forward-marker><p>(Forwarded message from a private room)</p><blockquote>oi3fhif3h2qoifew</blockquote></div>",
    "m.mentions": null,
    "m.relates_to": null,
    "moe.sable.message.forward": {
      "is_forwarded": true,
      "original_event_private": true,
      "original_timestamp": 1773267714441,
      "v": 1
    },
    "msgtype": "m.text"
  },
  "event_id": "$pM0XU5end_0rfHK4e54jZq0dfZHdivUgUxCiDZalTNI",
  "origin_server_ts": 1773267722160,
  "sender": "@client-testing:itsrye.dev",
  "type": "m.room.message",
  "unsigned": {
    "age": 23622,
    "transaction_id": "m1773267721992.3"
  },
  "room_id": "!ySMjK3zfhIHXNVlNDS:itsrye.dev"
}

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

@dozro dozro requested a review from a team March 11, 2026 22:26
@7w1 7w1 merged commit b15a0d3 into SableClient:dev Mar 12, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Forwarded messages from private room should strip related events

2 participants