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

Multiple instances of wrong MIME type in file uploads #3848

Open
syldrathecat opened this issue Nov 8, 2024 · 0 comments
Open

Multiple instances of wrong MIME type in file uploads #3848

syldrathecat opened this issue Nov 8, 2024 · 0 comments
Labels
T-Defect Something isn't working: bugs, crashes, hangs and other reported problems

Comments

@syldrathecat
Copy link

Steps to reproduce

I don't have a reproduction for this and I'm not sure what causes it, but people who use Element X and upload media frequently result in uploads with invalid mimetypes specified -- in both the event JSON and in the mimetype passed to the media upload endpoint.

e.g. we see events like this

 "content": {
    <...>
    "info": {
      <...>
      "mimetype": "image/*",
      <...>
    },
    "msgtype": "m.image",
    "url": "<...>"
  },

Similarly, we have over 500 pieces of media in our database with the mime type image/*, which causes matrix-media-repo to fail to generate thumbnails.


Also, a separate issue maybe:

I have noticed that images uploaded in to encrypted rooms also get uploaded to the media upload endpoint with the "wrong" (i.e. original) mimetype. Encrypted media should be uploaded with the mimetype application/octet-stream to match the behavior of other clients.

Note: This is probably an information leak as it discloses to home-servers the types of files that users are sharing in E2EE chats.

(It is also inconvenient from the point of view of administration and being able to account encrypted media uploads.)

Outcome

--

Your phone model

No response

Operating system version

No response

Application version and app store

No response

Homeserver

No response

Will you send logs?

No

Are you willing to provide a PR?

No

@syldrathecat syldrathecat added the T-Defect Something isn't working: bugs, crashes, hangs and other reported problems label Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Defect Something isn't working: bugs, crashes, hangs and other reported problems
Projects
None yet
Development

No branches or pull requests

1 participant