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

feat: Setting for enabling files encryption and fix whitelist media types stopping E2EE uploads #33003

Merged
merged 17 commits into from
Aug 23, 2024

Conversation

yash-rajpal
Copy link
Member

@yash-rajpal yash-rajpal commented Aug 7, 2024

Proposed changes (including videos or screenshots)

E2EE files and uploads are uploaded as files of mime type application/octet-stream as we can't reveal the mime type of actual content since it is encrypted.

The server resolves the mime type of file as application/octet-stream but currently this doesn't play nicely with existing settings related to whitelisted and blacklisted media types.

E2EE files upload gets blocked if application/octet-stream is not a whitelisted media type.

This PR solves this issue by always accepting E2EE uploads even if application/octet-stream is not whitelisted but it will block the upload if application/octet-stream is black listed.

We also created a new setting for enabling/disabling encrypted uploads and mention this limitation in our settings description.

Issue(s)

Closes #32963

Steps to test or reproduce

Further comments

CORE-614

Copy link
Contributor

dionisio-bot bot commented Aug 7, 2024

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

Copy link

changeset-bot bot commented Aug 7, 2024

🦋 Changeset detected

Latest commit: 9d755af

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 34 packages
Name Type
@rocket.chat/core-typings Minor
@rocket.chat/i18n Minor
@rocket.chat/meteor Minor
@rocket.chat/api-client Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/fuselage-ui-kit Major
@rocket.chat/gazzodown Major
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/rest-typings Minor
@rocket.chat/ui-contexts Major
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/license Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/mock-providers Patch
@rocket.chat/web-ui-registration Major
@rocket.chat/uikit-playground Patch
@rocket.chat/models Patch
@rocket.chat/ui-avatar Major
@rocket.chat/ui-client Major
@rocket.chat/ui-video-conf Major
@rocket.chat/instance-status Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

codecov bot commented Aug 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.43%. Comparing base (94518af) to head (9d755af).
Report is 16 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #33003   +/-   ##
========================================
  Coverage    59.43%   59.43%           
========================================
  Files         2546     2546           
  Lines        63257    63257           
  Branches     14236    14236           
========================================
  Hits         37596    37596           
  Misses       22941    22941           
  Partials      2720     2720           
Flag Coverage Δ
unit 76.03% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@yash-rajpal yash-rajpal marked this pull request as ready for review August 9, 2024 18:36
@yash-rajpal yash-rajpal requested review from a team as code owners August 9, 2024 18:36
.changeset/stupid-fishes-relate.md Outdated Show resolved Hide resolved
apps/meteor/server/settings/e2e.ts Show resolved Hide resolved
apps/meteor/tests/end-to-end/api/rooms.ts Show resolved Hide resolved
Copy link
Member

@matheusbsilva137 matheusbsilva137 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, can you please link this PR to a task?

packages/core-typings/src/IUpload.ts Outdated Show resolved Hide resolved
apps/meteor/tests/e2e/e2e-encryption.spec.ts Show resolved Hide resolved
apps/meteor/tests/e2e/e2e-encryption.spec.ts Outdated Show resolved Hide resolved
apps/meteor/tests/e2e/e2e-encryption.spec.ts Outdated Show resolved Hide resolved
@jessicaschelly jessicaschelly added the stat: QA assured Means it has been tested and approved by a company insider label Aug 14, 2024
@yash-rajpal yash-rajpal added this to the 6.12 milestone Aug 16, 2024
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Aug 16, 2024
Copy link
Member

@rodrigok rodrigok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mobile should handle this new setting as well

@ggazzo ggazzo merged commit 58c0efc into develop Aug 23, 2024
49 checks passed
@ggazzo ggazzo deleted the fix/e2ee-file-upload branch August 23, 2024 02:34
}

// E2EE files are of type - application/octet-stream, application/octet-stream is whitelisted for E2EE files.
if (!fileUploadIsValidContentType(file?.type, isE2EEUpload(file) ? 'application/octet-stream' : undefined)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is breaking uploads on mobile

gabriellsh added a commit that referenced this pull request Sep 2, 2024
…ove/threadMetrics

* 'develop' of github.com:RocketChat/Rocket.Chat: (49 commits)
  feat: add `sidepanelNavigation` to Feature preview list (#33156)
  refactor: Realtime Monitoring Counters to TS (#33182)
  fix: restore tooltips to units Multiselect (#33174)
  test: Add unit test for RoomMenu options (#32891)
  chore: remove notifyListener call that was causing startup issues (#33154)
  fix: Multi-step modals closing unexpectedly (#33158)
  Revert "refactor: Realtime Monitoring Counters to TS" (#33170)
  refactor: Realtime Monitoring Counters to TS (#33166)
  refactor: Uses `source` instead of `room` to render the `OmnichannelRoomIcon` (#33118)
  refactor: Realtime Monitoring Overviews to TS (#33167)
  test: Add e2e tests for teams multi-step modals (#33168)
  feat: add Advanced settings accordion to `EditRoomInfo` (#33114)
  chore: Revive Livechat Storybook (#33137)
  refactor: Realtime `Doughnout Charts` to TS (#33092)
  feat: create contact endpoint (#32693)
  chore: remove left streaming code (#33039)
  fix: show only relevant userInfoActions for mentioned non-members (#31525)
  feat: Setting for enabling files encryption and fix whitelist media types stopping E2EE uploads (#33003)
  refactor: Replace proxy functions from `LivechatTyped` class with direct calls (#33110)
  Revert "fix: Inconsistent Markdown Formatting in Custom Status Field" (#33127)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

File upload inside E2E channels / direct messages
8 participants