Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It is possible to use matrix network to mirror one file on each instance #1938

Closed
matrixbot opened this issue Nov 1, 2024 · 3 comments
Closed

Comments

@matrixbot
Copy link
Collaborator

This issue was originally created by @MrCyjaneK at matrix-org/dendrite#1938.

Background information

  • Dendrite version or git SHA: c6acb94af4bc88eb999e56da4f6e0132438cb50a
  • Monolith or Polylith?: Polylith
  • SQLite3 or Postgres?: Postgres
  • Running in Docker?: no
  • go version: go1.16.4 linux/amd64

Description

It is possible to use my instance, to mirror content of other instances (and vice-versa). I've sent an image, a simple, unencrypted image, from @cyjan:mrcyjanek.net to a small group (with users from mrcyjanek.net, matrix.org and t2bot.io). This group is private.
Here is source of this message:

{
  "content": {
    "body": "image.png",
    "info": {
      "h": 85,
      "mimetype": "image/png",
      "size": 2078,
      "thumbnail_info": {
        "h": 85,
        "mimetype": "image/png",
        "size": 2704,
        "w": 118
      },
      "thumbnail_url": "mxc://mrcyjanek.net/dc1e9f9e95ea2de764fe8f9ce8c2b7e86af560477cbdebe13e87245c3ad09830",
      "w": 118
    },
    "msgtype": "m.image",
    "url": "mxc://mrcyjanek.net/c5b45a1748453dfca594c237a023debd0c64ffe0f597bb3dadce7dcb83359e31"
  },
  "event_id": "$5A6qfTV7eaegMCtyG2AVDer7yfl-_YhmY-eqQBzmmFM",
  "origin_server_ts": 1627160326464,
  "sender": "@cyjan:mrcyjanek.net",
  "type": "m.room.message",
  "unsigned": {
    "transaction_id": "m1627160325134.40"
  },
  "room_id": "!DTDvPmpFDiacEsAsYt:matrix.org"
}

And I can access that image by these links:

That's all fine - but why is my image also being sent to other homeservers?

Steps to reproduce

  • Send an image
  • Copy link
  • Replace domain

Expected result

matrix.org, mrcyjanek.net and t2bot.io should only reply to this request, and other homeservers, which don't participate in this chat should ignore this request, since this group is private they shouldn't be able to access this image.

p.s. is it okay that this link just work for one-to-one chats and private groups? Shouldn't it require some form of authentication? I know that this issue doesn't happen with E2EE chat, but still private group should be private.

@matrixbot
Copy link
Collaborator Author

This comment was originally posted by @neilalexander at matrix-org/dendrite#1938 (comment).

Ultimately this is working as intended. The media API is not aware of room memberships or resident servers.

It’s also not so much that your media is being proactively replicated to other servers when it is first uploaded, but rather that those servers are seeking out the location of the media from the origin server in the URL when you ask them to.

@matrixbot
Copy link
Collaborator Author

This comment was originally posted by @MrCyjaneK at matrix-org/dendrite#1938 (comment).

And it isn't viewed as an issue? I know that it isn't send to the whole federation at once, but somebody with list of all servers could just use them as a mirror for a file... Are there any plans to implement some kind of authentication before allowing to access /_matrix/media paths?

@matrixbot
Copy link
Collaborator Author

This comment was originally posted by @kegsay at matrix-org/dendrite#1938 (comment).

This isn't a Dendrite-specific issue.

https://github.com/matrix-org/matrix-doc/issues/701

See also: https://github.com/matrix-org/synapse/issues/2150

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

No branches or pull requests

1 participant